OSDN Git Service

PR tree-optimization/43984
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 May 2010 13:54:32 +0000 (13:54 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:00:58 +0000 (14:00 +0900)
* tree-ssa-pre.c (inserted_phi_names): Remove.
(inserted_exprs): Change to bitmap.
(create_expression_by_pieces): Set bits, don't append to vector.
(insert_into_preds_of_block): Don't handle inserted_phi_names.
(eliminate): Don't look at inserted_phi_names, remove deleted
insns from inserted_exprs.
(remove_dead_inserted_code): Adjust to use bitmaps instead of
vectors.
(init_pre, fini_pre): Allocate and free bitmaps.
(execute_pre): Insert insns on edges before elimination.

testsuite/
* gfortran.dg/pr43984.f90: New test.

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

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

index 620ef3d..c5288a9 100644 (file)
@@ -1,3 +1,17 @@
+2010-05-06  Michael Matz  <matz@suse.de>
+
+       PR tree-optimization/43984
+       * tree-ssa-pre.c (inserted_phi_names): Remove.
+       (inserted_exprs): Change to bitmap.
+       (create_expression_by_pieces): Set bits, don't append to vector.
+       (insert_into_preds_of_block): Don't handle inserted_phi_names.
+       (eliminate): Don't look at inserted_phi_names, remove deleted
+       insns from inserted_exprs.
+       (remove_dead_inserted_code): Adjust to use bitmaps instead of
+       vectors.
+       (init_pre, fini_pre): Allocate and free bitmaps.
+       (execute_pre): Insert insns on edges before elimination.
+
 2010-05-06  Maxim Kuvyrkov  <maxim@codesourcery.com>
 
        * tree.c (initializer_zerop): Handle STRING_CST.
index 6b4584e..a51f4db 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-06  Michael Matz  <matz@suse.de>
+
+       PR tree-optimization/43984
+       * gfortran.dg/pr43984.f90: New test.
+
 2010-05-06  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR 40989
index 18c75d2..49dff65 100644 (file)
@@ -24,11 +24,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
+#include "ggc.h"
 #include "tree.h"
 #include "basic-block.h"
 #include "diagnostic.h"
-#include "tree-pretty-print.h"
-#include "gimple-pretty-print.h"
 #include "tree-inline.h"
 #include "tree-flow.h"
 #include "gimple.h"
@@ -37,6 +36,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "fibheap.h"
 #include "hashtab.h"
 #include "tree-iterator.h"
+#include "real.h"
 #include "alloc-pool.h"
 #include "obstack.h"
 #include "tree-pass.h"
@@ -4347,15 +4347,10 @@ eliminate (void)
 
          remove_phi_node (&gsi, false);
 
-         if (!bitmap_bit_p (inserted_exprs, SSA_NAME_VERSION (res))
-             && TREE_CODE (sprime) == SSA_NAME)
-           gimple_set_plf (SSA_NAME_DEF_STMT (sprime), NECESSARY, true);
-
          if (!useless_type_conversion_p (TREE_TYPE (res), TREE_TYPE (sprime)))
            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);
@@ -4386,11 +4381,8 @@ eliminate (void)
          && single_imm_use (lhs, &use_p, &use_stmt)
          && may_propagate_copy (USE_FROM_PTR (use_p), rhs))
        {
-         SET_USE (use_p, rhs);
+         SET_USE (use_p, gimple_assign_rhs1 (stmt));
          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.  */
@@ -4718,14 +4710,17 @@ execute_pre (bool do_fre)
   if (!run_scc_vn (do_fre))
     {
       if (!do_fre)
-       loop_optimizer_finalize ();
+       {
+         remove_dead_inserted_code ();
+         loop_optimizer_finalize ();
+       }
 
       return 0;
     }
-
   init_pre (do_fre);
   scev_initialize ();
 
+
   /* Collect and value number expressions computed in each basic block.  */
   compute_avail ();