https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95358
Bug ID: 95358 Summary: [11 Regression] ICE in exact_div, at poly-int.h:2162 since r11-564-g79f0451c67e8ed56 Product: gcc Version: 11.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 Target Milestone: --- It's reduced from botan: $ cat ice.ii template <typename _Default> struct A { using type = _Default; }; template <typename _Default, template <typename> class> using __detected_or = A<_Default>; template <typename _Default, template <typename> class _Op> using __detected_or_t = typename __detected_or<_Default, _Op>::type; struct B { template <typename _Tp> using __pointer = typename _Tp::pointer; }; template <typename _Alloc> struct F : B { using pointer = __detected_or_t<typename _Alloc::value_type *, __pointer>; }; template <typename _Alloc> struct H : F<_Alloc> { typedef typename _Alloc::value_type &reference; }; template <typename _Alloc> struct C { struct { typename H<_Alloc>::pointer _M_start; } _M_impl; }; template <typename _Alloc> class G : C<_Alloc> { public: typename H<_Alloc>::reference operator[](long p1) { return *(this->_M_impl._M_start + p1); } }; class D { public: typedef long value_type; }; template <typename> using secure_vector = G<D>; secure_vector<long> a; void fn1() { long b; a[20] = a[21] = (unsigned long)b >> long(4); a[22] = a[23] = a[24] = a[25] = (unsigned long)b >> long(-4); } $ g++ ice.ii -Ofast -c -march=znver1 ice.ii: In function 'void fn1()': ice.ii:35:52: warning: right shift count is negative [-Wshift-count-negative] 35 | a[22] = a[23] = a[24] = a[25] = (unsigned long)b >> long(-4); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~ during GIMPLE pass: slp ice.ii:32:6: internal compiler error: in exact_div, at poly-int.h:2162 32 | void fn1() { | ^~~ 0x843ea9 poly_int<1u, poly_result<unsigned long, if_nonpoly<unsigned long, unsigned long, poly_int_traits<unsigned long>::is_poly>::type, poly_coeff_pair_traits<unsigned long, if_nonpoly<unsigned long, unsigned long, poly_int_traits<unsigned long>::is_poly>::type>::result_kind>::type> exact_div<1u, unsigned long, unsigned long>(poly_int_pod<1u, unsigned long> const&, unsigned long) /home/marxin/Programming/gcc/gcc/poly-int.h:2162 0x843ea9 poly_int<1u, poly_result<unsigned long, unsigned long, poly_coeff_pair_traits<unsigned long, unsigned long>::result_kind>::type> exact_div<1u, unsigned long, unsigned long>(poly_int_pod<1u, unsigned long> const&, poly_int_pod<1u, unsigned long> const&) /home/marxin/Programming/gcc/gcc/poly-int.h:2175 0x843ea9 vect_get_num_vectors /home/marxin/Programming/gcc/gcc/tree-vectorizer.h:1539 0x843ea9 vect_slp_analyze_node_operations_1 /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2672 0x843ea9 vect_slp_analyze_node_operations /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2844 0x134a4d4 vect_slp_analyze_node_operations /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2802 0x134a4d4 vect_slp_analyze_node_operations /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2802 0x134b0c4 vect_slp_analyze_operations(vec_info*) /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2918 0x134d153 vect_slp_analyze_bb_1 /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:3245 0x134d153 vect_slp_bb_region /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:3306 0x134d153 vect_slp_bb(basic_block_def*) /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:3441 0x134eb5f execute /home/marxin/Programming/gcc/gcc/tree-vectorizer.c:1320 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.