From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 16BB63857719; Sat, 3 Jun 2023 00:09:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16BB63857719 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685750991; bh=hP7K7qlt0y4rFfPIEKBcY2x0Y6rju/lEzd1x9lnWWsE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VEaFgOXxxpU8Gd823yxD+rf85Q7wrD/9mMqVKWR0fqWiXAtoY7j9NeEBWwLLsbusW EhzAEJeiqAvMnnas8DriJz4Kcjifu6YDHH8G867tuSgKIvrasNG93KY+vBEkWZVdp0 5aZWwTv75yOhVJq3OJwEpZy+xu4sk5jP1UZ4Agr0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110067] [14 Regression] Wrong code on pixman-0.42.2 Date: Sat, 03 Jun 2023 00:09:48 +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: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D110067 --- Comment #8 from CVS Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:57b30f0134d9b49f7707b0c2ded6fd7686a312c8 commit r14-1510-g57b30f0134d9b49f7707b0c2ded6fd7686a312c8 Author: liuhongt Date: Thu Jun 1 12:11:24 2023 +0800 Don't try bswap + rotate when TYPE_PRECISION(n->type) > n->range. For the testcase in the PR, we have br64 =3D br; br64 =3D ((br64 << 16) & 0x000000ff00000000ull) | (br64 & 0x0000ff00u= ll); n->n: 0x3000000200. n->range: 32. n->type: uint64. The original code assumes n->range is same as TYPE PRECISION(n->type), and tries to rotate the mask from 0x300000200 -> 0x20300 which is incorrect. The patch fixed this bug by not trying bswap + rotate when TYPE_PRECISION(n->type) is not equal to n->range. gcc/ChangeLog: PR tree-optimization/110067 * gimple-ssa-store-merging.cc (find_bswap_or_nop): Don't try bswap + rotate when TYPE_PRECISION(n->type) > n->range. gcc/testsuite/ChangeLog: * gcc.target/i386/pr110067.c: New test.=