Bug 56164 - [avr] ICE: spill fail with __flash keyword
Summary: [avr] ICE: spill fail with __flash keyword
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.2
: P4 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: 56183
  Show dependency treegraph
 
Reported: 2013-01-31 14:24 UTC by demiurg_spb
Modified: 2016-10-20 12:17 UTC (History)
3 users (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail: 4.7.2
Last reconfirmed: 2013-02-07 00:00:00


Attachments
testcase (zip-archive) (4.09 KB, application/octet-stream)
2013-01-31 14:30 UTC, demiurg_spb
Details
Small an valis test case (179 bytes, text/plain)
2013-01-31 20:25 UTC, Georg-Johann Lay
Details

Note You need to log in before you can comment on or make changes to this bug.
Description demiurg_spb 2013-01-31 14:24:00 UTC
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
==================================================================
Comment 1 demiurg_spb 2013-01-31 14:30:00 UTC
Created attachment 29316 [details]
testcase (zip-archive)
Comment 2 Georg-Johann Lay 2013-01-31 15:24:58 UTC
(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
Comment 3 Georg-Johann Lay 2013-01-31 20:25:20 UTC
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.
Comment 4 Georg-Johann Lay 2013-02-07 17:45:56 UTC
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
Comment 5 Richard Biener 2013-04-11 07:58:55 UTC
GCC 4.7.3 is being released, adjusting target milestone.
Comment 6 Richard Biener 2014-06-12 13:52:33 UTC
Unsetting target milestone of open non-regression bug from version of branch being closed.
Comment 7 Pitchumani 2016-06-17 06:49:54 UTC
Not re-producible in trunk (gcc-7).
Comment 8 Senthil Kumar Selvaraj 2016-10-20 12:17:48 UTC
Could not reproduce this on 5.4 or trunk (7.0), closing as worksforme.