https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123855
Bug ID: 123855
Summary: ICE: tree check: expected ssa_name, have integer_cst
in flush_on_edges, at path-coverage.cc:382 with
-fpath-coverage and recursive returns_twice function
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Created attachment 63507
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63507&action=edit
reduced testcase
Compiler output:
$ x86_64-pc-linux-gnu-gcc -fpath-coverage testcase.c
during IPA pass: profile
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: tree check: expected ssa_name, have
integer_cst in flush_on_edges, at path-coverage.cc:382
7 | }
| ^
0x2c97dbd internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x929459 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/repo/gcc-trunk/gcc/tree.cc:9204
0xe13e53 tree_check(tree_node*, char const*, int, char const*, tree_code)
/repo/gcc-trunk/gcc/tree.h:3765
0xe13e53 flush_on_edges
/repo/gcc-trunk/gcc/path-coverage.cc:382
0xe13e53 instrument_prime_paths(function*)
/repo/gcc-trunk/gcc/path-coverage.cc:761
0x151d9b9 branch_prob(bool)
/repo/gcc-trunk/gcc/profile.cc:1667
0x17420bc tree_profiling
/repo/gcc-trunk/gcc/tree-profile.cc:1945
0x17420bc execute
/repo/gcc-trunk/gcc/tree-profile.cc:2075
/repo/gcc-trunk/binary-trunk-20260127192034-r16-7075-gfe050fa9d1249a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-20260127192034-r16-7075-gfe050fa9d1249a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/16.0.1/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -fpath-coverage -o /tmp/ccDB6Ip5.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.
$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20260127192034-r16-7075-gfe050fa9d1249a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20260127192034-r16-7075-gfe050fa9d1249a-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260127 (experimental) (GCC)