/* Code sinking for trees
- Copyright (C) 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008, 2009
+ Free Software Foundation, Inc.
Contributed by Daniel Berlin <dan@dberlin.org>
This file is part of GCC.
/* Check virtual definitions. If we get here, the only virtual
definitions we should see are those generated by assignment or call
statements. */
- if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_VIRTUAL_DEFS))
+ if (gimple_vdef (stmt))
{
tree lhs;
}
else if (INDIRECT_REF_P (lhs))
- return may_point_to_global_var (TREE_OPERAND (lhs, 0));
+ return ptr_deref_may_alias_global_p (TREE_OPERAND (lhs, 0));
else
gcc_unreachable ();
}
We can't sink statements that have volatile operands.
We don't want to sink dead code, so anything with 0 immediate uses is not
- sunk.
+ sunk.
+
+ Don't sink BLKmode assignments if current function has any local explicit
+ register variables, as BLKmode assignments may involve memcpy or memset
+ calls or, on some targets, inline expansion thereof that sometimes need
+ to use specific hard registers.
*/
code = gimple_assign_rhs_code (stmt);
|| code == FILTER_EXPR
|| is_hidden_global_store (stmt)
|| gimple_has_volatile_ops (stmt)
- || !ZERO_SSA_OPERANDS (stmt, SSA_OP_VUSE))
+ || gimple_vuse (stmt)
+ || (cfun->has_local_explicit_reg_vars
+ && TYPE_MODE (TREE_TYPE (gimple_assign_lhs (stmt))) == BLKmode))
return false;
FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)