From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE63B385C426; Wed, 28 Jul 2021 03:40:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE63B385C426 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/101596] vect_recog_mulhs_pattern could use incorrect precision to check shift count Date: Wed, 28 Jul 2021 03:40:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: linkw at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2021 03:40:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101596 --- Comment #4 from CVS Commits --- The master branch has been updated by Kewen Lin : https://gcc.gnu.org/g:89b3c97eed75c1e7c492bc727e0016003c5809cc commit r12-2550-g89b3c97eed75c1e7c492bc727e0016003c5809cc Author: Kewen Lin Date: Tue Jul 27 22:04:22 2021 -0500 vect: Fix wrong check in vect_recog_mulhs_pattern [PR101596] As PR101596 showed, vect_recog_mulhs_pattern uses target_precision to check the scale_term is expected or not, it could be wrong when the precision of the actual used new_type larger than target_precision as shown by the example. This patch is to use precision of new_type instead of target_precision for the scale_term matching check. Bootstrapped & regtested on powerpc64le-linux-gnu P10, powerpc64-linux-gnu P8, x86_64-redhat-linux and aarch64-linux-gnu. gcc/ChangeLog: PR tree-optimization/101596 * tree-vect-patterns.c (vect_recog_mulhs_pattern): Fix wrong ch= eck by using new_type's precision instead. gcc/testsuite/ChangeLog: PR tree-optimization/101596 * gcc.target/powerpc/pr101596-1.c: New test. * gcc.target/powerpc/pr101596-2.c: Likewise. * gcc.target/powerpc/pr101596-3.c: Likewise.=