From patchwork Thu Oct 6 16:01:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 118119 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 2600EB6F8D for ; Fri, 7 Oct 2011 03:02:12 +1100 (EST) Received: (qmail 13364 invoked by alias); 6 Oct 2011 16:02:02 -0000 Received: (qmail 13343 invoked by uid 22791); 6 Oct 2011 16:02:01 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 16:01:47 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RBqOI-0004tz-0H from Bernd_Schmidt@mentor.com ; Thu, 06 Oct 2011 09:01:46 -0700 Received: from [127.0.0.1] ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 6 Oct 2011 17:01:44 +0100 Message-ID: <4E8DD0E3.5010106@codesourcery.com> Date: Thu, 06 Oct 2011 18:01:39 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.20) Gecko/20110920 Lightning/1.0b3pre Thunderbird/3.1.12 MIME-Version: 1.0 To: Ian Lance Taylor CC: Richard Henderson , Richard Guenther , GCC Patches , richard.sandiford@linaro.org Subject: Re: Initial shrink-wrapping patch References: <4E5E7342.9050103@codesourcery.com> <4E6E9857.50600@t-online.de> <4E6F37D9.9000108@t-online.de> <4E6F4B90.2050408@codesourcery.com> <4E6F786E.6080407@codesourcery.com> <4E712FD6.5030109@redhat.com> <4E8239ED.9020004@codesourcery.com> <4E85F395.3030006@redhat.com> <4E8B8469.2090605@codesourcery.com> <4E8B88E7.3090107@redhat.com> <4E8C7ED0.3090705@codesourcery.com> <4E8C83FA.3000607@redhat.com> <4E8C912C.2060805@codesourcery.com> <4E8CEC99.2000105@codesourcery.com> <4E8D8302.3090306@codesourcery.com> In-Reply-To: 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 On 10/06/11 17:57, Ian Lance Taylor wrote: > There is absolutely no reason to try to shrink wrap that code. It will > never help. That code always has to be first. It especially has to be > first because the gold linker recognizes the prologue specially when a > split-stack function calls a non-split-stack function, in order to > request a larger stack. Urgh, ok. > Therefore, it seems to me that we should apply shrink wrapping to the > function as it exists *before* the split-stack prologue is created. The > flag_split_stack bit should be moved after the flag_shrink_wrap bit. Sounds like we just need to always emit the split prologue on the original entry edge then. Can you test the following with Go? Bernd * function.c (thread_prologue_and_epilogue_insns): Emit split prologue on the orig_entry_edge. Don't account for it in prologue_clobbered. Index: gcc/function.c =================================================================== --- gcc/function.c (revision 179619) +++ gcc/function.c (working copy) @@ -5602,10 +5602,6 @@ thread_prologue_and_epilogue_insns (void note_stores (PATTERN (p_insn), record_hard_reg_sets, &prologue_clobbered); } - for (p_insn = split_prologue_seq; p_insn; p_insn = NEXT_INSN (p_insn)) - if (NONDEBUG_INSN_P (p_insn)) - note_stores (PATTERN (p_insn), record_hard_reg_sets, - &prologue_clobbered); bitmap_initialize (&bb_antic_flags, &bitmap_default_obstack); bitmap_initialize (&bb_on_list, &bitmap_default_obstack); @@ -5758,7 +5754,7 @@ thread_prologue_and_epilogue_insns (void if (split_prologue_seq != NULL_RTX) { - insert_insn_on_edge (split_prologue_seq, entry_edge); + insert_insn_on_edge (split_prologue_seq, orig_entry_edge); inserted = true; } if (prologue_seq != NULL_RTX)