From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0DD773857707; Tue, 2 May 2023 17:33:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DD773857707 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683048822; bh=spBlCbnsSH4/oaoM3DZu+gaCaTmEdcMMt+T8kr+Yqfo=; h=From:To:Subject:Date:From; b=g96tGjPWGZSNeVRUc7atXs25KgttlismJC3oUS/+JEz70qnNCXPXrD/fUybjVEP1U vPqxNUjCLcL30+o6b8v/0J5a8PAl1CZ2CPA4Gx+wpNrqKmg0E/XyZ7D+mZhu4l9yLm hEg6CqPlvEbcjrHkWox7MZ8dZ12boKmP9pDMjWug= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109702] New: [14 Regression] Wrong code with if and __builtin_bswap and others Date: Tue, 02 May 2023 17:33:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: critical X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D109702 Bug ID: 109702 Summary: [14 Regression] Wrong code with if and __builtin_bswap and others Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: wrong-code Severity: critical Priority: P3 Component: tree-optimization Assignee: pinskia at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- I totally messed up the match.pd patterns such that we start to transform: ``` unsigned f(unsigned t, unsigned t1) { if (t !=3D 0) return __builtin_bswap32(t1); return 0; } ``` To just `return __builtin_bswap32(t1)` . I only noticed this after the revi= ew of the patch for CLRSB (https://gcc.gnu.org/pipermail/gcc-patches/2023-May/617228.html ) but the review didn't fully notice how it was incorrect; just noticed there was an unused capture.=