This is a relatively new ICE that I see on the avr target. Compliled with "version 14.0.1 20240118 (experimental) (avr)" $ avr-gcc pr83801.c -g -O3 -std=gnu99 -mmcu=atmega128 /* { dg-options { "-std=gnu99" } } */ /* { dg-do run { target { ! avr_tiny } } } */ __attribute((noinline,noclone)) char to_ascii (unsigned i) { static const char __flash code_tab[] = "0123456789"; return code_tab[i]; } int main() { if (to_ascii (2) != '2') __builtin_abort(); return 0; } I am not sure if it's related to address-spaces, but there are fails that don't have ASes like gcc.target/avr/torture/pr109907-2.c (but that has __int24 though). Target: avr Configured with: ../../source/gcc-master/configure --target=avr --disable-nls --with-dwarf2 --with-gnu-as --with-gnu-ld --disable-shared --with-fixed-point=no --with-long-double=64 --enable-languages=c,c++ Thread model: single Supported LTO compression algorithms: zlib gcc version 14.0.1 20240118 (experimental) (GCC)
The ICE actially goes away when I remove the __flash from the test case posted in comment #0.
This is the assert looking we don't add duplicate attrs, only enabled with -fchecking. Does it fail with GCC 13 as well (if you add -fchecking)?
(In reply to Richard Biener from comment #2) > Does it fail with GCC 13 as well (if you add -fchecking)? Yes. And it goes away without -g.
So it's not clear to when it's a regression (the checking was added with GCC 8). There might be a duplicate for this bug.
Most likely a dup of bug 100530.
Yes it is a dup of bug 100530. *** This bug has been marked as a duplicate of bug 100530 ***