From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 047E23858D20; Fri, 14 Apr 2023 02:03:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 047E23858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681437821; bh=c9a/tDnYNwpDbpg0b/rWp2P+9iBq75F/FrWhtaDNQQA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nFsSrLwEL6uO0+BrD5WkhkkcaJ3BrreosMQ3Oh2HuKAhdrQNe3nZVA/QhpXxJiv7B pnhvPTotvCgmEg/kTC9yLQmnbRUwUGOX3iRJQnDLPhDfbB/ytTukXJ5JgzrNyVOESU DCXUfBErqQhOT1qi38HTMFHDkOBaZiXqRR1xIArc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109502] [12/13 Regression] wrong code with -O -ftree-vectorize -fvect-cost-model=unlimited on aarch64 Date: Fri, 14 Apr 2023 02:03:39 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component everconfirmed bug_status cf_reconfirmed_on 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=3D109502 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|target |tree-optimization Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2023-04-14 --- Comment #1 from Andrew Pinski --- SLP transforms: g.0_1 =3D g; _2 =3D g.0_1 =3D=3D 0; a_7 =3D (unsigned int) _2; _3 =3D a_7 % 6; _4 =3D _3 =3D=3D 0; _5 =3D (unsigned int) _4; a_8 =3D _5 + a_7; To: g.0_1 =3D g; _2 =3D g.0_1 =3D=3D 0; a_7 =3D (unsigned int) _2; _3 =3D a_7 % 6; _15 =3D {_3, g.0_1}; mask__4.4_16 =3D { 0, 0 } =3D=3D _15; vect__5.5_19 =3D VIEW_CONVERT_EXPR(mask__4.4_16); _17 =3D BIT_FIELD_REF ; _18 =3D (bool) _17; _4 =3D _3 =3D=3D 0; _5 =3D (unsigned int) _18; _20 =3D .REDUC_PLUS (vect__5.5_19); a_8 =3D _20; Which is wrong. The if anything there is a missing - missing after the reduc_plus (or before) when it translates the bools comparisons into vector comparisons.=