[Bug target/122527] [avr] Wrong code when reading from __flash1 without ELPMx
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Nov 2 15:11:45 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122527
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Georg-Johann Lay <gjl@gcc.gnu.org>:
https://gcc.gnu.org/g:0b2c031cca4017c5f87af519f0977b33b4bcb284
commit r16-4932-g0b2c031cca4017c5f87af519f0977b33b4bcb284
Author: Georg-Johann Lay <avr@gjlay.de>
Date: Sun Nov 2 15:12:59 2025 +0100
AVR: target/122527 -- Don't use __load_N to load from __flash1.
This patch fixes a case where a 3 byte or 4 byte load from __flash1
uses __load_3/4 to read the value, which is wrong.
This only occured when the device has ELPM but not ELPMx (avr31).
PR target/122527
gcc/
* config/avr/avr.cc (avr_load_libgcc_p): Return false if
the address-space is not ADDR_SPACE_FLASH.
(avr_out_lpm_no_lpmx [addr=REG]): Handle sizes of 3 and 4 bytes.
More information about the Gcc-bugs
mailing list