[PATCH][mem-ref2] Drop some more INDIRECT_REF handling
Richard Guenther
rguenther@suse.de
Thu Jun 24 16:11:00 GMT 2010
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2010-06-24 Richard Guenther <rguenther@suse.de>
* tree-complex.c (extract_component): Do not handle INDIRECT_REF.
* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
* tree-ssa-structalias.c (get_constraint_for_1): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
Index: gcc/tree-complex.c
===================================================================
--- gcc/tree-complex.c (revision 161312)
+++ gcc/tree-complex.c (working copy)
@@ -596,7 +596,6 @@ extract_component (gimple_stmt_iterator
case VAR_DECL:
case RESULT_DECL:
case PARM_DECL:
- case INDIRECT_REF:
case COMPONENT_REF:
case ARRAY_REF:
case VIEW_CONVERT_EXPR:
Index: gcc/tree-ssa-ccp.c
===================================================================
--- gcc/tree-ssa-ccp.c (revision 161312)
+++ gcc/tree-ssa-ccp.c (working copy)
@@ -1296,21 +1296,6 @@ fold_const_aggregate_ref (tree t)
break;
}
- /* ??? Best do a fold_const_aggregate_ref_off with an extra constant
- offset argument to avoid creating new trees. */
- case INDIRECT_REF:
- {
- tree base = TREE_OPERAND (t, 0);
- if (TREE_CODE (base) == SSA_NAME
- && (value = get_value (base))
- && value->lattice_val == CONSTANT
- && TREE_CODE (value->value) == ADDR_EXPR
- && useless_type_conversion_p (TREE_TYPE (t),
- TREE_TYPE (TREE_TYPE (value->value))))
- return fold_const_aggregate_ref (TREE_OPERAND (value->value, 0));
- break;
- }
-
case MEM_REF:
/* Get the base object we are accessing. */
base = TREE_OPERAND (t, 0);
@@ -1375,11 +1360,14 @@ fold_const_aggregate_ref (tree t)
&& (TYPE_MODE (TREE_TYPE (t))
== TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor))))
&& GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t))) != 0
- && integer_zerop (int_const_binop (TRUNC_MOD_EXPR,
- idx, size_int (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))), 0)))
+ && integer_zerop
+ (int_const_binop
+ (TRUNC_MOD_EXPR, idx,
+ size_int (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))), 0)))
{
- idx = int_const_binop (TRUNC_DIV_EXPR,
- idx, size_int (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))), 0);
+ idx = int_const_binop (TRUNC_DIV_EXPR, idx,
+ size_int (GET_MODE_SIZE
+ (TYPE_MODE (TREE_TYPE (t)))), 0);
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), cnt, cfield, cval)
if (tree_int_cst_equal (cfield, idx))
{
Index: gcc/tree-ssa-structalias.c
===================================================================
--- gcc/tree-ssa-structalias.c (revision 161312)
+++ gcc/tree-ssa-structalias.c (working copy)
@@ -3335,12 +3335,6 @@ get_constraint_for_1 (tree t, VEC (ce_s,
{
switch (TREE_CODE (t))
{
- case INDIRECT_REF:
- {
- get_constraint_for_1 (TREE_OPERAND (t, 0), results, address_p);
- do_deref (results);
- return;
- }
case MEM_REF:
{
get_constraint_for_ptr_offset (TREE_OPERAND (t, 0),
Index: gcc/tree-ssa-operands.c
===================================================================
--- gcc/tree-ssa-operands.c (revision 161312)
+++ gcc/tree-ssa-operands.c (working copy)
@@ -711,10 +711,10 @@ mark_address_taken (tree ref)
}
-/* A subroutine of get_expr_operands to handle INDIRECT_REF,
+/* A subroutine of get_expr_operands to handle MEM_REF,
ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF.
- STMT is the statement being processed, EXPR is the INDIRECT_REF
+ STMT is the statement being processed, EXPR is the MEM_REF
that got us here.
FLAGS is as in get_expr_operands.
@@ -915,7 +915,6 @@ get_expr_operands (gimple stmt, tree *ex
/* fall through */
case ALIGN_INDIRECT_REF:
- case INDIRECT_REF:
case MEM_REF:
get_indirect_ref_operands (stmt, expr, flags, true);
return;
More information about the Gcc-patches
mailing list