This removes special-casing of pointer conversion handling in
gimple_fold_stmt_to_constant_1 - this was from times where
most pointer conversions were not useless (only conversions
to function/method pointers from other kinds are considered
not useless - which I'll change with a followup).

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2014-05-08  Richard Biener  <rguent...@suse.de>

        * gimple-fold.c (gimple_fold_stmt_to_constant_1): Remove
        pointer propagation special-case.

Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c   (revision 210148)
+++ gcc/gimple-fold.c   (working copy)
@@ -2638,20 +2638,6 @@ gimple_fold_stmt_to_constant_1 (gimple s
              tree lhs = gimple_assign_lhs (stmt);
               tree op0 = (*valueize) (gimple_assign_rhs1 (stmt));
 
-             /* Conversions are useless for CCP purposes if they are
-                value-preserving.  Thus the restrictions that
-                useless_type_conversion_p places for restrict qualification
-                of pointer types should not apply here.
-                Substitution later will only substitute to allowed places.  */
-             if (CONVERT_EXPR_CODE_P (subcode)
-                 && POINTER_TYPE_P (TREE_TYPE (lhs))
-                 && POINTER_TYPE_P (TREE_TYPE (op0))
-                 && TYPE_ADDR_SPACE (TREE_TYPE (lhs))
-                    == TYPE_ADDR_SPACE (TREE_TYPE (op0))
-                 && TYPE_MODE (TREE_TYPE (lhs))
-                    == TYPE_MODE (TREE_TYPE (op0)))
-               return op0;
-
               return
                fold_unary_ignore_overflow_loc (loc, subcode,
                                                gimple_expr_type (stmt), op0);

Reply via email to