public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sebastian Pop <sebpop@gmail.com>
To: gcc-patches@gcc.gnu.org
Cc: gcc-graphite@googlegroups.com,	Sebastian Pop <sebpop@gmail.com>
Subject: [PATCH 09/12] Add testcase for PR42729 and fix handling of gimple_debug info.
Date: Fri, 16 Jul 2010 07:04:00 -0000	[thread overview]
Message-ID: <1279263843-9149-10-git-send-email-sebpop@gmail.com> (raw)
In-Reply-To: <1279263843-9149-1-git-send-email-sebpop@gmail.com>

2010-07-15  Sebastian Pop  <sebastian.pop@amd.com>

	* 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  <sebastian.pop@amd.com>
 
+	* sese.c (rename_uses): Handl unconditionally gimple_debug statements.
+
+	* gcc.dg/graphite/pr42729.c: New.
+
+2010-07-15  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* 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;
+}
-- 
1.7.0.4

  reply	other threads:[~2010-07-16  7:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16  7:04 [PATCH 00/12] [graphite] Remove the induction variable canonicalization Sebastian Pop
2010-07-16  7:04 ` Sebastian Pop [this message]
2010-07-16  7:04 ` [PATCH 03/12] chrec_apply should only apply to the specified variable Sebastian Pop
2010-07-16  7:04 ` [PATCH 07/12] Scevs could be expressions without chrecs and still be scev_analyzable_p Sebastian Pop
2010-07-16  7:05 ` [PATCH 11/12] Do not rewrite out of SSA scalar phi nodes that can " Sebastian Pop
2010-07-16  7:05 ` [PATCH 08/12] Special case non close-phi nodes with one argument in rewrite_close_phi_out_of_ssa Sebastian Pop
2010-07-16  7:05 ` [PATCH 12/12] Unshare the scev before code generating it Sebastian Pop
2010-07-16  7:05 ` [PATCH 05/12] Remove uses of loop->single_iv Sebastian Pop
2010-07-16  7:05 ` [PATCH 04/12] Also handle GIMPLE_CALLs in rewrite_cross_bb_scalar_deps Sebastian Pop
2010-07-16  7:05 ` [PATCH 02/12] Remove expand_scalar_variables_ hack Sebastian Pop
2010-07-16  7:05 ` [PATCH 06/12] Bump the size of scevs Sebastian Pop
2010-07-16  8:03   ` Richard Guenther
2010-07-16 14:41     ` Sebastian Pop
2010-07-16  7:05 ` [PATCH 10/12] Correctly handle SSA_NAME_IS_DEFAULT_DEF in rewrite_close_phi_out_of_ssa Sebastian Pop
2010-07-16  7:05 ` [PATCH 01/12] Remove insert_loop_close_phis Sebastian Pop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279263843-9149-10-git-send-email-sebpop@gmail.com \
    --to=sebpop@gmail.com \
    --cc=gcc-graphite@googlegroups.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).