From patchwork Wed Mar 2 14:40:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 590996 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 026E514031B for ; Thu, 3 Mar 2016 01:40:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ebvVBY3P; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=vGhvT1BCcHsuLaxZ2 gnYbHS+Un4Fr0MCjamUUz6mTa97xYwqZ1Z/xAexLXfISI5SGxWbaXv67GcXHwbIY DMXRrYOlxKAIJaRPugRYAJU2oVZnpLcN86TvQTGowvCMWbcKYpidNPxyiQjLDATG 6aYXRW1rP07IG89N0VH6xj4et0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=TiobjoZD+Kct2smkHkuXARA 9V10=; b=ebvVBY3P1cxLUHXjejdyKx3+Imi9iZVt71MCuQScn4yqJrb1lDKZdHL WvuCqgC2ei6pgbSBpIfSzSdqheywEwXB3bRo+JBVwnHc6RlPDW+gDfhEPOrDCL42 bqRwmSoHs3QinhkpUc46bdUhYa7lqGR18M6hAWWoSsdiu3zdtgTM= Received: (qmail 45112 invoked by alias); 2 Mar 2016 14:40:34 -0000 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 Received: (qmail 45086 invoked by uid 89); 2 Mar 2016 14:40:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Mar 2016 14:40:28 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ab7wt-0000M6-41 from Tom_deVries@mentor.com ; Wed, 02 Mar 2016 06:40:23 -0800 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Wed, 2 Mar 2016 14:40:21 +0000 Subject: Re: [PATCH, PR68659] Handle addr_expr and component_ref in graphite-ast-to-ast To: Richard Biener References: <56D562F5.2090608@mentor.com> CC: Sebastian Pop , GCC Patches From: Tom de Vries Message-ID: <56D6FB53.6040303@mentor.com> Date: Wed, 2 Mar 2016 15:40:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: On 01-03-16 10:45, Richard Biener wrote: > On Tue, 1 Mar 2016, Tom de Vries wrote: > >> Hi, >> >> this patch fixes graphite PR68659, which is a 6 regression. >> >> The patch fixes two things: >> - by handling new_expr == NULL_TREE in collect_all_ssa_names, it handles a >> COMPONENT_REF where operand 2 is NULL_TREE. >> - it handles an ADDR_EXPR in get_new_name. >> Together, they allow the currently failing test-case >> gcc.dg/graphite/id-pr45230-1.c to pass. >> >> Bootstrapped and reg-tested on x86_64. >> >> OK for stage4 trunk? > > @@ -1804,6 +1806,9 @@ get_new_name (basic_block new_bb, tree op, > if (is_constant (op)) > return op; > > + if (TREE_CODE (op) == ADDR_EXPR) > + return op; > + > return get_rename (new_bb, op, old_bb, phi_kind); > } > > > please instead change the is_constant (op) condition to > TREE_CODE (op) != SSA_NAME. Done. Bootstrapped and reg-tested on x86_64. OK for stage4 trunk? Thanks, - Tom Handle addr_expr and component_ref in graphite-ast-to-ast 2016-03-01 Tom de Vries PR tree-optimization/68659 * graphite-isl-ast-to-gimple.c (collect_all_ssa_names): Handle new_expr == NULL_TREE. (get_new_name): Handle ADDR_EXPR. --- gcc/graphite-isl-ast-to-gimple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index d3614e4..89a4118 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -1403,6 +1403,8 @@ gsi_insert_earliest (gimple_seq seq) void translate_isl_ast_to_gimple:: collect_all_ssa_names (tree new_expr, vec *vec_ssa) { + if (new_expr == NULL_TREE) + return; /* Rename all uses in new_expr. */ if (TREE_CODE (new_expr) == SSA_NAME) @@ -1801,7 +1803,7 @@ get_new_name (basic_block new_bb, tree op, basic_block old_bb, phi_node_kind phi_kind) const { /* For constants the names are the same. */ - if (is_constant (op)) + if (TREE_CODE (op) != SSA_NAME) return op; return get_rename (new_bb, op, old_bb, phi_kind);