From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DE727385117A; Thu, 15 Sep 2022 12:08:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE727385117A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663243726; bh=jf6hjobQV6v0L3Hph6QZ+0ShW2rQX9lw0CEF9RaDB5E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fq4osLC6L1sDh/LG3eMhumTIcK8Dmz0r3wwu/2ZBaGQakpCOw1TA4/rB22cVeO+Xm IQJTa0hL6cEh/RLl9rtM5Y7hNyNNZedNdTVUCI5nuUEUFb1UFnnTtIs+LM3zespLLQ BTJJ75qijCCspvz9zgmEoajZfHii6FqkJk2nOwpg= From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106476] ICE generating FOLD_EXTRACT_LAST Date: Thu, 15 Sep 2022 12:08:46 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: major X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106476 --- Comment #2 from rsandifo at gcc dot gnu.org --- (In reply to Richard Biener from comment #1) > I think EXTRACT_LAST_REDUCTION cannot simply do >=20 > /* Instead of doing ~x ? y : z do x ? z : y. */ > vec_compare =3D new_temp; > std::swap (vec_then_clause, vec_else_clause); >=20 > So either the fix could be to not support bitop2 =3D=3D BIT_NOT_EXPR for > EXTRACT_LAST_REDUCTION or we have to perform the BIT_NOT_EXPR as > vector operation. >=20 > Richard? Agreed. This case seems to be specific to EQ_EXPR on booleans, and I'm not sure why we can't just emit an EQ_EXPR for that case. Anything else would lead to redundant ops for EXTRACT_LAST_REDUCTION. There again, having (predicate, predicate =E2=86=92 predicate) comparisons = for EQ_EXPR might be a weird special case, and might be similar to having things like NAND and NOR (which we deliberately don't have). So maybe emitting the separate NOT_EXPR is better after all.=