From patchwork Tue Jul 27 00:15:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 59962 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 C26F6B70A4 for ; Tue, 27 Jul 2010 10:16:18 +1000 (EST) Received: (qmail 19586 invoked by alias); 27 Jul 2010 00:16:15 -0000 Received: (qmail 19577 invoked by uid 22791); 27 Jul 2010 00:16:14 -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, 27 Jul 2010 00:16:08 +0000 Received: (qmail 18290 invoked from network); 27 Jul 2010 00:16:07 -0000 Received: from unknown (HELO ?84.152.198.157?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Jul 2010 00:16:07 -0000 Message-ID: <4C4E253A.8070800@codesourcery.com> Date: Tue, 27 Jul 2010 02:15:54 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100724 Thunderbird/3.1.1 MIME-Version: 1.0 To: IainS CC: gcc patches , David Edelsohn Subject: Re: New optimization for reload_combine References: <4C4035C3.9080305@codesourcery.com> <9E468D4F-ADBF-4F7F-9055-81484B34E78D@sandoe-acoustics.co.uk> In-Reply-To: <9E468D4F-ADBF-4F7F-9055-81484B34E78D@sandoe-acoustics.co.uk> 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 07/26/2010 12:12 PM, IainS wrote: > Apparently, one more problem remains... Thanks again for providing a testcase. I've committed the following fix after bootstrap and regression test on i686-linux. A use with a wrong mode could cause us to move the addition past another set of the register, as the necessary test was at the wrong nesting level. Bernd Index: ChangeLog =================================================================== --- ChangeLog (revision 162549) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2010-07-27 Bernd Schmidt + + * postreload.c (reload_combine_recognize_const_pattern): Move test + for limiting the insn movement to the right scope. + 2010-07-26 Richard Henderson PR target/44132 Index: postreload.c =================================================================== --- postreload.c (revision 162421) +++ postreload.c (working copy) @@ -955,8 +955,8 @@ reload_combine_recognize_const_pattern ( && reg_state[clobbered_regno].real_store_ruid >= use_ruid) break; - /* Avoid moving a use of ADDREG past a point where it - is stored. */ + gcc_assert (reg_state[regno].store_ruid <= use_ruid); + /* Avoid moving a use of ADDREG past a point where it is stored. */ if (reg_state[REGNO (addreg)].store_ruid >= use_ruid) break; @@ -1033,10 +1033,10 @@ reload_combine_recognize_const_pattern ( } } } - /* If we get here, we couldn't handle this use. */ - if (must_move_add) - break; } + /* If we get here, we couldn't handle this use. */ + if (must_move_add) + break; } while (use);