Problem is present with __flash keyword, with PROGMEM everything is ok. Compiller output: ================================================================== module.c: In function 'foo': module.c:52:1: error: unable to find a register to spill in class 'BASE_POINTER_REGS' module.c:52:1: error: this is the insn: (insn 73 72 74 5 (set (reg:SF 66 [ D.1445 ]) (unspec:SF [ (reg:HI 30 r30) (const_int 0 [0]) ] UNSPEC_LPM)) module.c:28 9 {load_sf} (expr_list:REG_DEAD (reg:HI 30 r30) (nil))) module.c:52: confused by earlier errors, bailing out make.EXE: *** [../bin/test/test.elf] Error 1 ==================================================================
Created attachment 29316 [details] testcase (zip-archive)
(In reply to comment #1) > testcase (zip-archive) Please provide a test case, following the bug reporting instructions in http://gcc.gnu.org/bugs/#report
Created attachment 29322 [details] Small an valis test case Output with avr-gcc 4.7.2: avr-gcc -S -mmcu=atmega8 -Os foo.c foo.c: In function 'psy': foo.c:18:1: error: unable to find a register to spill in class 'POINTER_REGS' } ^ foo.c:18:1: error: this is the insn: (insn 26 25 28 2 (set (reg:SF 59 [ D.1396 ]) (unspec:SF [ (reg:HI 30 r30) (const_int 0 [0]) ] UNSPEC_LPM)) foo.c:9 22 {load_sf} (expr_list:REG_DEAD (reg:HI 30 r30) (nil))) foo.c:18:1: internal compiler error: in spill_failure, at reload1.c:2124 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Confirmed with: gcc version 4.7.3 20130207 (prerelease) [gcc-4_7-branch revision 195858] (GCC) Configured with: ../../gcc.gnu.org/gcc-4_7-branch/configure --target=avr --prefix=/local/gnu/install/gcc-4.7 --disable-nls --with-dwarf2 --enable-languages=c,c++ --enable-target-optspace=yes --with-avrlibc=yes Invocation: avr-gcc spill-flash-2.c -S -Os -mmcu=atmega8 spill-flash.c: In function 'psy': spill-flash.c:18:1: error: unable to find a register to spill in class 'POINTER_REGS' spill-flash.c:18:1: error: this is the insn: (insn 26 25 28 2 (set (reg:SF 59 [ D.1370 ]) (unspec:SF [ (reg:HI 30 r30) (const_int 0 [0]) ] UNSPEC_LPM)) spill-flash.c:9 9 {load_sf} (expr_list:REG_DEAD (reg:HI 30 r30) (nil))) spill-flash.c:18: confused by earlier errors, bailing out
GCC 4.7.3 is being released, adjusting target milestone.
Unsetting target milestone of open non-regression bug from version of branch being closed.
Not re-producible in trunk (gcc-7).
Could not reproduce this on 5.4 or trunk (7.0), closing as worksforme.