avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why is AVR-LibC still using -fno-jump-tables?


From: Georg-Johann Lay
Subject: Why is AVR-LibC still using -fno-jump-tables?
Date: Sun, 6 Aug 2023 21:25:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

In devtools/gen-avr-lib-tree.sh we have

CFLAGS_BIG_MEMORY='-Os $(FNO_JUMP_TABLES)'

where FNO_JUMP_TABLES is resolved to -fno-jump-tables by configure.

CFLAGS_BIG_MEMORY is then used as build flags for cores and devices with more than 64 KiB of program memory (i.e. with 3-byte PC i.e. that have ELPM) with the exceptions of ATmega128RFR2 and ATmega1284RFR2.


Is there any benefit of still using that flag?


To all of my knowledge, -fno-jump-tables was used because avr-gcc assumed that jump tables reside in the lower 64 KiB of flash (.progmem), but that restriction was resolved with https://gcc.gnu.org/PR63223 which applies to avr-gcc v4.9.2+.

PR63223 removes assumptions on the placement of jump tables altogether, in particular there is no more the requirement that they reside in .progmem. Jump tables are now placed in .jumptables which the linker script locates after ordinary .text sections (even after .progmemx), and the code in libgcc takes care of that by using the full address width including RAMPZ as needed.


Johann



reply via email to

[Prev in Thread] Current Thread [Next in Thread]