From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 80B4F3858C54; Fri, 21 Jul 2023 07:03:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80B4F3858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689923002; bh=/cTXWR3CxzEtW7NAC9yH4dWrA5iNUM1eEwmrTzwl5Ec=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QRR45sk2EZ9j990Hj+eMzA10lpvGa114NPm4YR7l8LoUYeSDWtH4mvkOW3t9nZVBy pkJZ0xs5GKjwAEEVKJFSLjL/rlP3cQF8r4NFNnRMgbb9ESSSrXNosiwvrLqvg7tA47 Vz0sOoaiRPbm7Xc8mayj1cFYomYz4gmLUpuO+SrY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110760] slp introduces new overflow arithmetic Date: Fri, 21 Jul 2023 07:03:22 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to cf_reconfirmed_on bug_status everconfirmed keywords 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=3D110760 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Last reconfirmed| |2023-07-21 Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 Keywords| |wrong-code --- Comment #5 from Richard Biener --- Vector types follow the same rules as scalar types because we eventually lo= wer them to scalar ops. So yes, I think this is a bug. Now, it will be difficult to exploit since the values are not actually used. One trick would be to CSE with a later tem =3D (unsigned)b[1] - (unsigned)c[1]; where for scalar code FRE would eliminate the above with the earlier a[2] doing tem =3D (unsigned)a[2]; but it currently doesn't do that for vectors and as the vectorizer introduc= es the wrong behavior we are not going to decompose that to scalars either. The particular case in question should be easy to fix though.=