https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125603
Bug ID: 125603
Summary: [14-17 Regression] ICE at -O1 -fsanitize=undefined
during GIMPLE pass: profile_estimate
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/65Yjaxn79
Testcase:
#include <stdint.h>
_Bool launch_c11;
void launch()
{
int64_t v1;
int8_t v2;
int16_t v3;
if (v2 == 0) goto lbl_b7;
v3 = 40;
goto lbl_b11;
lbl_b7:
__builtin_ctzll(v1);
v3 = 0;
lbl_b11:
v1 = 0;
switch (v3)
{
case 7: goto lbl_sw15;
case 3: goto lbl_sw15;
case 4080: __builtin_unreachable();
case 0: goto lbl_b11;
default: goto lbl_b7;
}
lbl_sw15:
if (launch_c11) goto lbl_sw15;
__builtin_unreachable();
}
Dump:
during GIMPLE pass: profile_estimate
<source>: In function 'launch':
<source>:27:1: internal compiler error: Floating point exception
27 | }
| ^
0x2661528 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x265616b internal_error(char const*, ...)
???:0
0x10e4ab7 profile_probability::apply_scale(long, long) const
???:0
0x10e3db9 tree_estimate_probability(bool)
???:0
/cefs/ef/ef89a252a794dd457215da2c_gcc-trunk-20260604/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/ef/ef89a252a794dd457215da2c_gcc-trunk-20260604/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 -fdiagnostics-color=always -fno-verbose-asm
-fsanitize=undefined -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