]> git.ipfire.org Git - thirdparty/gcc.git/commit
avr: Fix ICE on optimize attribute.
authorSenthil Kumar Selvaraj <saaadhu@gcc.gnu.org>
Mon, 19 Jun 2023 06:29:12 +0000 (11:59 +0530)
committerSenthil Kumar Selvaraj <saaadhu@gcc.gnu.org>
Mon, 19 Jun 2023 06:29:12 +0000 (11:59 +0530)
commit53953b6f31f18ac2e2241f0c1f3c8d7ecec78e7f
treee1f08be411dec15ecd6591800901a59556d270c6
parent7360cba833cd921631818428a851e03ea88f1e8a
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.
gcc/config/avr/avr.opt
gcc/testsuite/gcc.target/avr/pr110086.c [new file with mode: 0644]