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

--- Comment #3 from Peter Bergner <bergner at gcc dot gnu.org> ---
I don't think my patch is the cause of the problem, more like it just exposed
more problems in the SPE code.  After RA, we call into LRA to spill a pseudo
that did not get allocated a register:

Breakpoint 5, lra (f=0x0) at
/home/bergner/gcc/gcc-fsf-mainline-pr80700/gcc/lra.c:2319
2319      lra_dump_file = f;
(gdb) prx 398
(insn 398 400 41 4 (set (reg:SI 564 [+4 ])
        (subreg:SI (reg:V2SI 156 [ _2 ]) 4)) "pr80700.i":16 2072
{*mov_siv2si_e500_subreg4_2_be}
     (expr_list:REG_DEAD (reg:V2SI 156 [ _2 ])
        (nil)))

(gdb) p reg_renumber[564]
$1 = 65
(gdb) p reg_renumber[156]
$2 = -1

Then during LRA, insn 398 gets copied into a simple reg copy, which causes use
to SEGV (or trapped by rtl checking) because the subreg isn't there anymore:


(gdb) c
Continuing.
during RTL pass: reload
pr80700.i: In function ‘i5’:
pr80700.i:21:1: internal compiler error: RTL check: expected elt 0 type 'e' or
'u', have 'r' (rtx reg) in insn_extract, at insn-extract.c:3776
 }
 ^
0x10cdc60b rtl_check_failed_type2(rtx_def const*, int, int, int, char const*,
int, char const*)
        /home/bergner/gcc/gcc-fsf-mainline-pr80700/gcc/rtl.c:820
0x1177ce83 insn_extract(rtx_insn*)
       
/home/bergner/gcc/build/gcc-fsf-mainline-pr80700-rtl-debug/gcc/insn-extract.c:3776
0x10c25147 extract_insn(rtx_insn*)
        /home/bergner/gcc/gcc-fsf-mainline-pr80700/gcc/recog.c:2317
0x10c246f7 extract_constrain_insn(rtx_insn*)
        /home/bergner/gcc/gcc-fsf-mainline-pr80700/gcc/recog.c:2211
0x10a67653 check_rtl
        /home/bergner/gcc/gcc-fsf-mainline-pr80700/gcc/lra.c:2128
0x10a68e03 lra(_IO_FILE*)
        /home/bergner/gcc/gcc-fsf-mainline-pr80700/gcc/lra.c:2546
0x109dcebf do_reload
        /home/bergner/gcc/gcc-fsf-mainline-pr80700/gcc/ira.c:5440
0x109dd63f execute
        /home/bergner/gcc/gcc-fsf-mainline-pr80700/gcc/ira.c:5624
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Breakpoint 4, 0x0fc0be64 in exit () from /lib/power7/libc.so.6
(gdb) prx 398
(insn 398 526 525 4 (set (reg:SI 27 27 [orig:564+4 ] [564])
        (reg:SI 648)) "pr80700.i":16 2072 {*mov_siv2si_e500_subreg4_2_be}
     (nil))

Reply via email to