From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F6C7384D154; Thu, 6 Oct 2022 05:55:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F6C7384D154 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665035756; bh=0xlApr1IhSS6reZlUAhcZgXrRrpirPil5q/owDi2DtY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KVCuXbBKqdwByM4+VMzo03a9EEGe0k+II7MmH1OR/ElTZ26Jb42/irantd+iBB4n3 B44tLLsSdZGdrK5Dkb5R7TVpCsXB03KtqJZtYFH8dESDs2iOuGBOTKxTirZI1503ij 65xVPBCfef7YE4MJ8vnpQTd6h/r7RJo775WCGhpo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/107167] It looks like GCC wastes registers on trivial computations when result can be cached Date: Thu, 06 Oct 2022 05:55:55 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_severity keywords 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=3D107167 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Keywords| |missed-optimization --- Comment #1 from Andrew Pinski --- This is a reassociation, scheduling issue and register allocation issue. Plus your example might be slower due to dependencies. Without a full example of where gcc ra goes wrong, gcc actually produces mu= ch better code for this example due to register renaming in hw. Note many x86_64 also does register renaming for the stack too=