On Tue, Aug 4, 2015 at 1:50 PM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Tue, Aug 4, 2015 at 1:45 PM, Segher Boessenkool > <seg...@kernel.crashing.org> 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. >
Where do we stand on this? We need the hard stack address at function entry for x86 without using frame pointer. I added __builtin_stack_top since __builtin_frame_address can't give us what we want. Should __builtin_stack_top be added to middle-end or x86 backend? Thanks. -- H.J.