From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F11803858416; Mon, 15 Nov 2021 09:01:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F11803858416 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/78115] Missed optimization for "int modulo 2^31" Date: Mon, 15 Nov 2021 09:01:09 +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: 6.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: dependson bug_status assigned_to 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: Mon, 15 Nov 2021 09:01:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D78115 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |103216 Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot = gnu.org --- Comment #4 from Andrew Pinski --- The patch which I posted for PR 103216 will fix this one too: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584411.html in phiopt4: COND_EXPR in block 2 and PHI in block 4 converted to straightline code. Merging blocks 2 and 4 fix_loop_structure: fixing up loops for function int mod31 (int num) { _Bool _5; int _6; int _7; int _8; [local count: 1073741824]: _5 =3D num_2(D) < 0; _6 =3D (int) _5; _7 =3D num_2(D) & -2147483648; _8 =3D num_2(D) & 2147483647; return _8; } Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103216 [Bug 103216] missed optimization, phiopt/vrp?=