[Bug c/84184] gcc generates wrong relocations with negative offsets in struct arrays

2018-02-02 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84184 Eric Botcazou changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned a

[Bug c/84184] gcc generates wrong relocations with negative offsets in struct arrays (but not integral arrays)

2018-02-02 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84184 --- Comment #6 from Eric Botcazou --- > Could gcc generate warning without much of additional effort (or even better > an error) when it knows it is about to generate broken code? Generating broken code from invalid C is perfectly OK, but we cou

[Bug c/84184] gcc generates wrong relocations with negative offsets in struct arrays (but not integral arrays)

2018-02-02 Thread slyfox at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84184 --- Comment #5 from Sergei Trofimovich --- Good suggestion! I will do it. Could gcc generate warning without much of additional effort (or even better an error) when it knows it is about to generate broken code? For this code I guess the patter

[Bug c/84184] gcc generates wrong relocations with negative offsets in struct arrays (but not integral arrays)

2018-02-02 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84184 --- Comment #4 from Eric Botcazou --- I'd suggest fixing the code instead: extern struct s glo_s_middle_hidden[] __attribute__((visibility("hidden"))); which makes it valid C and generates correct code.

[Bug c/84184] gcc generates wrong relocations with negative offsets in struct arrays (but not integral arrays)

2018-02-02 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84184 Eric Botcazou changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c/84184] gcc generates wrong relocations with negative offsets in struct arrays (but not integral arrays)

2018-02-02 Thread slyfox at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84184 --- Comment #2 from Sergei Trofimovich --- > - large amount of code Jason pointed out the blowup happens due to byte-level reads (caused by 'char*' -> 'u64*' required alignment increase) thus it's expected. Only correctness issue is left.

[Bug c/84184] gcc generates wrong relocations with negative offsets in struct arrays (but not integral arrays)

2018-02-02 Thread slyfox at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84184 Sergei Trofimovich changed: What|Removed |Added CC||ebotcazou at gcc dot gnu.org --- Co