]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/19736 (ICE with type mismatch between SSA_NAME and its symbol)
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 3 Feb 2005 15:13:45 +0000 (15:13 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 3 Feb 2005 15:13:45 +0000 (07:13 -0800)
2005-02-03  Andrew Pinski  <pinskia@physics.uc.edu>

        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.

From-SVN: r94658

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

index 465e2e95e22e427ac443583140de62647f264fd3..b0561fd03c8b94563f19138f14f52461051d8760 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 d983553ec5b567743c736eb056e2071b1f3c8461..f1c5ab234828640939f02183964bb9b6d0e3483f 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 c34ddd8626448cff997c725d2a6f548924eb9af7..de4006d21870e22cb9d3b6b66e136053b4890180 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);
            }