a-clrefi.adb, [...]: New files
[gcc.git] / gcc / tree-ssa-ter.c
index d549ed43461752dc42b461fd7eab793dd112f1fd..c6b7ab39dce29f5ef86d6da8e0e380d307f1b0c3 100644 (file)
@@ -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)
     {
@@ -402,7 +408,7 @@ is_replaceable_p (tree stmt)
        return false;
     }
 
-  /* Leave any stmt with voltile operands alone as well.  */
+  /* Leave any stmt with volatile operands alone as well.  */
   if (stmt_ann (stmt)->has_volatile_ops)
     return false;