[LLVMdev] GCC/LLVM frame pointer incompatibility on ARM

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed Jul 16 00:57:58 PDT 2014


On Wed, Jul 16, 2014 at 11:45 AM, Tim Northover <t.p.northover at gmail.com> wrote:
>> As has been mentioned several times (*), LLVM and GCC setup frame pointer to
>> point to different stack slots on ARM. GCC's fp points to stack slot holding
>> lr while LLVM's fp points at the next slot.
>
> This looks flipped from my tests. Both create an { fp, lr } struct;
> GCC sets current fp to the address of lr in that struct; LLVM sets
> current fp to the address of fp in that struct.
>
>> Is this incompatibility intentional/desired or we could somehow unify GCC
>> and LLVM in this regard?
>
> What are the chances of getting GCC to change here? It's entirely a
> bike-shedding argument, but there are a couple of reasons to prefer
> LLVM's choice. It's most consistent with what *is* required in the
> AArch64 ABI, and it means fp really points to the frame record, not
> some random point half way through it.

It is also consistent with x86: we use exactly the same code to unwind
stack on both platforms.

>
> Cheers.
>
> Tim.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list