[PATCH] Fix -fmerge-all-constants

Andrew Pinski pinskia@physics.uc.edu
Tue Jun 20 01:04:00 GMT 2006


> 
> Hi!
> 
> As shown on the attached testcase, GCC was emitting invalid assembler
> like:
>         .section        .rodata.str1.32,"aMS",@progbits,1
>         .align 32
>         .type   str1, @object
>         .size   str1, 36
> str1:
>         .ascii  "0123456789abcdefghijklmnopqrstuvwxyz"
>         .section        .rodata
> (the string is not zero terminated, so must not use mergeable string section).
> On the other side, say
> const char a[3] = "ab\0def";
> with -fmerge-all-constants can be safely put into mergeable string section,
> as '\0' is at the end of the object.
> This problem shows up with recent glibcs, so eventhough it doesn't appear
> to be a regression, I'd like to see this fixed not only on the trunk, but
> also on 4.1 branch.
> 
> Ok for trunk/4.1?

You should note we are in release branch right now so maybe this should
not be applied until after we are out of this mode as this is not a regression.
Yes this could cause glibc to fail to build with -fmerge-all-constants but
we might also cause other stuff to fail after this patch is applied.

Also did you test the patch and on which targets?

-- Pinski



More information about the Gcc-patches mailing list