This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/39078] Registers in on clober list are cloberred when compiled with optimization (x86_64) ?
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Feb 2009 11:51:46 -0000
- Subject: [Bug inline-asm/39078] Registers in on clober list are cloberred when compiled with optimization (x86_64) ?
- References: <bug-39078-17264@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from ubizjak at gmail dot com 2009-02-06 11:51 -------
> > r11 is saved by the caller so this is the generated code is valid.
> > Since nothing else uses r11 in the inline-asm, the code is correct.
> The problem is not that r11 not saved at stack, but that saved on the stack
> value of r15 ALWAYS will be overwritten - by the 'call my_syscall' instruction
> and saved on the stack values of rbx, r12, r13 and r14 MAY BE overritten if
> my_syscall function wrote something to the stack
These values have been saved into red-zone area. Since gcc does not know that
you have a call in the asm it thinks that func_1 is a leaf function where
redzone area can be used for temporary storage.
You can use -mno-red-zone to disable red-zone, but in reality, you should not
call other functions from inside asm.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39078