https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102429
Bug ID: 102429 Summary: nvptx: ICE with expand_GOMP_SIMT_XCHG_BFLY : in expand_insn, at optabs.c:7947 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: vries at gcc dot gnu.org Target Milestone: --- Created attachment 51490 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51490&action=edit testcase, compile with nvptx offloading enabled with: gfortran -fopenmp -O1 That's with several OvO Fortran testcases, the smallest is: https://github.com/TApplencourt/OvO/blob/master/test_src/fortran/hierarchical_parallelism/reduction_add-double_complex/target_simd.F90 The testcase (also attached) fails with: gfortran -fopenmp example.f90 -O1 with: during RTL pass: expand example.f90: In function 'MAIN__._omp_fn.0': example.f90:23:32: internal compiler error: in expand_insn, at optabs.c:7947 23 | counter_N0 = counter_N0 + 1. | ^ 0xb21933 expand_insn(insn_code, unsigned int, expand_operand*) /net/build5-trusty-cs.sje.mentorg.com/scratch/tburnus/openacc.x86_64-linux-gnu-openacc-mainline/src/gcc-mainline/gcc/optabs.c:7947 0x9761ad expand_GOMP_SIMT_XCHG_BFLY /net/build5-trusty-cs.sje.mentorg.com/scratch/tburnus/openacc.x86_64-linux-gnu-openacc-mainline/src/gcc-mainline/gcc/internal-fn.c:375 0x700897 expand_call_stmt Namely: expand_insn (icode=CODE_FOR_omp_simt_xchg_bfly, nops=nops@entry=3, ops=ops@entry=0x7fffffffda80) fails at: 7946 if (!maybe_expand_insn (icode, nops, ops)) 7947 gcc_unreachable (); (gdb) p *ops $4 = {type = EXPAND_OUTPUT, unsigned_p = 0, target = 0, unused = 0, mode = E_DCmode, value = 0x7ffff73fcc78, int_value = {<poly_int_pod<1u, long>> = {coeffs = {0}}, <No data fields>}}