From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73134 invoked by alias); 17 May 2016 01:09:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 73092 invoked by uid 89); 17 May 2016 01:09:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=sk:flag_st, finalized, Hx-languages-length:1729 X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 May 2016 01:09:19 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id DE0AC1C039D; Tue, 17 May 2016 01:09:14 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH 1/3] function: Do the CLEANUP_EXPENSIVE after shrink-wrapping, not before Date: Tue, 17 May 2016 01:09:00 -0000 Message-Id: <213485283eede9da12b217737d95fc8f5c4be442.1463428211.git.segher@kernel.crashing.org> X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg01164.txt.bz2 We should do CLEANUP_EXPENSIVE after shrink-wrapping, because shrink- wrapping creates constructs that CLEANUP_EXPENSIVE can optimise, and nothing runs CLEANUP_EXPENSIVE later. We don't need cleanup_cfg before shrink-wrapping, nothing in shrink-wrapping (or the other *logue insertion code) cares at all. Tested this (and the other two patches in this series) on powerpc64-linux (-m32/-m64, -mlra/-mno-lra); on powerpc64le-linux; and on x86_64-linux. No regressions. Is this okay for trunk? Segher 2016-05-16 Segher Boessenkool * function.c (rest_of_handle_thread_prologue_and_epilogue): Call cleanup_cfg with CLEANUP_EXPENSIVE after shrink-wrapping. Don't call cleanup_cfg before shrink-wrapping. --- gcc/function.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcc/function.c b/gcc/function.c index 70584b9..b9a6338 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6369,9 +6369,6 @@ make_pass_leaf_regs (gcc::context *ctxt) static unsigned int rest_of_handle_thread_prologue_and_epilogue (void) { - if (optimize) - cleanup_cfg (CLEANUP_EXPENSIVE); - /* On some machines, the prologue and epilogue code, or parts thereof, can be represented as RTL. Doing so lets us schedule insns between it and the rest of the code and also allows delayed branch @@ -6384,7 +6381,7 @@ rest_of_handle_thread_prologue_and_epilogue (void) /* Shrink-wrapping can result in unreachable edges in the epilogue, see PR57320. */ - cleanup_cfg (0); + cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0); /* The stack usage info is finalized during prologue expansion. */ if (flag_stack_usage_info) -- 1.9.3