From: Richard Henderson Date: Fri, 7 Jan 2000 22:41:20 +0000 (-0800) Subject: stmt.c (expand_value_return): Correctly convert VAL when promoting function return. X-Git-Tag: prereleases/gcc-2.95.3-test1~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5b3b78ef74b453c1b72bd3ad6db37e884b30eb5;p=thirdparty%2Fgcc.git stmt.c (expand_value_return): Correctly convert VAL when promoting function return. Thu Oct 28 18:06:50 1999 Richard Kenner * stmt.c (expand_value_return): Correctly convert VAL when promoting function return. From-SVN: r31280 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80461a63b529..0e16003b5378 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Fri Jan 7 14:40:05 2000 Richard Henderson + + Thu Oct 28 18:06:50 1999 Richard Kenner + * 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 diff --git a/gcc/stmt.c b/gcc/stmt.c index 018e1907b7c9..f55b2c955ded 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -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)