https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107593
Bug ID: 107593
Summary: ice with -Wduplicated-cond
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
This C++ code:
template <typename T> void SaturatingCast() {
if (T() && T() && int())
;
else if (T() && T() && int())
;
}
when compiled with recent gcc trunk and flag -Wduplicated-cond:
$ ~/gcc/results/bin/g++ -c -Wduplicated-cond bug860.cc
bug860.cc: In function ‘void SaturatingCast()’:
bug860.cc:4:31: internal compiler error: Segmentation fault
4 | else if (T() && T() && int())
| ^
0x106b5d9 crash_signal(int)
../../trunk.d1/gcc/toplev.cc:314
0x6f9f54 location_wrapper_p(tree_node const*)
../../trunk.d1/gcc/tree.h:4235
0x6f9f54 tree_strip_any_location_wrapper(tree_node*)
../../trunk.d1/gcc/tree.h:4247
I don't have a git hash range for this bug. It seems to have existed for at
least a few weeks.