This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/47071] Using -ffunction-sections produces bad assembler on my testcase
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 27 Dec 2010 20:19:41 +0000
- Subject: [Bug inline-asm/47071] Using -ffunction-sections produces bad assembler on my testcase
- Auto-submitted: auto-generated
- References: <bug-47071-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47071
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|assemble-failure |
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-12-27 20:19:34 UTC ---
Your testcase is invalid as you don't change back the section before the end of
the inline-asm.
Try:
static void asm_wrapper()
{
asm volatile (
".text\n"
".globl " "ctiTrampoline" "\n"
".hidden " "ctiTrampoline" "\n"
"ctiTrampoline" ":" "\n"
"pushl %ebp" "\n"
"movl %esp, %ebp" "\n"
"pushl %esi" "\n"
"pushl %edi" "\n"
"pushl %ebx" "\n"
"subl $0x3c, %esp" "\n"
"movl $512, %esi" "\n"
"movl 0x58(%esp), %edi" "\n"
"call *0x50(%esp)" "\n"
"addl $0x3c, %esp" "\n"
"popl %ebx" "\n"
"popl %edi" "\n"
"popl %esi" "\n"
"popl %ebp" "\n"
"ret" "\n"
".previous" "\n"
);
}