------- Comment #2 from rguenth at gcc dot gnu dot org  2009-12-16 13:43 -------
The issue here is that the asm doesn't switch sections properly and we emit
LTO sections before the actual assembly.  So we end up with

...
        .section        .gnu.lto_.opts,"",@progbits
        .string "x\001\001,"
        .string "\323\377\001"
        .string ""
...
        .ascii  "\"\306\003T"
        .section        .gnu.lto_main
#APP
        .globl start; start: nop
#NO_APP
        .text
.globl main
        .type   main, @function
main:
        pushl   %ebp
        movl    %esp, %ebp
        popl    %ebp
        ret
        .size   main, .-main
        .comm   gnu_lto_v1,1,1

where after finishing .gnu.lto_.opts we switch "back" to .gnu.lto_main which
then has the toplevel asm appended.

Oops.

Now assembling the testcase w/o LTO also gets us

        .file   "t.c"
#APP
        .globl start; start: nop
#NO_APP
        .text
.globl main
        .type   main, @function
main:
...

thus the asm gets emitted in the default section.  Which means the testcase
is kind of invalid (and the issue is that we emit LTO stuff at the beginning,
not at the end where it could remain unspecified).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-12-16 13:43:16
               date|                            |
            Version|4.4.1                       |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42392

Reply via email to