This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Using the stack from inline assembly
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 13 Dec 2016 09:48:09 +0000
- Subject: Re: Using the stack from inline assembly
- Authentication-results: sourceware.org; auth=none
- References: <0869df4d-041c-2661-6b32-9273d67863cb@redhat.com>
On 13/12/16 07:13, Florian Weimer wrote:
> Is it possible to use the stack from inline assembly? I'm particularly
> interested in i386 and x86_64, and push/pop instructions and function calls.
>
> Will GCC automatically disable use of the red zone on x86_64 if inline
> assembly is used, or at least assume it's clobbered by inline assembly?
> If not, how is this supposed to work if it does at all?
It's up to the writer of inline asembly code to DTRT. You're
expected to know the ABI or not mess with the stack. It's not
as though you ever need it: any scratch memory can be passed in
to the asm.
Andrew.