summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sink.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-02-10 16:22:29 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-02-10 16:22:29 +0000
commite15deb4b329bf724d50139ade9b5a0e9b152b130 (patch)
treeeb1fb857e229b58695341024ec649f95610b921f /gcc/tree-ssa-sink.c
parenta9c1f295d9e02e5d7ccb174df7223b9deeefbb99 (diff)
downloadgcc-e15deb4b329bf724d50139ade9b5a0e9b152b130.tar.gz
PR target/39139
* function.h (struct function): Add has_local_explicit_reg_vars bit. * gimplify.c (gimplify_bind_expr): Set it if local DECL_HARD_REGISTER VAR_DECLs were seen. * tree-ssa-live.c (remove_unused_locals): Recompute cfun->has_local_explicit_reg_vars. * tree-ssa-sink.c (statement_sink_location): Don't sink BLKmode copies or clearings if cfun->has_local_explicit_reg_vars. * gcc.target/i386/pr39139.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144065 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r--gcc/tree-ssa-sink.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index e56cce0edb1..82a027da049 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -1,5 +1,6 @@
/* Code sinking for trees
- Copyright (C) 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2007, 2009
+ Free Software Foundation, Inc.
Contributed by Daniel Berlin <dan@dberlin.org>
This file is part of GCC.
@@ -301,7 +302,12 @@ statement_sink_location (gimple stmt, basic_block frombb,
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);
@@ -311,7 +317,9 @@ statement_sink_location (gimple stmt, basic_block frombb,
|| code == FILTER_EXPR
|| is_hidden_global_store (stmt)
|| gimple_has_volatile_ops (stmt)
- || !ZERO_SSA_OPERANDS (stmt, SSA_OP_VUSE))
+ || !ZERO_SSA_OPERANDS (stmt, SSA_OP_VUSE)
+ || (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)