OSDN Git Service

2005-02-03 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Feb 2005 15:13:45 +0000 (15:13 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Feb 2005 15:13:45 +0000 (15:13 +0000)
        PR tree-opt/19763
        * gcc.c-torture/compile/pr19736.c: New test.

2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/19736
        * tree-ssa.c (replace_immediate_uses): Update the immediate_uses
        information for the new statement.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94658 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr19736.c [new file with mode: 0644]
gcc/tree-ssa.c

index 465e2e9..b0561fd 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR tree-opt/19736
+       * tree-ssa.c (replace_immediate_uses): Update the immediate_uses
+       information for the new statement.
+
 2005-02-03  Joseph S. Myers  <joseph@codesourcery.com>
 
        PR driver/19117
index d983553..f1c5ab2 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR tree-opt/19763
+       * gcc.c-torture/compile/pr19736.c: New test.
+
 2005-02-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/17401
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr19736.c b/gcc/testsuite/gcc.c-torture/compile/pr19736.c
new file mode 100644 (file)
index 0000000..0b618b1
--- /dev/null
@@ -0,0 +1,21 @@
+/* We used to ICE because we had forgot to update the immediate_uses
+   information after foldding the last strcpy in Reduce PHI.
+   This was PR tree-opt/19763. */
+
+extern char *strcpy (char *, const char *);
+void sdbout_one_type (char *p)
+{
+  int i, t = 1;
+  char *q;
+  for (i = 0; i < 2; i++)
+    {
+      strcpy (p, "1");
+      p += sizeof ("1");
+    }
+  if (t)
+    q = "2";
+  else
+    q = "3";
+  strcpy (p, q);
+}
+
index c34ddd8..de4006d 100644 (file)
@@ -1108,6 +1108,8 @@ replace_immediate_uses (tree var, tree repl)
          if (tmp != stmt)
            {
              block_stmt_iterator si = bsi_for_stmt (stmt);
+             mark_new_vars_to_rename (tmp, vars_to_rename);
+             redirect_immediate_uses (stmt, tmp);
              bsi_replace (&si, tmp, true);
              stmt = bsi_stmt (si);
            }