From patchwork Fri Jul 16 07:04:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 59077 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 006E9B6F19 for ; Fri, 16 Jul 2010 17:05:29 +1000 (EST) Received: (qmail 1808 invoked by alias); 16 Jul 2010 07:04:54 -0000 Received: (qmail 1696 invoked by uid 22791); 16 Jul 2010 07:04:53 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_TM, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Jul 2010 07:04:47 +0000 Received: by yxi11 with SMTP id 11so408831yxi.20 for ; Fri, 16 Jul 2010 00:04:45 -0700 (PDT) Received: by 10.100.164.19 with SMTP id m19mr787664ane.154.1279263885634; Fri, 16 Jul 2010 00:04:45 -0700 (PDT) Received: from napoca (cpe-70-120-196-107.austin.res.rr.com [70.120.196.107]) by mx.google.com with ESMTPS id i30sm21511037anh.9.2010.07.16.00.04.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Jul 2010 00:04:45 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Fri, 16 Jul 2010 02:04:42 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: gcc-graphite@googlegroups.com, Sebastian Pop Subject: [PATCH 09/12] Add testcase for PR42729 and fix handling of gimple_debug info. Date: Fri, 16 Jul 2010 02:04:00 -0500 Message-Id: <1279263843-9149-10-git-send-email-sebpop@gmail.com> In-Reply-To: <1279263843-9149-1-git-send-email-sebpop@gmail.com> References: <1279263843-9149-1-git-send-email-sebpop@gmail.com> 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 2010-07-15 Sebastian Pop * sese.c (rename_uses): Handl unconditionally gimple_debug statements. * gcc.dg/graphite/pr42729.c: New. --- gcc/ChangeLog.graphite | 6 ++++++ gcc/sese.c | 24 +++++++++++------------- gcc/testsuite/gcc.dg/graphite/pr42729.c | 15 +++++++++++++++ 3 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42729.c diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 40db483..f57ef7d 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,11 @@ 2010-07-15 Sebastian Pop + * sese.c (rename_uses): Handl unconditionally gimple_debug statements. + + * gcc.dg/graphite/pr42729.c: New. + +2010-07-15 Sebastian Pop + * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Special case non close-phi nodes with one argument. diff --git a/gcc/sese.c b/gcc/sese.c index 913ac4d..f59f317 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -480,6 +480,16 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt, use_operand_p use_p; ssa_op_iter op_iter; + if (is_gimple_debug (copy)) + { + if (gimple_debug_bind_p (copy)) + gimple_debug_bind_reset_value (copy); + else + gcc_unreachable (); + + return; + } + FOR_EACH_SSA_USE_OPERAND (use_p, copy, op_iter, SSA_OP_ALL_USES) { tree old_name = USE_FROM_PTR (use_p); @@ -501,19 +511,7 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt, || (TREE_CODE (new_expr) != SSA_NAME && is_gimple_reg (old_name))) { - tree var; - - if (is_gimple_debug (copy)) - { - if (gimple_debug_bind_p (copy)) - gimple_debug_bind_reset_value (copy); - else - gcc_unreachable (); - - break; - } - - var = create_tmp_var (type_old_name, "var"); + tree var = create_tmp_var (type_old_name, "var"); if (type_old_name != type_new_expr) new_expr = fold_convert (type_old_name, new_expr); diff --git a/gcc/testsuite/gcc.dg/graphite/pr42729.c b/gcc/testsuite/gcc.dg/graphite/pr42729.c new file mode 100644 index 0000000..3a0e901 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr42729.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fgraphite-identity -fcompare-debug" } */ + +int A[10]; +int *foo () +{ + int *p1, *p2, i; + for (i = 0; i < 10; i++) + { + p1 = &A[i]; + *p1 = 0; + } + p2 = p1; + return p2; +}