]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stmt.c (expand_value_return): Correctly convert VAL when promoting function return.
authorRichard Henderson <rth@cygnus.com>
Fri, 7 Jan 2000 22:41:20 +0000 (14:41 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 7 Jan 2000 22:41:20 +0000 (14:41 -0800)
        Thu Oct 28 18:06:50 1999  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
        * stmt.c (expand_value_return): Correctly convert VAL when promoting
        function return.

From-SVN: r31280

gcc/ChangeLog
gcc/stmt.c

index 80461a63b529303c9e7f1035d23be888961aa27f..0e16003b5378d834824af744f8bf007d2b1c06bf 100644 (file)
@@ -1,3 +1,9 @@
+Fri Jan  7 14:40:05 2000  Richard Henderson  <rth@cygnus.com>
+
+       Thu Oct 28 18:06:50 1999  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+        * stmt.c (expand_value_return): Correctly convert VAL when promoting
+       function return.
+
 Tue Jan  4 02:22:27 2000  Jeffrey A Law  (law@cygnus.com)
 
        Mon Oct 18 18:50:51 1999  Andreas Schwab  <schwab@suse.de>
index 018e1907b7c9b9cc772dee751914cd9d56704a91..f55b2c955ded5b9f3bdb9b384c7c5e23094aa940 100644 (file)
@@ -2511,15 +2511,15 @@ expand_value_return (val)
 #ifdef PROMOTE_FUNCTION_RETURN
       tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
       int unsignedp = TREE_UNSIGNED (type);
+      enum machine_mode old_mode
+       = DECL_MODE (DECL_RESULT (current_function_decl));
       enum machine_mode mode
-       = promote_mode (type, DECL_MODE (DECL_RESULT (current_function_decl)),
-                       &unsignedp, 1);
+       = promote_mode (type, old_mode, &unsignedp, 1);
 
-      if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
-       convert_move (return_reg, val, unsignedp);
-      else
+      if (mode != old_mode)
+       val = convert_modes (mode, old_mode, val, unsignedp);
 #endif
-       emit_move_insn (return_reg, val);
+      emit_move_insn (return_reg, val);
     }
   if (GET_CODE (return_reg) == REG
       && REGNO (return_reg) < FIRST_PSEUDO_REGISTER)