https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63630

            Bug ID: 63630
           Summary: [5.0 Regression] internal compiler error: Spill fail
                    with invalid register
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org

This is an ICE for gcc.c-torture/compile/920625-1.c from gcc's test suite:


Running target atmega128-sim
Running /gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/compile.exp
...
FAIL: gcc.c-torture/compile/920625-1.c   -O3 -fomit-frame-pointer  (internal
compiler error)
FAIL: gcc.c-torture/compile/920625-1.c   -O3 -fomit-frame-pointer  (test for
excess errors)
FAIL: gcc.c-torture/compile/920625-1.c   -O3 -fomit-frame-pointer
-funroll-loops  (internal compiler error)
FAIL: gcc.c-torture/compile/920625-1.c   -O3 -fomit-frame-pointer
-funroll-loops  (test for excess errors)
FAIL: gcc.c-torture/compile/920625-1.c   -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions  (internal compiler error)
FAIL: gcc.c-torture/compile/920625-1.c   -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions  (test for excess errors)
FAIL: gcc.c-torture/compile/920625-1.c   -O3 -g  (internal compiler error)
FAIL: gcc.c-torture/compile/920625-1.c   -O3 -g  (test for excess errors)



When calling xgcc in gcc build directory as

$ gcc/xgcc -Bgcc
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c -O3 -S -v

The result is:

Reading specs from /gnu/build/gcc-trunk-avr/gcc/specs
COLLECT_GCC=/gnu/build/gcc-trunk-avr/gcc/xgcc
Target: avr
Configured with: ../../gcc.gnu.org/trunk/configure --target=avr
--prefix=/gnu/install/gcc-5.0 --disable-shared --disable-nls --with-dwarf2
--enable-target-optspace=yes --with-gnu-as --with-gnu-ld
--enable-languages=c,c++
Thread model: single
gcc version 5.0.0 20141022 (experimental) (GCC) 

COLLECT_GCC_OPTIONS='-B' '/gnu/build/gcc-trunk-avr/gcc' '-O3' '-S' '-v'
 /gnu/build/gcc-trunk-avr/gcc/cc1 -quiet -v -iprefix
/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/avr/5.0.0/ -isystem
/gnu/build/gcc-trunk-avr/gcc/include -isystem
/gnu/build/gcc-trunk-avr/gcc/include-fixed
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c -quiet
-dumpbase 920625-1.c -auxbase 920625-1 -O3 -version -o 920625-1.s
GNU C (GCC) version 5.0.0 20141022 (experimental) (avr)
    compiled by GNU C version 4.7.2, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory
"/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/avr/5.0.0/include"
ignoring nonexistent directory
"/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/avr/5.0.0/include-fixed"
ignoring nonexistent directory
"/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/avr/5.0.0/../../../../avr/sys-include"
ignoring nonexistent directory
"/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/avr/5.0.0/../../../../avr/include"
ignoring nonexistent directory
"/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/../../lib/gcc/avr/5.0.0/include"
ignoring nonexistent directory
"/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/../../lib/gcc/avr/5.0.0/include-fixed"
ignoring nonexistent directory
"/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/../../lib/gcc/avr/5.0.0/../../../../avr/sys-include"
ignoring nonexistent directory
"/gnu/build/gcc-trunk-avr/gcc/../lib/gcc/../../lib/gcc/avr/5.0.0/../../../../avr/include"
#include "..." search starts here:
#include <...> search starts here:
 /gnu/build/gcc-trunk-avr/gcc/include
 /gnu/build/gcc-trunk-avr/gcc/include-fixed
End of search list.
GNU C (GCC) version 5.0.0 20141022 (experimental) (avr)
    compiled by GNU C version 4.7.2, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 755f0ef592c8e095764bff74c48f51f5
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c:34:1:
warning: return type defaults to 'int' [-Wimplicit-int]
 recurse(opcode_t opcode,
 ^
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c: In
function 'recurse':
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c:66:7:
warning: implicit declaration of function 'synth'
[-Wimplicit-function-declaration]
       synth(sequence, n_insns + 1, values, n_values,
       ^
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c:78:7:
warning: implicit declaration of function 'test_sequence'
[-Wimplicit-function-declaration]
       test_sequence(sequence, n_insns + 1);
       ^
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c: At top
level:
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c:82:1:
warning: return type defaults to 'int' [-Wimplicit-int]
 synth(insn_t *sequence,
 ^
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c: In
function 'synth.constprop':
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c:279:1:
error: unable to find a register to spill in class 'POINTER_REGS'
 }
 ^
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c:279:1:
error: this is the insn:
(insn 336 334 337 9 (set (reg/v:SI 334 [ r1 ])
        (mem:SI (pre_dec:HI (reg:HI 601 [ ivtmp.159 ])) [2 MEM[base: _753,
offset: 0B]+0 S4 A8]))
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c:104 94
{*movsi}
     (expr_list:REG_INC (reg:HI 601 [ ivtmp.159 ])
        (nil)))
/gnu/gcc.gnu.org/trunk/gcc/testsuite/gcc.c-torture/compile/920625-1.c:279:1:
internal compiler error: in spill_failure, at reload1.c:2122
0x8609247 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
    ../../../gcc.gnu.org/trunk/gcc/rtl-error.c:110
0x8608edd spill_failure
    ../../../gcc.gnu.org/trunk/gcc/reload1.c:2122
0x8608edd find_reload_regs
    ../../../gcc.gnu.org/trunk/gcc/reload1.c:2048
0x8608edd select_reload_regs
    ../../../gcc.gnu.org/trunk/gcc/reload1.c:2068
0x8608edd reload(rtx_insn*, int)
    ../../../gcc.gnu.org/trunk/gcc/reload1.c:1037
0x84eefaa do_reload
    ../../../gcc.gnu.org/trunk/gcc/ira.c:5386
0x84eefaa execute
    ../../../gcc.gnu.org/trunk/gcc/ira.c:5536
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



What's remarkable about the failing insn is that:

- R1 is a *reserved* hard register.  Reload should never generate insns to
change that register.  It's only used miplicitly in insns, never explicitly.

- REGNO (SI:R1) is odd, but HARD_REGNO_MODE_OK for target avr prohibits modes >
QImode to start at odd register numbers.

Reply via email to