(expand_assignment): If FROM is scalar function call,

expand_expr FROM before TO.

From-SVN: r4759
This commit is contained in:
Richard Stallman 1993-06-26 20:45:13 +00:00
parent fff26804c9
commit cd1db1088e
1 changed files with 16 additions and 0 deletions

View File

@ -2205,6 +2205,22 @@ expand_assignment (to, from, want_value, suggest_reg)
: result);
}
/* If the rhs is a function call and its value is not an aggregate,
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))
{
rtx value = expand_expr (from, NULL_RTX, VOIDmode, 0);
if (to_rtx == 0)
to_rtx = expand_expr (to, NULL_RTX, VOIDmode, 0);
emit_move_insn (to_rtx, value);
preserve_temp_slots (to_rtx);
free_temp_slots ();
return to_rtx;
}
/* Ordinary treatment. Expand TO to get a REG or MEM rtx.
Don't re-expand if it was expanded already (in COMPONENT_REF case). */