Patchwork [42/65] Add testcase for PR42729 and fix handling of gimple_debug info.

login
register
mail settings
Submitter Sebastian Pop
Date Aug. 2, 2010, 8:20 p.m.
Message ID <1280780438-17543-43-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/60640/
State New
Headers show

Comments

Sebastian Pop - Aug. 2, 2010, 8:20 p.m.
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>

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

	* sese.c (rename_uses): Handl unconditionally gimple_debug statements.

	* gcc.dg/graphite/pr42729.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162250 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog                           |    4 ++++
 gcc/ChangeLog.graphite                  |    6 ++++++
 gcc/sese.c                              |   24 +++++++++++-------------
 gcc/testsuite/ChangeLog                 |    4 ++++
 gcc/testsuite/gcc.dg/graphite/pr42729.c |   15 +++++++++++++++
 5 files changed, 40 insertions(+), 13 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42729.c

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 07ee095..385cdac 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@ 
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* sese.c (rename_uses): Handl unconditionally gimple_debug statements.
+
+2010-08-02  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/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 965ed25..37bedfb 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 583504d..9dbd76f 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/ChangeLog b/gcc/testsuite/ChangeLog
index 172aaa3..76288ae 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@ 
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* gcc.dg/graphite/pr42729.c: New.
+
+2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* gfortran.dg/graphite/id-20.f: New.
 
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
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;
+}