https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92606
--- Comment #23 from Georg-Johann Lay <gjl at gcc dot gnu.org> --- (In reply to Richard Biener from comment #22) > Should be fixed on trunk. Confirmation would be nice (checked x86 only). For AVR, this does not fix the attribute progmem case (for which it was originally reported, because that's an attribute and not an address-space. progmem is still in wide use: * C++, because g++ does not implement address-spaces (as opposed to clang/llvm). * Existing code that uses progmem, which is supposed to work. * Not all uses cases of progmem can be converted to address-spaces (PR84163), e.g. locating literals in program memory like in printf_P (PSTR ("Format string in flash: %d\n"), int_value); #define PSTR(s) \ (__extension__({ static const char __c[] PROGMEM = (s); &__c[0]; })) A solution would be a target hook like proposed in PR92932. Or switch off -fno-ipa-icf-variables per default for AVR. Less optimal code is still better than wrong code...