OSDN Git Service

2010-05-08 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 May 2010 13:12:56 +0000 (13:12 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:03:42 +0000 (14:03 +0900)
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.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/tree-ssa-pre.c

index 735c120..cb1661c 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 b0d26f1..66630e8 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.
index 514383d..ac676cd 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.  */