OSDN Git Service

(expand_assignment): Don't short circuit store_expr when TO is a
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 Oct 1993 21:06:36 +0000 (21:06 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 10 Oct 1993 21:06:36 +0000 (21:06 +0000)
VAR_DECL since it needs special handling if promoted.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5712 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/expr.c

index 91b2d6e..8665f5d 100644 (file)
@@ -2399,8 +2399,14 @@ expand_assignment (to, from, want_value, suggest_reg)
      call the function before we start to compute the lhs.
      This is needed for correct code for cases such as
      val = setjmp (buf) on machines where reference to val
-     requires loading up part of an address in a separate insn.  */
-  if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from))
+     requires loading up part of an address in a separate insn.
+
+     Don't do this if TO is a VAR_DECL whose DECL_RTL is REG since it might be
+     a promoted variable where the zero- or sign- extension needs to be done.
+     Handling this in the normal way is safe because no computation is done
+     before the call.  */
+  if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from)
+      && ! (TREE_CODE (to) == VAR_DECL && GET_CODE (DECL_RTL (to)) == REG))
     {
       rtx value;