From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2218 invoked by alias); 8 Dec 2014 08:52:19 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 2162 invoked by uid 48); 8 Dec 2014 08:52:10 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/64215] -Os misses an opportunity to merge two ret instructions Date: Mon, 08 Dec 2014 08:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg00700.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64215 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- Reproduced with the trunk too. The problem is that during cross-jumping (the "jump2" pass), this isn't cheaply cross-jumpable, as the simple_return just using earlier computed %eax comes before the bb with setting %eax to -1 and doing simple_return (so in that case it would be replacement of simple_return with conditional jump, where the conditional jump is larger). It is only in the basic block reordering pass that this is swapped, but that is too late, we don't have any further crossjumping pass.