https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124079
Bug ID: 124079
Summary: [16 Regression] ICE in get_matching_reload_reg_subreg
since r16-7464
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: stefansf at gcc dot gnu.org
CC: vmakarov at redhat dot com
Target Milestone: ---
Target: s390*-*-*
Since r16-7464 SPEC benchmarks f526.blender, f544.nab_r, i500.perlbench_r,
i502.gcc_r, i520.omnetpp_r, i523.xalancbmk_r ICE during build. The following
is reduced from blender:
int strcmp(char *, char *);
typedef struct {
char name[]
} bActionGroup;
bActionGroup compare_agroup_sgrp_a_0, compare_agroup_sgrp_b_0;
int compare_agroup() {
return strcmp(compare_agroup_sgrp_a_0.name, compare_agroup_sgrp_b_0.name);
}
$ gcc -O2 -march=z13 t.i
...
during RTL pass: reload
t.i:8:1: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1048
8 | }
| ^
0x46e4309 internal_error(char const*, ...)
/gcc/src/gcc/diagnostic-global-context.cc:787
0x46f786d fancy_abort(char const*, int, char const*)
/gcc/src/gcc/diagnostics/context.cc:1812
0x1f850c7 gen_rtx_SUBREG(machine_mode, rtx_def*, poly_int<1u, unsigned long>)
/gcc/src/gcc/emit-rtl.cc:1048
0x24f20d1 get_matching_reload_reg_subreg
/gcc/src/gcc/lra-constraints.cc:694
0x24f5605 match_reload
/gcc/src/gcc/lra-constraints.cc:1168
0x250609f curr_insn_transform
/gcc/src/gcc/lra-constraints.cc:4979
0x250a2fb lra_constraints(bool)
/gcc/src/gcc/lra-constraints.cc:5729
0x24e36b5 lra(_IO_FILE*, int)
/gcc/src/gcc/lra.cc:2464
0x244b373 do_reload
/gcc/src/gcc/ira.cc:6076
0x244bab9 execute
/gcc/src/gcc/ira.cc:6264
/gcc/build/gcc/cc1 -fpreprocessed t.i -quiet -dumpdir a- -dumpbase t.i
-dumpbase-ext .i -march=z17 -m64 -mzarch -O2 -o /tmp/ccNCB525.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Breakpoint 1, get_matching_reload_reg_subreg (mode=E_CCUmode,
reg=0x3fff7629870) at /gcc/src/gcc/lra-constraints.cc:689
(gdb) call debug_rtx (reg)
(reg:DI 74)
So for validate_subreg the outer mode is CCU, the inner mode is DI, and the
offset is 0 which actually should be 4 coming previously from
gen_lowpart_SUBREG.