Hi, this patch turns off -fipa-icf-variables because it generates wrong
code like for PR92606. As there is no target hook that could decide
whether such optimizations are obsolete, disable such optimizations
alltogether until PR92932 (target hook to disable such optimizations
depending on object attributes and address-spcace) is available.
Ok to apply?
Johann
Work around PR ipa/92932 by disabling -fipa-icf-variables until
PR92932 will have been solved.
PR ipa/92932
PR target/92606
* common/config/avr/avr-common.c (avr_option_optimization_table)
<-fipa-icf-variables>: Disable.
Index: common/config/avr/avr-common.c
===================================================================
--- common/config/avr/avr-common.c (revision 279522)
+++ common/config/avr/avr-common.c (working copy)
@@ -38,6 +38,14 @@ static const struct default_options avr_
{ OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_mgas_isr_prologues, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_mmain_is_OS_task, NULL, 1 },
+ // FIXME: IPA incorrectly identifies variables in .progmem.data (accessed
+ // via LPM) with variables in .rodata (accessed via LD, LDD, LDS) like
+ // in PR92606. As there is no target hook to disable such optimizations
+ // depending on target attributes and / or address-spaces of the involved
+ // objects (filed as PR92932), ditch such malicious optimizations now until
+ // PR92932 is implemented and we can use that target hook to solve PR92606
+ // properly.
+ { OPT_LEVELS_ALL, OPT_fipa_icf_variables, NULL, 0 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};