calls.c (emit_library_call_value_1): If PROMOTE_MODE modifed the result mode of the libcall, convert back to outmode.

* calls.c (emit_library_call_value_1): If PROMOTE_MODE modifed the
        result mode of the libcall, convert back to outmode.

From-SVN: r121852
This commit is contained in:
Richard Henderson 2007-02-12 10:46:16 -08:00 committed by Richard Henderson
parent d8d25baea6
commit 7ab0aca2fe
2 changed files with 23 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2007-02-12 Richard Henderson <rth@redhat.com>
* calls.c (emit_library_call_value_1): If PROMOTE_MODE modifed the
result mode of the libcall, convert back to outmode.
2007-02-12 Roger Sayle <roger@eyesopen.com>
* config/i386/i386.md (*bswapdi2_rex): Renamed from bswapdi2.

View File

@ -3916,10 +3916,25 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
value = gen_reg_rtx (outmode);
emit_group_store (value, valreg, NULL_TREE, GET_MODE_SIZE (outmode));
}
else if (value != 0)
emit_move_insn (value, valreg);
else
value = valreg;
{
/* Convert to the proper mode if PROMOTE_MODE has been active. */
if (GET_MODE (valreg) != outmode)
{
int unsignedp = TYPE_UNSIGNED (tfom);
gcc_assert (targetm.calls.promote_function_return (tfom));
gcc_assert (promote_mode (tfom, outmode, &unsignedp, 0)
== GET_MODE (valreg));
valreg = convert_modes (outmode, GET_MODE (valreg), valreg, 0);
}
if (value != 0)
emit_move_insn (value, valreg);
else
value = valreg;
}
}
if (ACCUMULATE_OUTGOING_ARGS)