https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128970
Bug ID: 128970
Summary: ICE: verify_gimple failed at tree-cfg.cc:5304
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: babokin at gmail dot com
CC: vsevolod.livinskiy at gmail dot com
Target Milestone: ---
Created attachment 66271
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=66271&action=edit
Reproducer
root@fb51b0fe95ef:/opt/yarpgen# cat "$R/seed894284742.cpp"
struct S { int b : 1; } s{0};
int get() { return 1; }
int f() { return (get() ? s.b : s.b) > 0; }
int main() { return f(); }
root@fb51b0fe95ef:/opt/yarpgen# /opt/gcc/bin/g++ -O0 "$R/seed894284742.cpp" -o
/tmp/repro
results/bootstrap-8h-verified/minimal-reproducers/seed894284742.cpp: In
function 'int f()':
results/bootstrap-8h-verified/minimal-reproducers/seed894284742.cpp:3:5: error:
mismatching comparison operand types
3 | int f() { return (get() ? s.b : s.b) > 0; }
| ^
<unnamed-signed:1>
int
_2 = _1 > 0;
results/bootstrap-8h-verified/minimal-reproducers/seed894284742.cpp:3:5:
internal compiler error: 'verify_gimple' failed
0x2ca53d3 internal_error(char const*, ...)
/tmp/src/gcc/gcc/diagnostic-global-context.cc:787
0x15f049b verify_gimple_in_seq(gimple*, bool)
/tmp/src/gcc/gcc/tree-cfg.cc:5304
0x121c0e3 gimplify_body(tree_node*, bool)
/tmp/src/gcc/gcc/gimplify.cc:21937
0x121c41b gimplify_function_tree(tree_node*)
/tmp/src/gcc/gcc/gimplify.cc:22063
0xf8bea3 cgraph_node::analyze()
/tmp/src/gcc/gcc/cgraphunit.cc:695
0xf8ed6f analyze_functions
/tmp/src/gcc/gcc/cgraphunit.cc:1271
0xf900f7 symbol_table::finalize_compilation_unit()
/tmp/src/gcc/gcc/cgraphunit.cc:2594
/opt/gcc/libexec/gcc/aarch64-unknown-linux-gnu/17.0.0/cc1plus -quiet
-imultiarch aarch64-linux-gnu -D_GNU_SOURCE
results/bootstrap-8h-verified/minimal-reproducers/seed894284742.cpp -quiet
-dumpdir /tmp/repro- -dumpbase seed894284742.cpp -dumpbase-ext .cpp
-mlittle-endian -mabi=lp64 -O0 -o /tmp/ccD5Z0Nk.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.
Released versions of GCC works fine. This is gcc trunk: g++ (GCC) 17.0.0
20261122 (experimental). It's ARM build, but x86 behaves the same.