------- 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