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

            Bug ID: 124649
           Summary: [16 Regression] ICE during RTL cprop_hardreg
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: belagod at gcc dot gnu.org
  Target Milestone: ---

This piece of code ICEs on aarch64 when compiled with -O3 -mcpu=neoverse-v1

int a, b;
struct e {
  char c[];
};      
char d;
void f(e &g) {
  int h(1 << 2);
  int j = d &= h;
  int k = j + 1;
  int c[a];
  if (k == 1)
    b >>= 3;
  b &= 1;
  c[0] = b;
  for (int i = 0; i < k; i++)
    g.c[i] = c[i];
}


during RTL pass: cprop_hardreg
besttry.cc: In function ‘void f(e&)’:
besttry.cc:17:1: internal compiler error: in partial_subreg_p, at rtl.h:3252
   17 | }
      | ^
0x2725153 internal_error(char const*, ...)
        ../../../../src/gcc/gcc/diagnostic-global-context.cc:787
0x8e192b fancy_abort(char const*, int, char const*)
        ../../../../src/gcc/gcc/diagnostics/context.cc:1813
0x8bfc6b partial_subreg_p(machine_mode, machine_mode)
        ../../../../src/gcc/gcc/rtl.h:3252
0x13bd1c3 partial_subreg_p(machine_mode, machine_mode)
        ../../../../src/gcc/gcc/poly-int.h:1365
0x13bd1c3 maybe_mode_change
        ../../../../src/gcc/gcc/regcprop.cc:434
0x13be92f copyprop_hardreg_forward_1
        ../../../../src/gcc/gcc/regcprop.cc:992
0x13bf54b execute
        ../../../../src/gcc/gcc/regcprop.cc:1466


Does not ICE either with -O2 or other Neoverse options. Works fine on gcc15.

Reply via email to