[LLVMdev] GCC/LLVM frame pointer incompatibility on ARM

Yury Gribov y.gribov at samsung.com
Thu Jul 17 04:49:34 PDT 2014


On 07/16/2014 11:45 AM, Tim Northover 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.

Right, I misread the assembly :(

>> 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?

Well, their logic is that as long as FP is not part of ARM ABI they can 
make arbitrary choice
even if it complicates user's life. I really hope that Renato could 
persuade people that
this is worth changing.

> 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.

Yeah, I think everyone agrees on this.

-Y



More information about the llvm-dev mailing list