From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15307 invoked by alias); 27 Sep 2012 18:13:30 -0000 Received: (qmail 15298 invoked by uid 22791); 27 Sep 2012 18:13:29 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Sep 2012 18:13:25 +0000 Received: by padfa11 with SMTP id fa11so1620262pad.20 for ; Thu, 27 Sep 2012 11:13:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.197.194 with SMTP id iw2mr13583195pbc.121.1348769605368; Thu, 27 Sep 2012 11:13:25 -0700 (PDT) Received: by 10.66.20.232 with HTTP; Thu, 27 Sep 2012 11:13:25 -0700 (PDT) In-Reply-To: References: <877grgu0yt.fsf@talisman.home> <3730255.NiV98gQJ1a@polaris> Date: Thu, 27 Sep 2012 19:21:00 -0000 Message-ID: Subject: Re: [PATCH v2, rtl-optimization]: Fix PR54457, [x32] Fail to combine 64bit index + constant From: Uros Bizjak To: Paul_Koning@dell.com Cc: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com, ebotcazou@adacore.com Content-Type: text/plain; charset=ISO-8859-1 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 X-SW-Source: 2012-09/txt/msg01853.txt.bz2 On Thu, Sep 27, 2012 at 8:08 PM, wrote: >>>>>> I agree (subreg:M (op:N A C) 0) to (op:M (subreg:N (A 0)) C) is >>>>>> a good transformation, but why do we need to handle as special >>>>>> the case where the subreg is itself the operand of a plus or minus? >>>>>> I think it should happen regardless of where the subreg occurs. >>>>> >>>>> Don't we need to restrict this to the low part though? >>>> >>>> ... >> >> After some off-line discussion with Richard, attached is v2 of the patch. >> >> 2012-09-27 Uros Bizjak >> >> PR rtl-optimization/54457 >> * simplify-rtx.c (simplify_subreg): >> Simplify (subreg:SI (op:DI ((x:DI) (y:DI)), 0) >> to (op:SI (subreg:SI (x:DI) 0) (subreg:SI (x:DI) 0)). >> ... > > Is it just specific to DI -> SI, or is it for any large mode -> smaller mode, like SI -> HI? Oh, I just copied v1 ChangeLog. The patch converts all modes where size of mode M < size of mode N. Updated ChangeLog reads: 2012-09-27 Uros Bizjak PR rtl-optimization/54457 * simplify-rtx.c (simplify_subreg): Simplify (subreg:M (op:N ((x:N) (y:N)), 0) to (op:M (subreg:M (x:N) 0) (subreg:M (x:N) 0)), where the outer subreg is effectively a truncation to the original mode M. testsuite/ChangeLog: 2012-09-27 Uros Bizjak PR rtl-optimization/54457 * gcc.target/i386/pr54457.c: New test. Uros.