From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC1C83959E51; Tue, 9 Mar 2021 18:13:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC1C83959E51 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99305] [11 Regression] range condition simplification after inlining Date: Tue, 09 Mar 2021 18:13:59 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.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 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: Tue, 09 Mar 2021 18:14:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99305 --- Comment #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:b610c30453d8e4cc88693d85a5a100d089640be5 commit r11-7587-gb610c30453d8e4cc88693d85a5a100d089640be5 Author: Jakub Jelinek Date: Tue Mar 9 19:13:11 2021 +0100 phiopt: Fix up conditional_replacement [PR99305] Before my PR97690 changes, conditional_replacement would not set neg when the nonzero arg was boolean true. I've simplified the testing, so that it first finds the zero argument and then checks the other argument for all the handled cases (1, -1 and 1 << X, where the last case is what the patch added support for). But, unfortunately I've placed the integer_all_onesp test first. For unsigned precision 1 types such as bool integer_all_onesp, integer_= onep and integer_pow2p can all be true and the code set neg to true in that case, which is undesirable. The following patch tests integer_pow2p first (which is trivially true for integer_onep too and tree_log2 in that case gives shift =3D=3D 0) and only if that isn't the case, integer_all_onesp. 2021-03-09 Jakub Jelinek PR tree-optimization/99305 * tree-ssa-phiopt.c (conditional_replacement): Test integer_pow= 2p before integer_all_onesp instead of vice versa. * g++.dg/opt/pr99305.C: New test.=