From: Richard Biener Date: Fri, 21 Apr 2023 10:57:17 +0000 (+0200) Subject: tree-optimization/109573 - avoid ICEing on unexpected live def X-Git-Tag: basepoints/gcc-15~10000 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cddfe6bc40b3dc0806e260bbfb4cac82d609a258;p=thirdparty%2Fgcc.git tree-optimization/109573 - avoid ICEing on unexpected live def The following relaxes the assert in vectorizable_live_operation where we catch currently unhandled cases to also allow an intermediate copy as it happens here but also relax the assert to checking only. PR tree-optimization/109573 * tree-vect-loop.cc (vectorizable_live_operation): Allow unhandled SSA copy as well. Demote assert to checking only. * g++.dg/vect/pr109573.cc: New testcase. --- diff --git a/gcc/testsuite/g++.dg/vect/pr109573.cc b/gcc/testsuite/g++.dg/vect/pr109573.cc new file mode 100644 index 000000000000..d96f86f9579a --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr109573.cc @@ -0,0 +1,91 @@ +// { dg-do compile } +// { dg-require-effective-target c++20 } + +void *operator new(__SIZE_TYPE__, void *__p) { return __p; } +template struct _Head_base { + _Head _M_head_impl; +}; +template struct _Tuple_impl; +template +struct _Tuple_impl<_Idx, _Head, _Tail...> : _Tuple_impl<_Idx + 1, _Tail...>, + _Head_base<_Head> { + template + _Tuple_impl(_UHead __head, _UTail... __tail) + : _Tuple_impl<_Idx + 1, _Tail...>(__tail...), _Head_base<_Head>(__head) {} +}; +template struct _Tuple_impl<_Idx, _Head> { + template _Tuple_impl(_UHead); +}; +template struct tuple : _Tuple_impl<0, _Elements...> { + template + tuple(_UElements... __elements) + : _Tuple_impl<0, _Elements...>(__elements...) {} +}; +unsigned long position_; +struct Zone { + template T *New(Args... args) { + return new (reinterpret_cast(position_)) T(args...); + } +}; +struct Label { + int pos_; + int near_link_pos_; +}; +enum Condition { below_equal }; +void bind(Label *); +Zone *zone(); +unsigned long deopt_info_address(); +int MakeDeferredCode___trans_tmp_2, MakeDeferredCode___trans_tmp_3, + Prologue___trans_tmp_6, MakeDeferredCode___trans_tmp_1; +struct MaglevAssembler { + template + void MakeDeferredCode(Function &&, Args &&...); + template + void JumpToDeferredIf(Condition, Function, Args... args) { + MakeDeferredCode(Function(), args...); + } + void Prologue(); +}; +struct ZoneLabelRef { + ZoneLabelRef(Zone *zone) : label_(zone->New