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

            Bug ID: 127262
           Summary: [17 Regression] ICE at -O1 -Wall
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xxs_chy at outlook dot com
  Target Milestone: ---

Reproducer: https://godbolt.org/z/nq9r8K9s5
Reduced case:
#include <stdint.h>
_Bool g18, f1_c17;
void *f1_a0;
void f1() {
  uint8_t init8;
  _Bool c15, c18 = 0;
lbl_f2_b0:
  if (g18)
  lbl_f2_b1:
  lbl_f2_b4:
  lbl_f2_b8:
    if (f1_c17)
    lbl_f2_b9:
      if (f1_c17)
        goto lbl_f2_b28;
lbl_f2_b14:
  if (g18)
    goto lbl_f2_b62;
lbl_f2_b28:
  init8 = c18;
  switch (init8) {
  case 9:
    goto lbl_f2_b1;
  case 13:
    goto lbl_f2_b9;
  case 1:
    goto lbl_f2_b0;
  case 11:
  case 25:
    goto lbl_f2_b4;
  }
lbl_f2_b62:
  c18 = 80;
  if (c15)
    goto lbl_f2_b1;
  c15 = f1_a0;
  goto lbl_f2_b14;
}

Dump at -O1 -Wall:
during GIMPLE pass: uninit
<source>:4:6: internal compiler error: in decompose, at wide-int.h:1049
    4 | void f1() {
      |      ^~
0x284ad38 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x283f97b internal_error(char const*, ...)
        ???:0
0xa457d0 fancy_abort(char const*, int, char const*)
        ???:0
0x1e54600 generic_simplify_EQ_EXPR(unsigned long, tree_code, tree_node*,
tree_node*, tree_node*)
        ???:0
0xdae24a fold_binary_loc(unsigned long, tree_code, tree_node*, tree_node*,
tree_node*)
        ???:0
0xdb72de fold_build2_loc(unsigned long, tree_code, tree_node*, tree_node*,
tree_node*)
        ???:0
0xdbddcd combine_comparisons(unsigned long, tree_code, tree_code, tree_code,
tree_node*, tree_node*, tree_node*)
        ???:0
0xe14500 maybe_fold_and_comparisons(tree_node*, tree_code, tree_node*,
tree_node*, tree_code, tree_node*, tree_node*, basic_block_def*)
        ???:0
0x258dca6 predicate::simplify(gimple*, bool)
        ???:0
0x25913ff uninit_analysis::is_use_guarded(gimple*, basic_block_def*, gphi*,
unsigned int, hash_set<gphi*, false, default_hash_traits<gphi*> >*)
        ???:0
0x2591b39 uninit_analysis::is_use_guarded(gimple*, basic_block_def*, gphi*,
unsigned int)
        ???:0
/cefs/97/973eb283a3d40b9349922625_gcc-trunk-20260908/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/97/973eb283a3d40b9349922625_gcc-trunk-20260908/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
<source> -quiet -dumpdir /app/ -dumpbase output.c -dumpbase-ext .c -masm=intel
-mtune=generic -march=x86-64 -g -O1 -Wall -fdiagnostics-color=always
-fno-verbose-asm -o /app/output.s
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.

Reply via email to