[LLVMdev] Transition C->bitcode->assembly->object looses frame pointers

James Molloy James.Molloy at arm.com
Tue Apr 5 05:40:03 PDT 2011


Hi,

The -disable-fp-elim flag must be passed to the part of the compilation process that actually performs that optimisation pass - when you run clang/llvm-gcc in one invocation, obviously it will just be that invocation, but in your first case it would be the llc command. That is where the IR gets lowered, so is where the FP elimination takes place.

Pass flags are not, as far as I'm aware, propagated in generated bitcode files - the same flags need to be given to each part of the pipeline.

Hope this helps,

James

> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Alexander Potapenko
> Sent: 05 April 2011 13:23
> To: llvmdev
> Subject: [LLVMdev] Transition C->bitcode->assembly->object looses frame
> pointers
>
> Hi everyone,
>
> We're doing some compile-time instrumentation according to the
> following scheme:
>
>   llvm-gcc -O1 -g $in -emit-llvm -S -o $name.ll
>   opt  -O2 -load Instr.so $INSTR_FLAGS $name.ll -S -o $name-inst.ll
>   llc  $name-inst.ll -o $name.S
>   g++ -c $name.S
>
> However it turns out that the code instrumented this way is missing
> frame pointers (e.g. backtrace() and/or libunwind cannot unwind the
> stack when necessary).
> Moreover, removing the instrumentation doesn't help: a simple
> transition to and from bitcode doesn't help:
>
>   llvm-gcc -O1 -g $in -emit-llvm -S -o $name.ll
>   llc  $name.ll -o $name.S
>   g++ -c $name.S
>
> We also tried to use Clang and to add -fno-omit-frame-pointers and
> --disable-fp-elim -- do not work either.
>
> On the other hand, compiling the code in a single pass of
> gcc/llvm-gcc/clang does preserve the frame pointers.
>
> Does anyone happen to know where the problem might be? Are there any
> other flags we're missing?
>
> Thanks,
> Alexander Potapenko
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.





More information about the llvm-dev mailing list