This patch disables CRC lookup tables which consume quite some RAM.

Ok for trunk?

Johann

--

AVR: Disable generation of CRC lookup tables.

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.

diff --git a/gcc/common/config/avr/avr-common.cc b/gcc/common/config/avr/avr-common.cc
index 9059e7d2b48..7a05e19a8be 100644
--- a/gcc/common/config/avr/avr-common.cc
+++ b/gcc/common/config/avr/avr-common.cc
@@ -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 },

Reply via email to