+2011-06-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/49539
+ * tree-ssa-forwprop.c (can_propagate_from): Check for abnormal SSA
+ names by means of stmt_references_abnormal_ssa_name.
+ (associate_plusminus): Call can_propagate_from before propagating
+ from definition statements.
+ (ssa_forward_propagate_and_combine): Remove superfluous newline.
+
2011-06-29 Richard Guenther <rguenther@suse.de>
* doc/invoke.texi: Document -scev dump modifier.
2011-06-20 Changpeng Fang <changpeng.fang@amd.com>
- PR i386/49089
+ PR target/49089
* config/i386/i386.c (avx256_split_unaligned_load): New definition.
(avx256_split_unaligned_store): New definition.
(ix86_option_override_internal): Enable avx256 unaligned load/store
static bool
can_propagate_from (gimple def_stmt)
{
- use_operand_p use_p;
- ssa_op_iter iter;
-
gcc_assert (is_gimple_assign (def_stmt));
/* If the rhs has side-effects we cannot propagate from it. */
return true;
/* We cannot propagate ssa names that occur in abnormal phi nodes. */
- FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_USE)
- if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (USE_FROM_PTR (use_p)))
- return false;
+ if (stmt_references_abnormal_ssa_name (def_stmt))
+ return false;
/* If the definition is a conversion of a pointer to a function type,
then we can not apply optimizations as some targets require
{
gimple def_stmt = SSA_NAME_DEF_STMT (rhs2);
if (is_gimple_assign (def_stmt)
- && gimple_assign_rhs_code (def_stmt) == NEGATE_EXPR)
+ && gimple_assign_rhs_code (def_stmt) == NEGATE_EXPR
+ && can_propagate_from (def_stmt))
{
code = (code == MINUS_EXPR) ? PLUS_EXPR : MINUS_EXPR;
gimple_assign_set_rhs_code (stmt, code);
{
gimple def_stmt = SSA_NAME_DEF_STMT (rhs1);
if (is_gimple_assign (def_stmt)
- && gimple_assign_rhs_code (def_stmt) == NEGATE_EXPR)
+ && gimple_assign_rhs_code (def_stmt) == NEGATE_EXPR
+ && can_propagate_from (def_stmt))
{
code = MINUS_EXPR;
gimple_assign_set_rhs_code (stmt, code);
if (TREE_CODE (rhs1) == SSA_NAME)
{
gimple def_stmt = SSA_NAME_DEF_STMT (rhs1);
- if (is_gimple_assign (def_stmt))
+ if (is_gimple_assign (def_stmt) && can_propagate_from (def_stmt))
{
enum tree_code def_code = gimple_assign_rhs_code (def_stmt);
if (def_code == PLUS_EXPR
if (rhs2 && TREE_CODE (rhs2) == SSA_NAME)
{
gimple def_stmt = SSA_NAME_DEF_STMT (rhs2);
- if (is_gimple_assign (def_stmt))
+ if (is_gimple_assign (def_stmt) && can_propagate_from (def_stmt))
{
enum tree_code def_code = gimple_assign_rhs_code (def_stmt);
if (def_code == PLUS_EXPR
else
gsi_next (&gsi);
}
- else if (code == POINTER_PLUS_EXPR
- && can_propagate_from (stmt))
+ else if (code == POINTER_PLUS_EXPR && can_propagate_from (stmt))
{
if (TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST
/* ??? Better adjust the interface to that function