summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ter.c
diff options
context:
space:
mode:
authorshinwell <shinwell@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-08 08:33:42 +0000
committershinwell <shinwell@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-08 08:33:42 +0000
commitdac21d574a4bafb500582fc847f4c3e7d781f3ba (patch)
tree86d028c760c73cbf43467080ea39ca9e8bbad562 /gcc/tree-ssa-ter.c
parent41a87cb41b7102cf35ddb6e4fe40896471bf3226 (diff)
downloadgcc-dac21d574a4bafb500582fc847f4c3e7d781f3ba.tar.gz
PR tree-optimization/29877
gcc/ * tree-ssa-ter.c (is_replaceable_p): Deem assignments with a register variable on the RHS to not be replaceable. gcc/testsuite/ * gcc.dg/pr16194.c: Skip test entirely if we don't know the name of a hard register for the target concerned. Adjust dg-error directives to cope with new behaviour of TER. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120571 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ter.c')
-rw-r--r--gcc/tree-ssa-ter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index ca67f91e66e..c6b7ab39dce 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -393,6 +393,12 @@ is_replaceable_p (tree stmt)
&& FLOAT_TYPE_P (TREE_TYPE (GENERIC_TREE_OPERAND (stmt, 1))))
return false;
+ /* An assignment with a register variable on the RHS is not
+ replaceable. */
+ if (TREE_CODE (GENERIC_TREE_OPERAND (stmt, 1)) == VAR_DECL
+ && DECL_HARD_REGISTER (GENERIC_TREE_OPERAND (stmt, 1)))
+ return false;
+
/* Calls to functions with side-effects cannot be replaced. */
if ((call_expr = get_call_expr_in (stmt)) != NULL_TREE)
{