From patchwork Mon Apr 9 09:55:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 151428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 02A8DB7041 for ; Mon, 9 Apr 2012 19:56:49 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1334570210; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:MIME-Version: Content-Type:Message-Id:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=Qxm2s5wNhgmeDz6fZCeQBccTmlg=; b=NSnKEEAC5X+Mb8U inh5S/t5510sKxTVqnkekdz0qGkZ18LsJor8XhDQOR+TLRYQfCPUokdzsRRTDAXk D2APeXM43g2+d809Z3CHQTwqU5kJYdLkM2eg7XRH+FdxP2PRvt/EZiK6KaJLvlKh lJyuBfZfU1+N+Z36FFbGQfKACCKM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Subject:Date:User-Agent:MIME-Version:Content-Type:Message-Id:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=VfFzsNKyBquxeHC2dIEMkMXdSUTylN17Dbc7H3bdNVhyss02I0XLtbL/UIF3F7 NVSnhULvKDIK6GiCRK6zyLv1GqtgYZInMklnAqUkIb3gEK//0j9PCeLhpEBe1G9T XnrOjkQfHiiYwfzlUa1Sh51Au2SEwQty5VwOJTyK9L1ls=; Received: (qmail 20320 invoked by alias); 9 Apr 2012 09:56:43 -0000 Received: (qmail 20304 invoked by uid 22791); 9 Apr 2012 09:56:42 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,TW_CF X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Apr 2012 09:56:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 79436290023 for ; Mon, 9 Apr 2012 11:56:33 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Doa0iNlIabUR for ; Mon, 9 Apr 2012 11:56:33 +0200 (CEST) Received: from [192.168.1.2] (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 46409290008 for ; Mon, 9 Apr 2012 11:56:33 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [RFC] Unconditionally clean up CFG before emitting prologue Date: Mon, 9 Apr 2012 11:55:25 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201204091155.26101.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, with the numerous checks generated in Ada, the gimplification process can generated dead branches that aren't easily eliminated at -O0 and can impair the debugging experience. We have found that unconditionally cleaning up the CFG before emitting the prologue/epilogue can help in some cases. This is the same idiom already used in rest_of_handle_jump2 for example. Tested on x86_64-suse-linux. Comments? 2012-04-09 Eric Botcazou * function.c (rest_of_handle_thread_prologue_and_epilogue): Clean up the CFG before generating prologue/epilogue even when not optimizing. Index: function.c =================================================================== --- function.c (revision 186176) +++ function.c (working copy) @@ -6877,8 +6877,7 @@ struct rtl_opt_pass pass_leaf_regs = static unsigned int rest_of_handle_thread_prologue_and_epilogue (void) { - if (optimize) - cleanup_cfg (CLEANUP_EXPENSIVE); + cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0); /* On some machines, the prologue and epilogue code, or parts thereof, can be represented as RTL. Doing so lets us schedule insns between