Fix PR target/35664
Eric Botcazou
ebotcazou@adacore.com
Wed Sep 22 15:39:00 GMT 2010
This is an ICE compiling the kernel with -mno-fpu on the SPARC. reload aborts
because it is unable to find a register to spill in class 'FP_REGS', which is
paradoxical since the insn involves integer values only:
(insn 166 123 140
4 /home/ebotcazou/src-4.4/gcc/testsuite/gcc.target/sparc/pr35664.c:82 (set
(reg:DI 262 [ <variable>.stats.ptc1522 ])
(mem/s:DI (plus:SI (reg/v/f:SI 24 %i0 [orig:121 adapter ] [121])
(reg:SI 4 %g4 [244])) [14 <variable>.stats.ptc1522+0 S8 A64]))
45 {*movdi_insn_sp32} (expr_list:REG_EQUIV (mem/s:DI (plus:SI (reg/v/f:SI
24 %i0 [orig:121 adapter ] [121])
(reg:SI 4 %g4 [244])) [14 <variable>.stats.ptc1522+0 S8 A64])
(nil)))
and -mno-fpu is used. It turns out that reload will really choose an FP reg
as a reload register in this case (DImode load with non-offsetable address)
if -mno-fpu isn't specified, before eliminating it thanks to the REG_EQUIV.
Fixed by making constraints 'e' and 'f' return NO_REGS if -mno-fpu is used.
Tested on SPARC64/Linux and SPARC/Solaris, applied on mainline and 4.5/4.4
branches.
2010-09-22 Eric Botcazou <ebotcazou@adacore.com>
PR target/35664
* config/sparc/constraints.md ('e'): Return NO_REGS if !TARGET_FPU.
('f'): Likewise.
2010-09-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc.target/sparc/mnofpu.c: New test.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr35664.c
Type: text/x-csrc
Size: 2224 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100922/5d588b2c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr35664.diff
Type: text/x-diff
Size: 805 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100922/5d588b2c/attachment-0001.bin>
More information about the Gcc-patches
mailing list