[Bug middle-end/192] String literals don't obey -fdata-sections

amodra at bigpond dot net dot au gcc-bugzilla@gcc.gnu.org
Tue Nov 30 06:36:00 GMT 2004


------- Additional Comments From amodra at bigpond dot net dot au  2004-11-30 06:36 -------
This is true of other constants too.  For example, on powerpc-linux, compiling
the testcase in pr9571:
gcc -O2 -m32 -fdata-sections -fno-merge-constants -S /src/tmp/pr9571.c
gives:
        .file   "pr9571.c"
        .globl d
        .section        .sdata.d,"a",@progbits
        .align 3
        .type   d, @object
        .size   d, 8
d:
        .long   1074339512
        .long   1374389535
        .section        .rodata
        .align 3
.LC0:
        .long   1074339512
        .long   1374389535
        .section        ".text"
        .align 2
        .p2align 4,,15
        .globl f
        .type   f, @function
f:
        lis 9,.LC0@ha
        lfd 1,.LC0@l(9)
        blr
        .size   f,.-f
        .ident  "GCC: (GNU) 4.0.0 20041129 (experimental)"
        .section        .note.GNU-stack,"",@progbits

The duplication of the constant isn't ideal either.

-- 


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



More information about the Gcc-bugs mailing list