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

            Bug ID: 125156
           Summary: [17 Regression] ICE at -O3 during GIMPLE pass: fre
           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/17v1r8jMK
Testcase:
#include <stdint.h>
int64_t g1, g8;
void g14()
{
    int16_t v5;
    goto lbl_cont30;
lbl_bf2:
    g8 = 0;
lbl_b5:
    g1 = g1 - 8366249724514421075;
    switch (v5)
    case 5:
    case 2:
        goto lbl_b5;
    goto lbl_bf2;
lbl_cont30:
    switch (v5)
    {
        case 0: goto lbl_bf2;
        case 5: goto lbl_b5;
    }
}

Dump at -O3:
<source>: In function 'g14':
<source>:3:6: error: edge from 7 to 8 should be marked irreducible
    3 | void g14()
      |      ^~~
during GIMPLE pass: fre
<source>:3:6: internal compiler error: in verify_loop_structure, at
cfgloop.cc:1739
0x261ba08 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x261064b internal_error(char const*, ...)
        ???:0
0xa25f1c fancy_abort(char const*, int, char const*)
        ???:0
/cefs/34/344a0178f0d7127abbaa1640_gcc-trunk-20260502/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/34/344a0178f0d7127abbaa1640_gcc-trunk-20260502/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 -O3 -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.
Compiler returned: 1

Reply via email to