On Tue, Aug 4, 2015 at 1:45 PM, Segher Boessenkool <[email protected]> wrote: > On Tue, Aug 04, 2015 at 01:00:32PM -0700, H.J. Lu wrote: >> There is another issue with x86, maybe other targets. You >> can't get the real stack top when stack is realigned and >> -maccumulate-outgoing-args isn't used since ix86_expand_prologue >> will create and return another stack frame for >> __builtin_frame_address and __builtin_return_address. >> It will be wrong for __builtin_stack_top, which should >> return the real stack address. > > That's why I asked: > >> >> > You might have a reason why you want the entry stack address instead of >> >> > the >> >> > frame address, but you didn't really explain I think? Or I missed it. > > What would a C program do with this, that it cannot do with the frame > address, that would be useful and cannot be much better done in straight > assembler? Do you actually want to expose the argument pointer, maybe? >
Yes, we want to use the argument pointer as shown in testcases included in my patch. -- H.J.
