This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using the stack from inline assembly


On 14/12/16 10:01, Segher Boessenkool wrote:
> On Wed, Dec 14, 2016 at 09:49:32AM +0000, Andrew Haley wrote:
>> On 13/12/16 18:15, Segher Boessenkool wrote:
>>> Clobbering "memory" does not work here.  Clobbering "rsp" however seems
>>> to work.  But, "seems to", I don't think there is a guarantee anywhere.
>>> Clobbering the stack pointer forces the use of the frame pointer, but is
>>> that guaranteed even?
>>
>> No, I think we shouldn't do that.  If it's necessary to save things on
>> the stack all we need to do is to avoid the red zone.  That really isn't
>> hard.
> 
> That was a workaround for doing this with released compiler versions,
> like e.g. anything you build current glibc with.

But so is my suggestion, and it's much safer IMO.

Andrew.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]