]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix for abort when PROMOTE_MODES defined but PROMOTE_FUNCTION_{ARG,RETURN} not.
authorJim Wilson <wilson@cygnus.com>
Tue, 22 Jun 1999 14:39:07 +0000 (14:39 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 22 Jun 1999 14:39:07 +0000 (07:39 -0700)
* expr.c (store_expr): When target is a promoted subreg, return a
promoted subreg as a result.

From-SVN: r27705

gcc/ChangeLog
gcc/expr.c

index 7a2612882138837c94b17cd2191a79332816dbf4..b83b411a8d3c6a62443c4cc6bf4723d59279697f 100644 (file)
@@ -1,3 +1,8 @@
+1999-06-22  Jim Wilson  <wilson@cygnus.com>
+
+       * expr.c (store_expr): When target is a promoted subreg, return a
+       promoted subreg as a result.
+
 Tue Jun 22 17:14:58 1999  Michael Meissner  <meissner@cygnus.com>
 
        * dwarf2out.c (dwarf2out_frame_debug_expr): Reformat to match GNU
index e5ef6e1ec880576a948ff512d756af8a52a474bc..dc9bca518ea0684f1728bbac2f865a37a3de2ac9 100644 (file)
@@ -3652,6 +3652,20 @@ store_expr (exp, target, want_value)
 
       convert_move (SUBREG_REG (target), temp,
                    SUBREG_PROMOTED_UNSIGNED_P (target));
+
+      /* If we promoted a constant, change the mode back down to match
+        target.  Otherwise, the caller might get confused by a result whose
+        mode is larger than expected.  */
+
+      if (want_value && GET_MODE (temp) != GET_MODE (target)
+         && GET_MODE (temp) != VOIDmode)
+       {
+         temp = gen_rtx_SUBREG (GET_MODE (target), temp, 0);
+         SUBREG_PROMOTED_VAR_P (temp) = 1;
+         SUBREG_PROMOTED_UNSIGNED_P (temp)
+           = SUBREG_PROMOTED_UNSIGNED_P (target);
+       }
+
       return want_value ? temp : NULL_RTX;
     }
   else