https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110313
Bug ID: 110313 Summary: [14 Regression] GCN Fiji reload ICE in 'process_alt_operands' Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org CC: ams at gcc dot gnu.org, burnus at gcc dot gnu.org, jules at gcc dot gnu.org Target Milestone: --- Target: GCN Between GCC commit 2720bbd597f56742a17119dfe80edc2ba86af255..bc6bd0d608da1609c1caeb04ab795a83720add55 (that is, 2023-05-30 - 2023-06-16) appeared some changes in GCC that cause an ICE for a small number of libgomp offloading test cases, for GCN offloading only, and with (default) '-march=fiji' only. [-PASS:-]{+FAIL: libgomp.c++/../libgomp.c-c++-common/for-9.c (internal compiler error: Segmentation fault)+} {+FAIL:+} libgomp.c++/../libgomp.c-c++-common/for-9.c (test for excess errors) [-PASS:-]{+UNRESOLVED:+} libgomp.c++/../libgomp.c-c++-common/for-9.c [-execution test-]{+compilation failed to produce executable+} [-PASS:-]{+FAIL: libgomp.c/../libgomp.c-c++-common/for-9.c (internal compiler error: Segmentation fault)+} {+FAIL:+} libgomp.c/../libgomp.c-c++-common/for-9.c (test for excess errors) [-PASS:-]{+UNRESOLVED:+} libgomp.c/../libgomp.c-c++-common/for-9.c [-execution test-]{+compilation failed to produce executable+} The latter C++ variant not always observed. Additionally (same ICE), but so far observed on one system only, when running the exact same toolchain: [-PASS:-]{+FAIL: libgomp.c/../libgomp.c-c++-common/for-16.c (internal compiler error: Segmentation fault)+} {+FAIL:+} libgomp.c/../libgomp.c-c++-common/for-16.c (test for excess errors) [-PASS:-]{+UNRESOLVED:+} libgomp.c/../libgomp.c-c++-common/for-16.c [-execution test-]{+compilation failed to produce executable+} The ICE is: spawn -ignore SIGHUP gcc ../source-gcc/libgomp/testsuite/libgomp.c/../libgomp.c-c++-common/for-9.c -I../source-gcc/libgomp/testsuite/../../include -I../source-gcc/libgomp/testsuite/.. -fmessage-length=0 -fno-diagnostics-show-caret -fdiagnostics-color=never -fopenmp -O2 -lm -o ./for-9.exe during RTL pass: reload ../source-gcc/libgomp/testsuite/libgomp.c/../libgomp.c-c++-common/for-2.h: In function 'f20_dpf_ds128_runtime': ../source-gcc/libgomp/testsuite/libgomp.c/../libgomp.c-c++-common/for-2.h:346:1: internal compiler error: Segmentation fault 0xe28adf crash_signal [...]/source-gcc/gcc/toplev.cc:314 0xc19737 process_alt_operands [...]/source-gcc/gcc/lra-constraints.cc:2789 0xc19737 curr_insn_transform [...]/source-gcc/gcc/lra-constraints.cc:4201 0xc1ed0e lra_constraints(bool) [...]/source-gcc/gcc/lra-constraints.cc:5396 0xbff652 lra(_IO_FILE*) [...]/source-gcc/gcc/lra.cc:2396 0xb9c639 do_reload [...]/source-gcc/gcc/ira.cc:5967 0xb9c639 execute [...]/source-gcc/gcc/ira.cc:6153 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. gcn mkoffload: fatal error: x86_64-pc-linux-gnu-accel-amdgcn-amdhsa-gcc returned 1 exit status compilation terminated. lto-wrapper: fatal error: [...]/amdgcn-amdhsa/mkoffload returned 1 exit status 'gcc/lra-constraints.cc': 2778 if (operand_reg[nop] != NULL_RTX 2779 /* Output operands and matched input operands are 2780 not inherited. The following conditions do not 2781 exactly describe the previous statement but they 2782 are pretty close. */ 2783 && curr_static_id->operand[nop].type != OP_OUT 2784 && (this_alternative_matches < 0 2785 || curr_static_id->operand[nop].type != OP_IN)) 2786 { 2787 int last_reload = (lra_reg_info[ORIGINAL_REGNO 2788 (operand_reg[nop])] 2789 .last_reload); Tobias mentioned that 'operand_reg[nop]' is '(reg/f:DI 16 s16 [3483])'. It was "obvious" to try, but reverting Vlad's three recent commits: - commit r14-1891-g154c69039571c66b3a6d16ecfa9e6ff22942f59f "RA: Ignore conflicts for some pseudos from insns throwing a final exception" - commit r14-1610-g8cc8707446b77f9413654b31704f5a639673c916 "RA: Constrain class of pic offset table pseudo to general regs" - commit r14-1417-g30038a207c10a2783fa2695b62c7c8458ef05e73 "LRA: Update insn sp offset if its input reload changes SP" ... does *not* cure this issue. I've not yet tested with a non-offloading, GCN target toolchain (... with (default) '-march=fiji'). I'm now bisecting. Once we've located the "offender", I'll see about providing a reproducer -- if necessary.