This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/83729] [8 Regression] AVR ICE on convert_memory_address_addr_space_1 at explow.c:300
- From: "gandalf at winds dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Jan 2018 04:23:02 +0000
- Subject: [Bug middle-end/83729] [8 Regression] AVR ICE on convert_memory_address_addr_space_1 at explow.c:300
- Auto-submitted: auto-generated
- References: <bug-83729-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83729
--- Comment #3 from gandalf at winds dot org ---
Another regression test case (compile with -O):
void code_to_ascii(char buf[1], unsigned int code)
{
__attribute__((used))
static const char __flash test[5]="ABCDE";
static const char __flash code_tab[32]="0123456789ABCDEFGHJKLMNPRSTUWXYZ";
buf[0]=code_tab[code];
}
Variable "test" is correctly placed in section .progmem.data.
Variable "code_tab" is incorrectly placed in section .rodata.
This causes a problem for programs that are larger than 64KB in size. In my
case, "code_to_ascii" is one of the last functions in my .c file, and therefore
it is at the very end of the executable. Since "code_tab" appears next to
"code_to_ascii" after the 64KB boundary, __flash no longer references the
correct area in program memory.
GCC 7.2 correctly places both variables in .progmem.data.