From patchwork Mon Nov 29 19:24:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 73483 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 AF0C91007D1 for ; Tue, 30 Nov 2010 06:24:56 +1100 (EST) Received: (qmail 790 invoked by alias); 29 Nov 2010 19:24:55 -0000 Received: (qmail 781 invoked by uid 22791); 29 Nov 2010 19:24:54 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Nov 2010 19:24:48 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 29 Nov 2010 11:24:46 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 29 Nov 2010 11:24:46 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 7D635180E0B; Mon, 29 Nov 2010 11:24:46 -0800 (PST) Date: Mon, 29 Nov 2010 11:24:46 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: PATCH: [4.5 Regression] ICE with graphite enabled in cairo-1.8.10 Message-ID: <20101129192446.GA8629@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi, This patch fixes a 4.5 regression. OK for 4.5? Thanks. H.J. --- gcc/ 2010-11-29 H.J. Lu Backport from mainline PR middle-end/46651 2010-07-22 Sebastian Pop * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use SSA_NAME_DEF_STMT only on SSA_NAMEs. gcc/testsuite/ 2010-11-29 H.J. Lu Backport from mainline 2010-07-22 Sebastian Pop PR middle-end/46651 * gcc.dg/graphite/id-24.c: New. diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index b12210b..b8f332a 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -2235,7 +2235,8 @@ rewrite_phi_out_of_ssa (gimple_stmt_iterator *psi) /* Avoid the insertion of code in the loop latch to please the pattern matching of the vectorizer. */ - if (e->src == bb->loop_father->latch) + if (TREE_CODE (arg) == SSA_NAME + && e->src == bb->loop_father->latch) insert_out_of_ssa_copy (zero_dim_array, arg); else insert_out_of_ssa_copy_on_edge (e, zero_dim_array, arg); diff --git a/gcc/testsuite/gcc.dg/graphite/id-24.c b/gcc/testsuite/gcc.dg/graphite/id-24.c new file mode 100644 index 0000000..d466069 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/id-24.c @@ -0,0 +1,22 @@ +/* gcc.dg/tree-ssa/loadpre23.c used to ICE with Graphite. */ + +struct { + int a; + int large[100]; +} x; + +int foo(int argc) +{ + int b; + int c; + int i; + int d, e; + + for (i = 0; i < argc; i++) + { + e = x.a; + x.a = 9; + } + return d + e; +} +