aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-10-10 17:06:36 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-10-10 17:06:36 -0400
commit1ad87b632908569ce4b8d01633cebf70b27a9cbe (patch)
tree12389da3406cefee37acb895335903a640d3953b /gcc
parentabaa26e5b4a995988c18a3d22fbaf77526c7c424 (diff)
downloadgcc-1ad87b632908569ce4b8d01633cebf70b27a9cbe.zip
gcc-1ad87b632908569ce4b8d01633cebf70b27a9cbe.tar.gz
gcc-1ad87b632908569ce4b8d01633cebf70b27a9cbe.tar.bz2
(expand_assignment): Don't short circuit store_expr when TO is a
VAR_DECL since it needs special handling if promoted. From-SVN: r5712
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 91b2d6e..8665f5d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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;