From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 31AC83858413; Tue, 26 Mar 2024 15:05:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31AC83858413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711465528; bh=tVhM61dNze5sn6E3IOLn/SuLo6Pkaf1/QeZPeYvKWSg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=J7ukxyngHsSeL/vkNd5DZg813T+tE+dDVBwAShRfZ88y21hkcV65DlZwKA9EXClgr BKjwTSQfXHdJpF6Ll3myEER7rxw7GB7PWkTkXz/v8cOVDXtQEFjZb9a1O3U8aN7dda OtJ/rQnzbRcIaASxWxNau5qSfRH3W8Z97LVIxjnM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/91838] [8/9 Regression] incorrect use of shr and shrx to shift by 64, missed optimization of vector shift Date: Tue, 26 Mar 2024 15:05:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 9.2.0 X-Bugzilla-Keywords: missed-optimization, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.4 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=3D91838 --- Comment #22 from GCC Commits --- The releases/gcc-12 branch has been updated by Andre Simoes Dias Vieira : https://gcc.gnu.org/g:1ddd9f9e53bd649d3d236f7941106d8cc46e7358 commit r12-10293-g1ddd9f9e53bd649d3d236f7941106d8cc46e7358 Author: Richard Biener Date: Thu Jul 27 13:08:32 2023 +0200 tree-optimization/91838 - fix FAIL of g++.dg/opt/pr91838.C The following fixes the lack of simplification of a vector shift by an out-of-bounds shift value. For scalars this is done both by CCP and VRP but vectors are not handled there. This results in PR91838 differences in outcome dependent on whether a vector shift ISA is available and thus vector lowering does or does not expose scalar shifts here. The following adds a match.pd pattern to catch uniform out-of-bound shifts, simplifying them to zero when not sanitizing shift amounts. PR tree-optimization/91838 * gimple-match-head.cc: Include attribs.h and asan.h. * generic-match-head.cc: Likewise. * match.pd (([rl]shift @0 out-of-bounds) -> zero): New pattern. (cherry picked from commit d1c072a1c3411a6fe29900750b38210af8451eeb)=