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

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

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

From-SVN: r210208
This commit is contained in:
Richard Biener 2014-05-08 10:19:17 +00:00 committed by Richard Biener
parent a3820abe7c
commit fb42e303b4
2 changed files with 5 additions and 15 deletions

View File

@ -1,3 +1,8 @@
2014-05-08 Richard Biener <rguenther@suse.de>
* gimple-fold.c (gimple_fold_stmt_to_constant_1): Remove
pointer propagation special-case.
2014-05-08 Bin Cheng <bin.cheng@arm.com> 2014-05-08 Bin Cheng <bin.cheng@arm.com>
* tree-affine.c (tree_to_aff_combination): Handle MEM_REF for * tree-affine.c (tree_to_aff_combination): Handle MEM_REF for

View File

@ -2635,23 +2635,8 @@ gimple_fold_stmt_to_constant_1 (gimple stmt, tree (*valueize) (tree))
/* Handle unary operators that can appear in GIMPLE form. /* Handle unary operators that can appear in GIMPLE form.
Note that we know the single operand must be a constant, Note that we know the single operand must be a constant,
so this should almost always return a simplified RHS. */ so this should almost always return a simplified RHS. */
tree lhs = gimple_assign_lhs (stmt);
tree op0 = (*valueize) (gimple_assign_rhs1 (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 return
fold_unary_ignore_overflow_loc (loc, subcode, fold_unary_ignore_overflow_loc (loc, subcode,
gimple_expr_type (stmt), op0); gimple_expr_type (stmt), op0);