]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/44030 (error: SSA name in freelist but still referenced)
authorRichard Guenther <rguenther@suse.de>
Sat, 8 May 2010 13:12:56 +0000 (13:12 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 8 May 2010 13:12:56 +0000 (13:12 +0000)
2010-05-08  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/44030
* tree-ssa-pre.c (eliminate): Copy NECESSARY flag.  Set
NECESSARY flag if we propagate from a inserted expression.

* gcc.c-torture/compile/pr44030.c: New testcase.

From-SVN: r159186

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

index 735c120b2e74b6be75651f06061f5297786e4610..cb1661cab2f755a346120cf3a11ef77487f63f02 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-08  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/44030
+       * tree-ssa-pre.c (eliminate): Copy NECESSARY flag.  Set
+       NECESSARY flag if we propagate from a inserted expression.
+
 2010-05-08  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gimple.c (gimple_types_compatible_p) <ARRAY_TYPE>: Treat bounds of
index b0d26f113db9cb4d83032a60be64c30a257dc2a8..66630e8006daed94638733571da5c3cf854901e7 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-08  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/44030
+       * gcc.c-torture/compile/pr44030.c: New testcase.
+
 2010-05-08  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/lto6.adb: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44030.c b/gcc/testsuite/gcc.c-torture/compile/pr44030.c
new file mode 100644 (file)
index 0000000..cd5d5f6
--- /dev/null
@@ -0,0 +1,28 @@
+typedef int int32_t;
+typedef unsigned int uint32_t;
+static uint32_t
+safe_sub_func_uint32_t_u_u (uint32_t ui1, uint32_t ui2)
+{
+  return ui1 - ui2;
+}
+
+int32_t l_105[7];
+
+int32_t g_4;
+int32_t *g_54 = &g_4;
+int32_t *
+func (int32_t p_73, int32_t * p_74, int32_t p_75, int32_t * *p_76,
+      int32_t * *p_77)
+{
+lbl_110:for (g_4 = 0; g_4; g_4 = 1)
+    {
+    }
+  for (p_75 = -28; p_75; p_75 = safe_sub_func_uint32_t_u_u (p_75, 1))
+    {
+      if (g_4)
+        goto lbl_110;
+      *g_54 = 0;
+    }
+  return &l_105[5];
+}
+
index 514383d7773157cbaf9c4f088a436b6f05e59ec1..ac676cd415058467c4a8a35259531f766063176c 100644 (file)
@@ -4351,6 +4351,7 @@ eliminate (void)
            sprime = fold_convert (TREE_TYPE (res), sprime);
          stmt = gimple_build_assign (res, sprime);
          SSA_NAME_DEF_STMT (res) = stmt;
+         gimple_set_plf (stmt, NECESSARY, gimple_plf (phi, NECESSARY));
 
          gsi2 = gsi_after_labels (b);
          gsi_insert_before (&gsi2, stmt, GSI_NEW_STMT);
@@ -4381,8 +4382,11 @@ eliminate (void)
          && single_imm_use (lhs, &use_p, &use_stmt)
          && may_propagate_copy (USE_FROM_PTR (use_p), rhs))
        {
-         SET_USE (use_p, gimple_assign_rhs1 (stmt));
+         SET_USE (use_p, rhs);
          update_stmt (use_stmt);
+         if (bitmap_bit_p (inserted_exprs, SSA_NAME_VERSION (lhs))
+             && TREE_CODE (rhs) == SSA_NAME)
+           gimple_set_plf (SSA_NAME_DEF_STMT (rhs), NECESSARY, true);
        }
 
       /* If this is a store or a now unused copy, remove it.  */
This page took 0.096876 seconds and 5 git commands to generate.