From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 710243858400; Mon, 25 Oct 2021 09:03:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 710243858400 From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102897] [12 Regression] simplify_permutation ICEs on assert since r12-1103-g4a9f2306cb39a3cf Date: Mon, 25 Oct 2021 09:03:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: linkw at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: linkw at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2021 09:03:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102897 --- Comment #3 from Kewen Lin --- The culprit assertion is based on one assumption, for one given VEC_PERM_EX= PR expression, if the type of permutation control vector and the type of permutation operand is the same, and it's foldable, then it's done previous= ly. But from this case, this is not true. For example, for the case int8x8_t fn1(int8x8_t val20, char tmp) { int8x8_t __a =3D (int8x8_t){tmp}; return __builtin_shuffle(__a, val20, (int8x8_t){0, 1, 2, 3, 4, 5, 6, 7}); } we can get int8x8_t fn1 (int8x8_t val20, char tmp) { int8x8_t __a; : __a_2 =3D {tmp_1(D)}; return __a_2; } before forwprop, while for the case int8x8_t fn1(int8x8_t val20, char tmp) { int8x8_t __a =3D (int8x8_t){tmp}; return __builtin_shuffle(__a, val20, (int8x8_t){0, 1, 2, 3, 0, 1, 2, 3}); } we only get the below before forwprop, int8x8_t fn1 (int8x8_t val20, char tmp) { int8x8_t __a; int8x8_t _3; : __a_2 =3D {tmp_1(D)}; _3 =3D VEC_PERM_EXPR <__a_2, __a_2, { 0, 1, 2, 3, 0, 1, 2, 3 }>; return _3; } After remove the assertion there, we can get below immediately at forwprop. int8x8_t fn1 (int8x8_t val20, char tmp) { int8x8_t __a; int8x8_t _3; : __a_2 =3D {tmp_1(D)}; _3 =3D {tmp_1(D), 0, 0, 0, tmp_1(D), 0, 0, 0}; return _3; } I think we should remove this assertion.=