From patchwork Thu Nov 24 14:25:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 127530 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 731DB1007DD for ; Fri, 25 Nov 2011 01:26:05 +1100 (EST) Received: (qmail 20654 invoked by alias); 24 Nov 2011 14:26:03 -0000 Received: (qmail 20644 invoked by uid 22791); 24 Nov 2011 14:26:01 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Nov 2011 14:25:48 +0000 Received: by ggnl1 with SMTP id l1so81722ggn.20 for ; Thu, 24 Nov 2011 06:25:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.208.194 with SMTP id mg2mr17868468pbc.112.1322144747580; Thu, 24 Nov 2011 06:25:47 -0800 (PST) Received: by 10.68.41.194 with HTTP; Thu, 24 Nov 2011 06:25:47 -0800 (PST) In-Reply-To: References: Date: Thu, 24 Nov 2011 18:25:47 +0400 Message-ID: Subject: Re: [PATCH Atom] PR target/51287 fix (avoid unrecognized instruction error) From: Ilya Enkovich To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org 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 2011/11/24 Uros Bizjak : > Hello! > >> Here is a short patch to fix PR target/51287. Patch avoids >> get_attr_type call for instructions which cannot be recognized. >> >> 2011-11-24  Enkovich Ilya   >> >>       PR target/51287 >>       * i386.c (distance_non_agu_define_in_bb): Fix insn attr check. > > This is OK for mainline and release branches. > > Thanks, > Uros. > Thanks for the review! Here is corresponding patch for 4.6 branch. Bootstrapped and checked on linux-x86_64. Thanks, Ilya --- 2011-11-24 Enkovich Ilya PR target/51287 * i386.c (distance_non_agu_define): Fix insn attr check. { @@ -16345,8 +16344,8 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2, && (regno1 == DF_REF_REGNO (*def_rec) || regno2 == DF_REF_REGNO (*def_rec))) { - insn_type = get_attr_type (prev); - if (insn_type != TYPE_LEA) + if (recog_memoized (prev) < 0 + || get_attr_type (prev) != TYPE_LEA) goto done; } } @@ -16385,8 +16384,8 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2, && (regno1 == DF_REF_REGNO (*def_rec) || regno2 == DF_REF_REGNO (*def_rec))) { - insn_type = get_attr_type (prev); - if (insn_type != TYPE_LEA) + if (recog_memoized (prev) < 0 + || get_attr_type (prev) != TYPE_LEA) goto done; } } diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 382fabf..6aa0297 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -16329,7 +16329,6 @@ distance_non_agu_define (unsigned int regno1, unsigned int regno2, basic_block bb = BLOCK_FOR_INSN (insn); int distance = 0; df_ref *def_rec; - enum attr_type insn_type; if (insn != BB_HEAD (bb))