diff options
Diffstat (limited to 'gcc/tree-ssa-ter.c')
-rw-r--r-- | gcc/tree-ssa-ter.c | 6 |
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) { |