https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110086
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Senthil Kumar Selvaraj <saaa...@gcc.gnu.org>: https://gcc.gnu.org/g:53953b6f31f18ac2e2241f0c1f3c8d7ecec78e7f commit r14-1922-g53953b6f31f18ac2e2241f0c1f3c8d7ecec78e7f Author: Senthil Kumar Selvaraj <saaa...@gcc.gnu.org> Date: Mon Jun 19 11:59:12 2023 +0530 avr: Fix ICE on optimize attribute. This commit fixes an ICE when an optimize attribute changes the prevailing optimization level. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105069 describes the same ICE for the sh target, where the fix was to enable save/restore of target specific options modified via TARGET_OPTIMIZATION_TABLE hook. For the AVR target, mgas-isr-prologues and -mmain-is-OS_task are those target specific options. As they enable generation of more optimal code, this commit adds the Optimization option property to those option records, and that fixes the ICE. Regression run shows no regressions, and >100 new PASSes. PR target/110086 gcc/ChangeLog: * config/avr/avr.opt (mgas-isr-prologues, mmain-is-OS_task): Add Optimization option property. gcc/testsuite/ChangeLog: * gcc.target/avr/pr110086.c: New test.