From patchwork Wed Jun 30 04:56:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 57375 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 959E6B6EED for ; Wed, 30 Jun 2010 14:56:43 +1000 (EST) Received: (qmail 29158 invoked by alias); 30 Jun 2010 04:56:38 -0000 Received: (qmail 29143 invoked by uid 22791); 30 Jun 2010 04:56:37 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-px0-f175.google.com (HELO mail-px0-f175.google.com) (209.85.212.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Jun 2010 04:56:32 +0000 Received: by pxi12 with SMTP id 12so208882pxi.20 for ; Tue, 29 Jun 2010 21:56:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.20.41 with SMTP id x41mr9495929wfi.216.1277873790224; Tue, 29 Jun 2010 21:56:30 -0700 (PDT) Received: by 10.142.231.8 with HTTP; Tue, 29 Jun 2010 21:56:30 -0700 (PDT) In-Reply-To: References: <4BD075C9.1080502@codesourcery.com> <4C0D0656.4060903@codesourcery.com> <4C293731.4080500@redhat.com> <4C293DB0.8020201@codesourcery.com> <4C295B32.9070104@redhat.com> <4C29F386.2090006@codesourcery.com> Date: Tue, 29 Jun 2010 21:56:30 -0700 Message-ID: Subject: Re: Resubmit/ping: peephole2 vs cond-exec vs df From: "H.J. Lu" To: Andrew Pinski Cc: Bernd Schmidt , Richard Henderson , GCC Patches X-IsSubscribed: yes 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 Tue, Jun 29, 2010 at 8:11 PM, H.J. Lu wrote: > On Tue, Jun 29, 2010 at 7:26 PM, H.J. Lu wrote: >> On Tue, Jun 29, 2010 at 5:43 PM, Andrew Pinski wrote: >>> On Tue, Jun 29, 2010 at 5:41 PM, Andrew Pinski wrote: >>>> On Tue, Jun 29, 2010 at 6:22 AM, Bernd Schmidt wrote: >>>>> No, those parts of the buffer that weren't part of the match remain >>>>> unaffected, we keep both the insns and their life information.  We only >>>>> rebuild life for the new insns produced by the match. >>>>> >>>>> Here's a new version with a few more comments and a few remnants of old >>>>> code removed.  I've also removed some dead code found in genrecog.c (got >>>>> sidetracked today into debugging the current peephole2 code again...); >>>>> this was left in after your r34208 patch. >>>> >>>> I think this causes a bootstrap failure on x86_64-linux-gnu: >>>> /home/apinski/src/gcc-fsf/local//gcc/gcc/coverage.c:151:1: error: >>>> unrecognizable insn: >>>> (insn 25 7 26 2 >>>> /home/apinski/src/gcc-fsf/local//gcc/gcc/coverage.c:150 (set (reg:DI 1 >>>> dx) >>>>        (mem/s:SI (plus:DI (reg/v/f:DI 5 di [orig:64 of ] [64]) >>>>                (const_int 4 [0x4])) [15 entry_2->ctr+0 S4 A32])) -1 (nil)) >>>> /home/apinski/src/gcc-fsf/local//gcc/gcc/coverage.c:151:1: internal >>>> compiler error: in extract_insn, at recog.c:2127 >>> >>> +  [(match_scratch:SI 5 "r") >>> >>> I think the :SI part is incorrect, we need a DI mode on x86_64 rather >>> than a SImode. >>> >> >> Like this? >> >> -- >> H.J. >> --- >> Index: gcc/config/i386/i386.md >> =================================================================== >> --- gcc/config/i386/i386.md     (revision 161586) >> +++ gcc/config/i386/i386.md     (working copy) >> @@ -17558,7 +17558,7 @@ >>  ;;  leal    (%edx,%eax,4), %eax >> >>  (define_peephole2 >> -  [(match_scratch:SI 5 "r") >> +  [(match_scratch:P 5 "r") >>    (parallel [(set (match_operand 0 "register_operand" "") >>                   (ashift (match_operand 1 "register_operand" "") >>                           (match_operand 2 "const_int_operand" ""))) >> > > It doesn't work. > > -- > H.J. > This seems to work. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 7003f52..c450c38 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -17558,7 +17558,7 @@ ;; leal (%edx,%eax,4), %eax (define_peephole2 - [(match_scratch:SI 5 "r") + [(match_scratch:P 5 "r") (parallel [(set (match_operand 0 "register_operand" "") (ashift (match_operand 1 "register_operand" "") (match_operand 2 "const_int_operand" ""))) @@ -17587,9 +17587,12 @@ operands[1] = gen_rtx_PLUS (Pmode, base, gen_rtx_MULT (Pmode, index, GEN_INT (scale))); - if (mode != Pmode) - operands[1] = gen_rtx_SUBREG (mode, operands[1], 0); operands[5] = base; + if (mode != Pmode) + { + operands[1] = gen_rtx_SUBREG (mode, operands[1], 0); + operands[5] = gen_rtx_SUBREG (mode, operands[5], 0); + } operands[0] = dest; })