[Bug middle-end/83805] [8 Regression] Wrong constant merging for objects in different address spaces

2018-01-11 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83805 --- Comment #10 from Georg-Johann Lay --- (In reply to Jakub Jelinek from comment #9) > I don't see any bug actually. You are just saying that the str1 variable is > __flash, during optimization (already in C FE) it optimizes str1[i] into >

[Bug middle-end/83805] [8 Regression] Wrong constant merging for objects in different address spaces

2018-01-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83805 --- Comment #9 from Jakub Jelinek --- I don't see any bug actually. You are just saying that the str1 variable is __flash, during optimization (already in C FE) it optimizes str1[i] into "0123456789"[i] and that is the string literal that is

[Bug middle-end/83805] [8 Regression] Wrong constant merging for objects in different address spaces

2018-01-11 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83805 --- Comment #8 from Georg-Johann Lay --- (In reply to Jakub Jelinek from comment #7) > Well, you have 3 objects, str1, str2 and the string literal, if the compiler > thinks all 3 are needed, it emits all of them. Without > -fmerge-all-constants

[Bug middle-end/83805] [8 Regression] Wrong constant merging for objects in different address spaces

2018-01-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83805 --- Comment #7 from Jakub Jelinek --- Well, you have 3 objects, str1, str2 and the string literal, if the compiler thinks all 3 are needed, it emits all of them. Without -fmerge-all-constants str1 can't be merged with str2 nor with any other

[Bug middle-end/83805] [8 Regression] Wrong constant merging for objects in different address spaces

2018-01-11 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83805 --- Comment #6 from Georg-Johann Lay --- (In reply to Jakub Jelinek from comment #1) > If so, avr should override the select_section and unique_section target > hooks and return something different for the __flash strings. Also tried

[Bug middle-end/83805] [8 Regression] Wrong constant merging for objects in different address spaces

2018-01-11 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83805 --- Comment #5 from Georg-Johann Lay --- (In reply to Jakub Jelinek from comment #4) > Well, 7.2 certainly doesn't have any special casing for address spaces in > categorize_decl_for_section etc., so before claiming it is a regression > you'd

[Bug middle-end/83805] [8 Regression] Wrong constant merging for objects in different address spaces

2018-01-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83805 --- Comment #4 from Jakub Jelinek --- Well, 7.2 certainly doesn't have any special casing for address spaces in categorize_decl_for_section etc., so before claiming it is a regression you'd better bisect what change actually changed it.

[Bug middle-end/83805] [8 Regression] Wrong constant merging for objects in different address spaces

2018-01-11 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83805 Georg-Johann Lay changed: What|Removed |Added Known to work||7.2.1 Summary|Wrong