https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89814
Bug ID: 89814 Summary: [9 Regression] ICE (segfault) with -Wduplicated-cond Product: gcc Version: 9.0 Status: UNCONFIRMED Keywords: diagnostic, ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- GCC 9.0.1 20190325/x86_64-pc-linux-gnu now segfaults with "g++ -Wduplicated-cond" - it worked about a week ago. The real-world fail is in: gcc-trunk/include/c++/9.0.1/bits/stl_iterator_base_funcs.h: In function ‘constexpr void std::__advance(_RandomAccessIterator&, _Distance, std::random_access_iterator_tag)’: gcc-trunk/include/c++/9.0.1/bits/stl_iterator_base_funcs.h:182:54: internal compiler error: Segmentation fault Backtrace of the fail below: 0xfadc8f crash_signal ../../gcc/toplev.c:326 0xcabedc operand_equal_p(tree_node const*, tree_node const*, unsigned int) ../../gcc/fold-const.c:2977 0xcac09a operand_equal_p(tree_node const*, tree_node const*, unsigned int) ../../gcc/fold-const.c:2950 0xb1d951 warn_duplicated_cond_add_or_warn(unsigned int, tree_node*, vec<tree_node*, va_heap, vl_ptr>**) ../../gcc/c-family/c-warn.c:2318 0x9d4b05 cp_parser_selection_statement ../../gcc/cp/parser.c:11809 //---------------------- struct forward_iterator_tag { }; struct random_access_iterator_tag { }; template < typename _RandomAccessIterator, typename _Distance > inline constexpr void __advance (_RandomAccessIterator & __i, _Distance __n, random_access_iterator_tag) { if (__builtin_constant_p (__n) && __n == 1) ++__i; else if (__builtin_constant_p (__n) && __n == -1) --__i; else __i += __n; }