From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C53FB389838E; Fri, 21 Jun 2024 09:22:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C53FB389838E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718961776; bh=KyQ+dsVI/vocje0HnK7Pn5ogUsndsLE9THlKje7YtKA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=V8tSm5n0idJNRn6HbJAZwrwyIykUfCaEz4IaYhIjtBo/fyK6Lxdomz8ydmX+wBbO3 pb7NRzhdy/kN3YLjH/VkMLsTuqtpjSGNwVLnZijPP78kxiE0z1W/wnrIzddLnIu/uR Jzg0oyplkVUFwIVHKB2mtHDvu2xuCS7un+z+O1f4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110176] [11 Regression] wrong code at -Os and above on x86_64-linux-gnu since r11-2446 Date: Fri, 21 Jun 2024 09:22:54 +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.1.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 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=3D110176 --- Comment #14 from GCC Commits --- The releases/gcc-11 branch has been updated by Richard Biener : https://gcc.gnu.org/g:0d0f181dedb928a6dbb9af040a09cda3f4d5da64 commit r11-11530-g0d0f181dedb928a6dbb9af040a09cda3f4d5da64 Author: Richard Biener Date: Wed Jan 31 14:40:24 2024 +0100 middle-end/110176 - wrong zext (bool) <=3D (int) 4294967295u folding The following fixes a wrong pattern that didn't match the behavior of the original fold_widened_comparison in that get_unwidened returned a constant always in the wider type. But here we're using (int) 4294967295u without the conversion applied. Fixed by doing as earlier in the pattern - matching constants only if the conversion was actually applied. PR middle-end/110176 * match.pd (zext (bool) <=3D (int) 4294967295u): Make sure to match INTEGER_CST only without outstanding conversion. * gcc.dg/torture/pr110176.c: New testcase. (cherry picked from commit 22dbfbe8767ff4c1d93e39f68ec7c2d5b1358beb)=