From patchwork Tue Oct 5 20:20:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 66858 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 A7ABAB70D6 for ; Wed, 6 Oct 2010 07:19:33 +1100 (EST) Received: (qmail 5892 invoked by alias); 5 Oct 2010 20:19:31 -0000 Received: (qmail 5882 invoked by uid 22791); 5 Oct 2010 20:19:29 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Oct 2010 20:19:22 +0000 Received: (qmail 25797 invoked from network); 5 Oct 2010 20:19:20 -0000 Received: from unknown (HELO ?84.152.176.177?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Oct 2010 20:19:20 -0000 Message-ID: <4CAB8895.4040103@codesourcery.com> Date: Tue, 05 Oct 2010 22:20:37 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100911 Lightning/1.0b3pre Thunderbird/3.1.3 MIME-Version: 1.0 To: Nathan Froyd CC: Eric Botcazou , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] fix target/44606, reload bug on SPE References: <20100930182927.GL32503@codesourcery.com> <201010010016.50677.ebotcazou@adacore.com> <20101005173625.GX32503@codesourcery.com> In-Reply-To: <20101005173625.GX32503@codesourcery.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 On 10/05/2010 07:36 PM, Nathan Froyd wrote: > On Fri, Oct 01, 2010 at 12:16:50AM +0200, Eric Botcazou wrote: >>> Bootstrapping in progress on x86-64. OK to commit and backport to 4.5 >>> and 4.4? >>> >>> gcc/ >>> * reload1.c (emit_reload_insns): Adjust prototype. Check for >>> inherited output reloads. >> >> The return value must be documented. >> >>> (reload_as_needed): Delete insn if emit_reload_insns returns >>> true. >>> (choose_reload_regs): Save equiv in reload_override_in for >>> output reloads. Set reg_rtx from reload_override_in. >> >> I think that deleting new insns in reload is too risky on the branches. Can't >> we tighten the above condition instead on the branches so that it will return >> false in this case? > > Returning to this thread, are you indicating that the deleting insns > approach is OK for trunk (I will post another patch addressing comments > if so), but you'd like to see something like the following (untested) > patch for release branches? Or would you like to see something > different for trunk as well? Please clarify. Thanks. I think the following is probably appropriate given my failed attempt to get this optimization to trigger. Bernd Index: reload1.c =================================================================== --- reload1.c (revision 164961) +++ reload1.c (working copy) @@ -6600,17 +6600,6 @@ choose_reload_regs (struct insn_chain *c && (rld[r].nregs == max_group_size || ! reg_classes_intersect_p (rld[r].rclass, group_class))) search_equiv = rld[r].in; - /* If this is an output reload from a simple move insn, look - if an equivalence for the input is available. */ - else if (inheritance && rld[r].in == 0 && rld[r].out != 0) - { - rtx set = single_set (insn); - - if (set - && rtx_equal_p (rld[r].out, SET_DEST (set)) - && CONSTANT_P (SET_SRC (set))) - search_equiv = SET_SRC (set); - } if (search_equiv) {