]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: Disable generation of CRC lookup tables.
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 6 Dec 2024 10:52:16 +0000 (11:52 +0100)
committerGeorg-Johann Lay <avr@gjlay.de>
Fri, 6 Dec 2024 13:44:16 +0000 (14:44 +0100)
With -foptimize-crc, large lookup tables may be generated which
are places in .rodata (RAM).  This patch disables such tables.

gcc/
* common/config/avr/avr-common.cc
(avr_option_optimization_table): Default to -fno-optimize-crc.

gcc/common/config/avr/avr-common.cc

index 9059e7d2b48521e011f2a808c8b92be3eb342d46..7a05e19a8bec3163bb7749edcc18398d1526af09 100644 (file)
@@ -32,6 +32,8 @@ static const struct default_options avr_option_optimization_table[] =
     // The only effect of -fcaller-saves might be that it triggers
     // a frame without need when it tries to be smart around calls.
     { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
+    // Avoid large lookup tables in RAM from -foptimize-crc.
+    { OPT_LEVELS_ALL, OPT_foptimize_crc, 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 },
     { OPT_LEVELS_1_PLUS, OPT_mfuse_add_, NULL, 1 },