tree-ssa-pre.c (try_combine_conversion): Strip useless type conversions after folding.
authorRichard Guenther <rguenther@suse.de>
Mon, 19 Jun 2006 19:48:04 +0000 (19:48 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 19 Jun 2006 19:48:04 +0000 (19:48 +0000)
2006-06-19  Richard Guenther  <rguenther@suse.de>

* tree-ssa-pre.c (try_combine_conversion): Strip useless
type conversions after folding.

From-SVN: r114784

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

index 50d8902a7152d51c930e5998ef95920f61b49100..81535ec9884ac038ef43f14ad50f84a0748d4d62 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-19  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-pre.c (try_combine_conversion): Strip useless
+       type conversions after folding.
+
 2006-06-19  Richard Guenther  <rguenther@suse.de>
 
        * ggc-page.c (extra_order_size_tab): Add entries with
index 7ae481b2b7a622997b4054924bfade1aba227453..54c6eb355fd77912595d5bda632cbf80ca4fd6b7 100644 (file)
@@ -3330,12 +3330,17 @@ try_combine_conversion (tree *expr_p)
 
   t = fold_unary (TREE_CODE (expr), TREE_TYPE (expr),
                  VALUE_HANDLE_EXPR_SET (TREE_OPERAND (expr, 0))->head->expr);
+  if (!t)
+    return false;
+
+  /* Strip useless type conversions, which is safe in the optimizers but
+     not generally in fold.  */
+  STRIP_USELESS_TYPE_CONVERSION (t);
 
   /* Disallow value expressions we have no value number for already, as
      we would miss a leader for it here.  */
-  if (t
-      && !(TREE_CODE (t) == VALUE_HANDLE
-          || is_gimple_min_invariant (t)))
+  if (!(TREE_CODE (t) == VALUE_HANDLE
+       || is_gimple_min_invariant (t)))
     t = vn_lookup (t, NULL);
 
   if (t && t != expr)