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

            Bug ID: 118517
           Summary: ICE in single_succ_edge, at basic-block.h:332 since
                    r15-5336-gcee7d080d5c2a5
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mjires at gcc dot gnu.org
                CC: hubicka at gcc dot gnu.org
  Target Milestone: ---

Compiling reduced testcase gcc.dg/torture/pr54824.c results in ICE since
r15-5336-gcee7d080d5c2a5.

$ cat pr54824.c
void __attribute__((noreturn)) bar(void) {
  __builtin_unreachable ();
}

int p;
void foo() {
  if (p) bar();
}


$ gcc pr54824.c -fno-ipa-pure-const -O1
during GIMPLE pass: local-fnsummary
pr54824.c: In function ‘foo’:
pr54824.c:8:1: internal compiler error: in single_succ_edge, at
basic-block.h:332
    8 | }
      | ^
0x370010f internal_error(char const*, ...)
        /home/mjires/git/GCC/master/gcc/diagnostic-global-context.cc:517
0x36cfabb fancy_abort(char const*, int, char const*)
        /home/mjires/git/GCC/master/gcc/diagnostic.cc:1722
0x1108f5f single_succ_edge(basic_block_def const*)
        /home/mjires/git/GCC/master/gcc/basic-block.h:332
0x14bfef7 builtin_unreachable_bb_p
        /home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:2708
0x14c00e4 guards_builtin_unreachable
        /home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:2730
0x14c04d2 find_necessary_statements
        /home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:2805
0x14c0c6b analyze_function_body
        /home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:2931
0x14c3257 compute_fn_summary(cgraph_node*, bool)
        /home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:3473
0x14c3324 compute_fn_summary_for_current
        /home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:3503
0x14c8d8c execute
        /home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:5158
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.


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250116 (experimental) (GCC)

Reply via email to