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

            Bug ID: 110695
           Summary: RISC-V: compile gcc.dg/torture/pr105132.c crash
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lehua.ding at rivai dot ai
  Target Milestone: ---

The trunk compiler will crash when compiling the testcase
gcc.dg/torture/pr105132.c with -O1 option and only -O1 option will crash.
13.1.0 is ok.

during GIMPLE pass: sccp
dump file: /app/output.c.156t.sccp
<source>: In function 'd':
<source>:4:6: internal compiler error: in gimple_phi_arg_def_from_edge, at
gimple.h:4699
    4 | void d(long f[][5][5][17], int g[][5][5][17]) {
      |      ^
0x7ff51b931082 __libc_start_main
        ???:0
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.
Compiler returned: 1

Reproduce code:

short a;
extern int b[];
int c;
void d(long f[][5][5][17], int g[][5][5][17]) {
  for (short e = 0; e < 17; e++) {
    a = g[19][2][3][e];
    b[e] = c & (f[3][2][3][e] && g[19][2][3][e]);
  }
}

Compiler option: -O1

URL on compiler explorer: https://godbolt.org/z/xMKaxj898

Reply via email to