Bug 35664 - unable to find a register to spill in class 'FP_REGS'
Summary: unable to find a register to spill in class 'FP_REGS'
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.1
: P3 normal
Target Milestone: 4.4.5
Assignee: Eric Botcazou
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-22 16:22 UTC by Mike Stein
Modified: 2010-09-22 08:40 UTC (History)
4 users (show)

See Also:
Host:
Target: sparc-linux
Build:
Known to work: 4.6.0
Known to fail: 4.3.1 4.4.4 4.5.2
Last reconfirmed: 2010-09-21 10:51:12


Attachments
delta-reduced (736 bytes, text/plain)
2008-03-22 16:30 UTC, Mike Stein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Stein 2008-03-22 16:22:30 UTC
Hi,
compiling linux-2.6.24 for sparc fails with:

sparc-elf-gcc -c -O2 netdev-delta.c -mno-fpu"
netdev.c-11.i: In function 'e1000e_update_stats':
netdev.c-11.i:84: error: unable to find a register to spill in class 'FP_REGS'
netdev.c-11.i:84: error: this is the insn:
(insn 166 123 140 4 netdev.c-11.i:76 (set (reg:DI 262 [ <variable>.stats.ptc1522 ])
        (mem/s:DI (plus:SI (reg/v/f:SI 26 %i2 [orig:121 adapter ] [121])
                (reg:SI 24 %i0 [244])) [15 <variable>.stats.ptc1522+0 S8 A64])) 45 {*movdi_insn_sp32} (expr_list:REG_EQUIV (mem/s:DI (plus:SI (reg/v/f:SI 26 %i2 [orig:121 adapter ] [121])
                (reg:SI 24 %i0 [244])) [15 <variable>.stats.ptc1522+0 S8 A64])
        (nil)))
netdev.c-11.i:84: confused by earlier errors, bailing out

rev: 133439
Comment 1 Mike Stein 2008-03-22 16:30:10 UTC
Created attachment 15359 [details]
delta-reduced
Comment 2 Mike Stein 2008-04-02 16:55:16 UTC
Fails in trunk (133803) too
Comment 3 Arnaud Lacombe 2010-09-09 04:34:44 UTC
Some random config of the linux kernel, as of 2.6.36-rc3 results on the following

stat.c: In function 'show_stat':
stat.c:123:1: error: unable to find a register to spill in class 'FP_REGS'
stat.c:123:1: error: this is the insn:
(insn 43 49 50 3 stat.c:43 (set (reg:DI 281 [ D.14392_45->cpustat.user ])
        (mem/s:DI (plus:SI (reg:SI 25 %i1 [orig:500 __ptr ] [500])
                (reg:SI 15 %o7 [orig:128 D.16865 ] [128])) [7 D.14392_45->cpustat.user+0 S8 A64])) 46 {*movdi_insn_sp32} (expr_list:REG_EQUIV (mem/s:DI (plus:SI (reg:SI 25 %i1 [orig:500 __ptr ] [500])
                (reg:SI 15 %o7 [orig:128 D.16865 ] [128])) [7 D.14392_45->cpustat.user+0 S8 A64])
        (nil)))

the (already) attached testcase still fails with gcc 4.5.2.
Comment 4 Mikael Pettersson 2010-09-09 12:06:59 UTC
This ICEs for me with 4.4-20100907 and the 4.5.1 release (-m32 -mno-fpu), but not with 4.5-20100902 or 4.6-20100904.
Comment 5 Mikael Pettersson 2010-09-09 12:41:35 UTC
(In reply to comment #4)
> This ICEs for me with 4.4-20100907 and the 4.5.1 release (-m32 -mno-fpu), but
> not with 4.5-20100902 or 4.6-20100904.

Oops, that was with a locally modified 4.5-20100902.  A vanilla 4.5-20100902 still ICEs.
Comment 6 Mikael Pettersson 2010-09-09 15:57:33 UTC
This ICE stopped to appear on trunk with r162019:
http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg00373.html
http://gcc.gnu.org/ml/gcc-patches/2010-07/msg00827.html

Applying the generic bits of that to current 4.5 stops the ICE there too.  I can't say if r162019 is a genuine bug fix or merely improves things a bit so that this test case no longer triggers the ICE.
Comment 7 Eric Botcazou 2010-09-20 22:14:55 UTC
Investigating.
Comment 8 Eric Botcazou 2010-09-22 08:31:32 UTC
Subject: Bug 35664

Author: ebotcazou
Date: Wed Sep 22 08:31:14 2010
New Revision: 164512

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164512
Log:
	PR target/35664
	* config/sparc/constraints.md ('e'): Return NO_REGS if !TARGET_FPU.
	('f'): Likewise.

Added:
    trunk/gcc/testsuite/gcc.target/sparc/mnofpu.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sparc/constraints.md
    trunk/gcc/testsuite/ChangeLog

Comment 9 Eric Botcazou 2010-09-22 08:34:29 UTC
Subject: Bug 35664

Author: ebotcazou
Date: Wed Sep 22 08:34:11 2010
New Revision: 164513

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164513
Log:
	PR target/35664
	* config/sparc/constraints.md ('e'): Return NO_REGS if !TARGET_FPU.
	('f'): Likewise.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.target/sparc/mnofpu.c
      - copied unchanged from r164512, trunk/gcc/testsuite/gcc.target/sparc/mnofpu.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/config/sparc/constraints.md
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog

Comment 10 Eric Botcazou 2010-09-22 08:37:00 UTC
Subject: Bug 35664

Author: ebotcazou
Date: Wed Sep 22 08:36:35 2010
New Revision: 164514

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164514
Log:
	PR target/35664
	* config/sparc/constraints.md ('e'): Return NO_REGS if !TARGET_FPU.
	('f'): Likewise.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/sparc/mnofpu.c
      - copied unchanged from r164513, trunk/gcc/testsuite/gcc.target/sparc/mnofpu.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/config/sparc/constraints.md
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog

Comment 11 Eric Botcazou 2010-09-22 08:40:55 UTC
In 4.4.5 and up.