Re: [QUESTION] Extended Asm and red zone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 17, 2021 at 11:12:07PM +0300, Commeownist wrote:
> Is it safe to push onto the stack in an Extended Asm block if `-mred-
> zone` flag is specified (red zone is enabled)? Does GCC assume that any
> `asm` block invalidates red zone? Is some additional setup required to
> inform the compiler about it?

You have to follow the ABI in your inline asm.  You are typically
allowed to use N bytes of red zone, for some given N; but how will you
know how much the compiler already uses?

So (with most existing ABIs that have the "red zone" concept at all) you
cannot safely use it from inline asm.  Including with the x86-64 ELF ABI
you likely use.  Sorry.


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux