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

            Bug ID: 101496
           Summary: ice during GIMPLE pass: evrp
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

This C source code:

int c_1, li_2, us_3, func_14_s_5;

void func_14() {
  {
    unsigned uli_8 = 0;
  lbl1806324B:
    if (uli_8 /= us_3 |= func_14_s_5 < 0 | func_14_s_5 != c_1) {
      uli_8 += c_1 >= us_3;
      if (uli_8)
        ;
      else
        li_2 &&func_14_s_5 <= c_1 ?: 0;
      long *ptr_9 = &uli_8;
    }
  }
  goto lbl1806324B;
}

with recent gcc trunk does this:

$ /home/dcb/gcc/results/bin/gcc -c -O2 bug736.c 2>&1 | more
bug736.c: In function ‘func_14’:
bug736.c:13:21: warning: initialization of ‘long int *’ from incompatible point
er type ‘unsigned int *’ [-Wincompatible-pointer-types]
   13 |       long *ptr_9 = &uli_8;
      |                     ^
during GIMPLE pass: evrp
bug736.c:17:1: internal compiler error: in fold_cond, at vr-values.c:3482
   17 | }
      | ^
0x7d8685 simplify_using_ranges::fold_cond(gcond*)
        ../../trunk.git/gcc/vr-values.c:3482
0x1334c24 simplify_using_ranges::simplify_cond_using_ranges_1(gcond*)
        ../../trunk.git/gcc/vr-values.c:3517
0x1160886 substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
        ../../trunk.git/gcc/tree-ssa-propagate.c:870
0x1ad3e77 dom_walker::walk(basic_block_def*)
        ../../trunk.git/gcc/domwalk.c:309

Bug first seems to occur sometime after git hash 42ff474e28fa3c85
but before cca7eb8f7cc157ed.

Reply via email to