+2007-05-25 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR tree-opt/32090
+ * tree-ssa-forwprop.c
+ (forward_propagate_addr_into_variable_array_index): Remove
+ the lhs argument. Use the type of def_rhs instead of lhs.
+ (forward_propagate_addr_expr_1): Update use of
+ forward_propagate_addr_into_variable_array_index.
+
2007-05-25 Sandra Loosemore <sandra@codesourcery.com>
Nigel Stephens <nigel@mips.com>
mark_symbols_for_renaming (stmt);
}
-/* DEF_RHS defines LHS which is contains the address of the 0th element
- in an array. USE_STMT uses LHS to compute the address of an
+/* DEF_RHS contains the address of the 0th element in an array.
+ USE_STMT uses type of DEF_RHS to compute the address of an
arbitrary element within the array. The (variable) byte offset
of the element is contained in OFFSET.
with the new address computation. */
static bool
-forward_propagate_addr_into_variable_array_index (tree offset, tree lhs,
+forward_propagate_addr_into_variable_array_index (tree offset,
tree def_rhs, tree use_stmt)
{
tree index;
/* Try to find an expression for a proper index. This is either
a multiplication expression by the element size or just the
ssa name we came along in case the element size is one. */
- if (integer_onep (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (lhs)))))
+ if (integer_onep (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (def_rhs)))))
index = offset;
else
{
if (TREE_CODE (offset) != MULT_EXPR
|| TREE_CODE (TREE_OPERAND (offset, 1)) != INTEGER_CST
|| !simple_cst_equal (TREE_OPERAND (offset, 1),
- TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (lhs)))))
+ TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (def_rhs)))))
return false;
/* The first operand to the MULT_EXPR is the desired index. */
bool res;
tree offset_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 1));
- res = forward_propagate_addr_into_variable_array_index (offset_stmt, lhs,
+ res = forward_propagate_addr_into_variable_array_index (offset_stmt,
def_rhs, use_stmt);
return res;
}
{
bool res;
tree offset_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
- res = forward_propagate_addr_into_variable_array_index (offset_stmt, lhs,
+ res = forward_propagate_addr_into_variable_array_index (offset_stmt,
def_rhs, use_stmt);
return res;
}