18129 – [3.4 Regression] -fwritable-strings doesn't work (original) (raw)

| Description Jakub Jelinek 2004-10-24 19:44:36 UTC struct S { char *a, *b; }; extern void foo (struct S *); int main () { struct S s[] = { {"ABCDEFGH0123", "T"}, {"ABCDEFGH4567", "T"}, {"ABCDEFGH89ZYX", "T"}, {"IJK012", "T"}, {"IJK345", "T"}, {"IJK678", "T"}, {"IJKLMN", "T"}, {"IJKOPQ", "T"}, {0, 0} }; foo (s); return 0; } at -O2 -fwritable-strings results in 33 .data strings (one is "", so 32), while the program has just 16 - everything is duplicated and only one copy is used. With more strings in the table, the result is sometimes unlinkable due to undefined .LCxxx symbols. I'm very well aware that -fwritable-strings is deprecated, but either it should be killed already in GCC 3.4.x, or it should work. Comment 1 Drea Pinski 2004-10-24 19:56:22 UTC Confirmed. 20030422 (236) between 20030504 (237) Comment 4 Giovanni Bajo 2004-10-31 10:24:32 UTC Fixed. Comment 5 Drea Pinski 2004-10-31 14:28:15 UTC Should have been closed. | | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |