An sh-elf build fails with:

/mnt/scratch/nightly/2005-06-28/sh-elf/./gcc/xgcc
-B/mnt/scratch/nightly/2005-06-28/sh-elf/./gcc/ -nostdinc
-B/mnt/scratch/nightly/2005-06-28/sh-elf/sh-elf/newlib/ -isystem
/mnt/scratch/nightly/2005-06-28/sh-elf/sh-elf/newlib/targ-include -isystem
/mnt/scratch/nightly/2005-06-28/srcw/newlib/libc/include
-B/usr/local/sh-elf/bin/ -B/usr/local/sh-elf/lib/ -isystem
/usr/local/sh-elf/include -isystem /usr/local/sh-elf/sys-include
-L/mnt/scratch/nightly/2005-06-28/sh-elf/./ld -O2  -DIN_GCC -DCROSS_COMPILE   -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED  -I. -I -I../../srcw/gcc -I../../srcw/gcc/
-I../../srcw/gcc/../include -I../../srcw/gcc/../libcpp/include  -m2a -DL_mulsc3
-c ../../srcw/gcc/libgcc2.c -o libgcc/m2a/_mulsc3.o
../../srcw/gcc/libgcc2.c: In function ‘__mulsc3’:
../../srcw/gcc/libgcc2.c:1685: error: unable to find a register to spill in
class ‘FP0_REGS’
../../srcw/gcc/libgcc2.c:1685: error: this is the insn:
(insn:HI 31 30 45 0 ../../srcw/gcc/libgcc2.c:1685 (parallel [
            (set (reg:SF 65 fr1 [orig:64+4 ] [64])
                (plus:SF (mult:SF (reg/v:SF 68 fr4 [orig:160 a ] [160])
                        (reg/v:SF 71 fr7 [orig:163 d ] [163]))
                    (reg/v:SF 70 fr6 [orig:162 c ] [162])))
            (use (reg/v:PSI 151 ))
        ]) 299 {*macsf3} (insn_list:REG_DEP_TRUE 18 (nil))
    (expr_list:REG_DEAD (reg/v:PSI 151 )
        (expr_list:REG_DEAD (reg/v:SF 68 fr4 [orig:160 a ] [160])
            (expr_list:REG_DEAD (reg/v:SF 71 fr7 [orig:163 d ] [163])
                (expr_list:REG_DEAD (reg/v:SF 70 fr6 [orig:162 c ] [162])
                    (nil))))))
../../srcw/gcc/libgcc2.c:1685: internal compiler error: in spill_failure, at
reload1.c:1889
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [libgcc/m2a/_mulsc3.o] Error 1
make[2]: Leaving directory `/mnt/scratch/nightly/2005-06-28/sh-elf/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory `/mnt/scratch/nightly/2005-06-28/sh-elf/gcc'
make: *** [all-gcc] Error 2
build failed

before combine we have:

(insn 19 18 26 0 ../../srcw/gcc/libgcc2.c:1626 (parallel [
            (set (reg:SF 169)
                (plus:SF (reg:SF 167)
                    (reg:SF 168)))
            (use (reg/v:PSI 151 )) 
        ]) 292 {addsf3_i} (insn_list:REG_DEP_TRUE 17 (insn_list:REG_DEP_TRUE 18
(nil)))
    (expr_list:REG_DEAD (reg:SF 167)
        (expr_list:REG_DEAD (reg:SF 168)
            (nil))))

(note 26 19 27 0 NOTE_INSN_FUNCTION_END)

(note 27 26 29 0 ("../../srcw/gcc/libgcc2.c") 1685)

(insn 29 27 30 0 ../../srcw/gcc/libgcc2.c:1685 (clobber (reg/i:SC 64 fr0)) -1 
(nil)
    (expr_list:REG_UNUSED (reg/i:SC 64 fr0)
        (nil)))
    
(insn 30 29 31 0 ../../srcw/gcc/libgcc2.c:1685 (parallel [
            (set (reg:SF 64 fr0 [ <result> ])
                (reg:SF 166))
            (use (reg/v:PSI 151 ))
            (clobber (scratch:SI)) 
        ]) 202 {movsf_ie} (insn_list:REG_DEP_TRUE 16 (nil))
    (expr_list:REG_DEAD (reg:SF 166)
        (expr_list:REG_UNUSED (scratch:SI)
            (nil))))
    
(insn 31 30 36 0 ../../srcw/gcc/libgcc2.c:1685 (parallel [
            (set (reg:SF 65 fr1 [orig:64+4 ] [64])
                (reg:SF 169))
            (use (reg/v:PSI 151 ))
            (clobber (scratch:SI))
        ]) 202 {movsf_ie} (insn_list:REG_DEP_TRUE 19 (nil))
    (expr_list:REG_DEAD (reg:SF 169)
        (expr_list:REG_UNUSED (scratch:SI)
            (nil))))

(insn 36 31 0 0 ../../srcw/gcc/libgcc2.c:1685 (use (reg/i:SC 64 fr0)) -1
(insn_list:REG_DEP_TRUE 30 (nil))
    (nil))
;; End of basic block 0, registers live:
 14 [r14] 15 [r15] 64 [fr0] 65 [fr1] 145 [ap] 151 []

after combine we have:

(note 19 18 26 0 NOTE_INSN_DELETED)

(note 26 19 27 0 NOTE_INSN_FUNCTION_END)

(note 27 26 29 0 ("../../srcw/gcc/libgcc2.c") 1685)

(insn 29 27 30 0 ../../srcw/gcc/libgcc2.c:1685 (clobber (reg/i:SC 64 fr0)) -1 
(nil)
    (expr_list:REG_UNUSED (reg/i:SC 64 fr0)
        (nil)))

(insn 30 29 31 0 ../../srcw/gcc/libgcc2.c:1685 (parallel [
            (set (reg:SF 64 fr0 [ <result> ])
                (reg:SF 166))
            (use (reg/v:PSI 151 ))
            (clobber (scratch:SI))
        ]) 202 {movsf_ie} (insn_list:REG_DEP_TRUE 16 (nil))
    (expr_list:REG_DEAD (reg:SF 166)
        (expr_list:REG_UNUSED (scratch:SI)
            (nil))))

(insn 31 30 36 0 ../../srcw/gcc/libgcc2.c:1685 (parallel [
            (set (reg:SF 65 fr1 [orig:64+4 ] [64])
                (plus:SF (mult:SF (reg/v:SF 160 [ a ])
                        (reg/v:SF 163 [ d ]))
                    (reg:SF 168)))
            (use (reg/v:PSI 151 ))
        ]) 299 {*macsf3} (insn_list:REG_DEP_TRUE 18 (nil))
    (expr_list:REG_DEAD (reg:SF 168)
        (expr_list:REG_DEAD (reg/v:SF 160 [ a ])
            (expr_list:REG_DEAD (reg/v:SF 163 [ d ])
                (nil)))))

(insn 36 31 0 0 ../../srcw/gcc/libgcc2.c:1685 (use (reg/i:SC 64 fr0)) -1
(insn_list:REG_DEP_TRUE 30 (nil))
    (nil))
;; End of basic block 0, registers live:
 14 [r14] 15 [r15] 64 [fr0] 65 [fr1] 145 [ap] 151 []

fr0 is the only register in FR0_REGS.  After combine, insn 31 needs FR0_REGS.
We are not supposed to complicate return value copies if they involve
CLASS_LIKELY_SPILLED registers.

-- 
           Summary: combine causes spill failure on return value register
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, build
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amylaar at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22258

Reply via email to