]> gcc.gnu.org Git - gcc.git/commitdiff
tree-ssa-pre.c (eliminate): When replacing a PHI node carry out a necessary conversion.
authorRichard Guenther <rguenther@suse.de>
Wed, 15 Apr 2009 14:18:22 +0000 (14:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 15 Apr 2009 14:18:22 +0000 (14:18 +0000)
2009-04-15  Richard Guenther  <rguenther@suse.de>

* tree-ssa-pre.c (eliminate): When replacing a PHI node carry
out a necessary conversion.
* tree-ssa-sccvn.c (run_scc_vn): Also assign value-ids to
names we didn't value number.
* tree-mudflap.c (mf_build_check_statement_for): Use correct types.

From-SVN: r146121

gcc/ChangeLog
gcc/tree-mudflap.c
gcc/tree-ssa-pre.c
gcc/tree-ssa-sccvn.c

index 6ba81d270a4841d8633745729ca7cfc6a2f01276..6898c7c8c8a8867d8deb6469def27888aba69068 100644 (file)
@@ -1,3 +1,11 @@
+2009-04-15  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-pre.c (eliminate): When replacing a PHI node carry
+       out a necessary conversion.
+       * tree-ssa-sccvn.c (run_scc_vn): Also assign value-ids to
+       names we didn't value number.
+       * tree-mudflap.c (mf_build_check_statement_for): Use correct types.
+
 2009-04-15  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/39764
index dae12874dad6c6fe951b0fa5768725f257856995..1e84ad3ed2dcf3e7bbd38075f9934be758ffbbad 100644 (file)
@@ -634,7 +634,7 @@ mf_build_check_statement_for (tree base, tree limit,
 
   /* Build the conditional jump.  'cond' is just a temporary so we can
      simply build a void COND_EXPR.  We do need labels in both arms though.  */
-  g = gimple_build_cond (NE_EXPR, cond, integer_zero_node, NULL_TREE,
+  g = gimple_build_cond (NE_EXPR, cond, boolean_false_node, NULL_TREE,
                         NULL_TREE);
   gimple_set_location (g, location);
   gimple_seq_add_stmt (&seq, g);
@@ -664,9 +664,9 @@ mf_build_check_statement_for (tree base, tree limit,
   /* u is a string, so it is already a gimple value.  */
   u = mf_file_function_line_tree (location);
   /* NB: we pass the overall [base..limit] range to mf_check.  */
-  v = fold_build2 (PLUS_EXPR, integer_type_node,
+  v = fold_build2 (PLUS_EXPR, mf_uintptr_type,
                   fold_build2 (MINUS_EXPR, mf_uintptr_type, mf_limit, mf_base),
-                  integer_one_node);
+                  build_int_cst (mf_uintptr_type, 1));
   v = force_gimple_operand (v, &stmts, true, NULL_TREE);
   gimple_seq_add_seq (&seq, stmts);
   g = gimple_build_call (mf_check_fndecl, 4, mf_base, v, dirflag, u);
index 54770c8eea942e4b690a2c4e1399ec6debd7b880..1119f078b39d168ab8e79121f22bec8411e744e5 100644 (file)
@@ -4181,6 +4181,8 @@ eliminate (void)
 
          remove_phi_node (&gsi, false);
 
+         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;
          if (TREE_CODE (sprime) == SSA_NAME)
index f3b00e99b48826756e979e20ff941c530451aed8..b101aebd9e488afd932d55f616e02503f4148273 100644 (file)
@@ -2886,7 +2886,8 @@ run_scc_vn (bool may_insert_arg)
       if (!name)
        continue;
       info = VN_INFO (name);
-      if (info->valnum == name)
+      if (info->valnum == name
+         || info->valnum == VN_TOP)
        info->value_id = get_next_value_id ();
       else if (is_gimple_min_invariant (info->valnum))
        info->value_id = get_or_alloc_constant_value_id (info->valnum);
This page took 0.077092 seconds and 5 git commands to generate.