[LLVMdev] Getting debug information w/ optimizations

Duncan Sands baldrick at free.fr
Thu Apr 10 11:15:38 PDT 2008


Hi, running llvm-gcc with optimization turns off debug info.  That
is because the LLVM optimizers do not yet know how to deal with it
well.

> 1)  The "Source Level Debugging with LLVM" documentation page states
> the following:  "Compiling a program with "-O3 -g" gives you full
> debug information that is always available and accurate for reading
> [...]"  Is this incorrect or am I missing something?  What is causing
> the debug info to be wiped?

It is not being generated in the first place.  The above quote reflects
a vision of the future and not present reality!

> 2)  Are the llvm-gcc -O levels (e.g. -O1, -O2, etc.) approximately
> equivalent to the regular gcc -O levels, or are they really quite
> different?  I couldn't find any recent discussion on this in the
> archives.

In my experience -O2 is about the same, while gcc's -O3 and llvm-gcc's
-O3 differ quite a lot.  Your mileage may vary :)

Ciao,

Duncan.



More information about the llvm-dev mailing list