https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102796
Bug ID: 102796
Summary: [12 Regresson] ICE in useless_type_conversion_p at
gcc/gimple-expr.c:87 since
r12-4443-g93ac832f1846e4867aa6537f76f510fab8e3e87d
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
CC: aldyh at gcc dot gnu.org, amacleod at redhat dot com
Target Milestone: ---
The following fails:
$ cat /home/marxin/Programming/testcases/ice.cpp
namespace std {
template <class _E>
struct initializer_list {
const int* __begin_;
decltype(sizeof(int)) __size_;
};
} // namespace std
struct destroyme1 {};
struct witharg1 {
witharg1(const destroyme1&);
~witharg1();
};
std::initializer_list globalInitList2 = {witharg1(destroyme1()),
witharg1(destroyme1())};
$ ./xg++ -B. /home/marxin/Programming/testcases/ice.cpp -fno-tree-ccp
-fno-tree-fre -fno-tree-forwprop -O3 -c
during GIMPLE pass: evrp
/home/marxin/Programming/testcases/ice.cpp: In function ‘void
__static_initialization_and_destruction_0(int, int)’:
/home/marxin/Programming/testcases/ice.cpp:14:65: internal compiler error: tree
check: expected class ‘type’, have ‘exceptional’ (error_mark) in
useless_type_conversion_p, at gimple-expr.c:87
14 | witharg1(destroyme1())};
| ^
0x178e0aa tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/marxin/Programming/gcc/gcc/tree.c:8739
0x90f81e tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/marxin/Programming/gcc/gcc/tree.h:3556
0x90f81e useless_type_conversion_p(tree_node*, tree_node*)
/home/marxin/Programming/gcc/gcc/gimple-expr.c:87
0x149498c verify_gimple_phi
/home/marxin/Programming/gcc/gcc/tree-cfg.c:5128
0x149498c verify_gimple_in_cfg(function*, bool)
/home/marxin/Programming/gcc/gcc/tree-cfg.c:5457
0x1356421 execute_function_todo
/home/marxin/Programming/gcc/gcc/passes.c:2042
0x1355229 do_per_function
/home/marxin/Programming/gcc/gcc/passes.c:1687
0x1356654 execute_todo
/home/marxin/Programming/gcc/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
And it also blocks bootstrap (fails in libgo).