0

I am working on the llvm project. Recently I tryed to compiler one of my .c files using clang command line into an .s file by using the next command:

clang --target=arch -S -O0 select.c -o select.s

and it crashed in the backend in the function ARCHInstrInfo::storeRegToStackSlot with the backtrace of the stack. However when I tryed to do it in steps:

clang  -O0 -emit-llvm select.c -c -o select.bc
llc  -filetype=asm -march=arch  ./select.bc -o ./select.s  -print-after-all -debug-only isel

it succeeded !! (?) How can I see how the clang is calling to the backend (llc) ? I tryed to run the clang with -v flag but it didn't printed how it is calling to the backend...

yehudahs
  • 2,488
  • 8
  • 34
  • 54
  • You can't see "how the clang is calling to the backend (llc)" because it is not. llc is a command line tool that invoke the backend on some IR, but clang does not invoke, its driver will build the backend directly. – Joky Nov 20 '15 at 16:05

1 Answers1

0

So the first one that sticks out is that llc defaults to O2 rather than O0 so you might want to look there first.

echristo
  • 1,687
  • 10
  • 8