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

            Bug ID: 108547
           Summary: ice in decompose, at wide-int.h:984 for -O2 with -Wall
           Product: gcc
           Version: 13.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 legal C source code:

int li_4, li_5, us_8;
unsigned char func_7_ptr_13, func_7_uc_14;
void func_7_ptr_18() {
  if (li_5) {
    for (;;)
      ;
    short s_15;
    for (; func_7_uc_14;) {
      us_8 = 7;
      for (; us_8; us_8 += 1)
      lblD2AF1FAB:
        if (us_8)
          li_4 = 1;
      func_7_uc_14 += func_7_ptr_18;
      if (func_7_ptr_13 & 1 && (func_7_uc_14 &= func_7_ptr_13))
        s_15 %= func_7_uc_10li_19(s_15);
    }
  }
  goto lblD2AF1FAB;
}

when compiled with recent gcc trunk, does this:

$ ~/gcc/results//bin/gcc -c -O2 -Wall bug876.c 
bug876.c: In function ‘func_7_ptr_18’:
bug876.c:14:20: warning: assignment to ‘unsigned char’ from ‘void (*)()’ makes
integer from pointer without a cast [-Wint-conversion]
   14 |       func_7_uc_14 += func_7_ptr_18;
      |                    ^~
bug876.c:16:17: warning: implicit declaration of function ‘func_7_uc_10li_19’
[-Wimplicit-function-declaration]
   16 |         s_15 %= func_7_uc_10li_19(s_15);
      |                 ^~~~~~~~~~~~~~~~~
during GIMPLE pass: uninit
bug876.c:3:6: internal compiler error: in decompose, at wide-int.h:984
    3 | void func_7_ptr_18() {
      |      ^~~~~~~~~~~~~
0x1df0eb9 value_sat_pred_p(tree_node*, tree_node*, tree_code, bool)
        ../../trunk.d1/gcc/wide-int.h:0

The bug first seems to appear sometime before git hash g:9b111debbfb79a0a
dated 20221229.

Reply via email to