From patchwork Thu Nov 24 11:41:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 127480 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 2DA4A1007D7 for ; Thu, 24 Nov 2011 22:41:58 +1100 (EST) Received: (qmail 673 invoked by alias); 24 Nov 2011 11:41:53 -0000 Received: (qmail 663 invoked by uid 22791); 24 Nov 2011 11:41:51 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 11:41:34 +0000 Received: by ggnh4 with SMTP id h4so2732720ggn.20 for ; Thu, 24 Nov 2011 03:41:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.17.161 with SMTP id p1mr16927810pbd.44.1322134893390; Thu, 24 Nov 2011 03:41:33 -0800 (PST) Received: by 10.68.41.194 with HTTP; Thu, 24 Nov 2011 03:41:33 -0800 (PST) Date: Thu, 24 Nov 2011 15:41:33 +0400 Message-ID: Subject: [PATCH Atom] PR target/51287 fix (avoid unrecognized instruction error) From: Ilya Enkovich To: 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 Hello, Here is a short patch to fix PR target/51287. Patch avoids get_attr_type call for instructions which cannot be recognized. Bootstrapped and checked on linux-x86_64. 252.eon also works fine with this fix on Atom. Could please someone review it? Thanks, Ilya --- 2011-11-24 Enkovich Ilya PR target/51287 * i386.c (distance_non_agu_define_in_bb): Fix insn attr check. @@ -16470,8 +16469,8 @@ distance_non_agu_define_in_bb (unsigned int regno1, unsigned int regno2, distance = increase_distance (prev, next, distance); if (insn_defines_reg (regno1, regno2, prev)) { - insn_type = get_attr_type (prev); - if (insn_type != TYPE_LEA) + if (recog_memoized (prev) < 0 + || get_attr_type (prev) != TYPE_LEA) { *found = true; return distance; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3436820..76b15f2 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -16457,7 +16457,6 @@ distance_non_agu_define_in_bb (unsigned int regno1, unsigned int regno2, basic_block bb = start ? BLOCK_FOR_INSN (start) : NULL; rtx prev = start; rtx next = NULL; - enum attr_type insn_type; *found = false;