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

            Bug ID: 103361
           Summary: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vsevolod.livinskij at frtk dot ru
  Target Milestone: ---

Link to the Compiler Explorer: https://godbolt.org/z/jbKEn7Tdq

Reproducer:
char a, b;
extern unsigned short c[];
extern bool d[];
const unsigned short &e(const unsigned short &f, const unsigned short &g) {
  if (g < f)
    return g;
  return f;
}
void k() {
  for (int h = 0; b; h += 3)
    for (unsigned long i = 0; i < 11104842004558084287ULL;
         i += -11104842004558084300ULL)
      for (bool j(e(6, e(6, c[h + i]))); j < (bool)a; j = 7)
        d[7] = 0;
}

Error:
>$ g++ -O3 -c func.cpp
during GIMPLE pass: unrolljam
func.cpp: In function 'void k()':
func.cpp:9:6: internal compiler error: in adjust_unroll_factor, at
gimple-loop-jam.c:407
    9 | void k() {
      |      ^
0x93ebce adjust_unroll_factor
        /testing/gcc/gcc_src_master/gcc/gimple-loop-jam.c:407
0x93ebce tree_loop_unroll_and_jam
        /testing/gcc/gcc_src_master/gcc/gimple-loop-jam.c:551
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

gcc version 12.0.0 20211121 (8fef6f720a5a0a056abfa986ba870bb406ab4716) (GCC)

Reply via email to