Commit 28612f9e by Richard Kenner

(expand_value_return, expand_decl): Use promote_mode.

From-SVN: r7070
parent 78911e8b
...@@ -2655,17 +2655,11 @@ expand_value_return (val) ...@@ -2655,17 +2655,11 @@ expand_value_return (val)
if (return_reg != val) if (return_reg != val)
{ {
#ifdef PROMOTE_FUNCTION_RETURN #ifdef PROMOTE_FUNCTION_RETURN
enum machine_mode mode = DECL_MODE (DECL_RESULT (current_function_decl));
tree type = TREE_TYPE (DECL_RESULT (current_function_decl)); tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
int unsignedp = TREE_UNSIGNED (type); int unsignedp = TREE_UNSIGNED (type);
enum machine_mode mode
if (TREE_CODE (type) == INTEGER_TYPE || TREE_CODE (type) == ENUMERAL_TYPE = promote_mode (type, DECL_MODE (DECL_RESULT (current_function_decl)),
|| TREE_CODE (type) == BOOLEAN_TYPE || TREE_CODE (type) == CHAR_TYPE &unsignedp, 1);
|| TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == POINTER_TYPE
|| TREE_CODE (type) == OFFSET_TYPE)
{
PROMOTE_MODE (mode, unsignedp, type);
}
if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode) if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
convert_move (return_reg, val, unsignedp); convert_move (return_reg, val, unsignedp);
...@@ -3406,16 +3400,9 @@ expand_decl (decl) ...@@ -3406,16 +3400,9 @@ expand_decl (decl)
&& (DECL_REGISTER (decl) || ! obey_regdecls)) && (DECL_REGISTER (decl) || ! obey_regdecls))
{ {
/* Automatic variable that can go in a register. */ /* Automatic variable that can go in a register. */
enum machine_mode reg_mode = DECL_MODE (decl);
int unsignedp = TREE_UNSIGNED (type); int unsignedp = TREE_UNSIGNED (type);
enum machine_mode reg_mode
if (TREE_CODE (type) == INTEGER_TYPE || TREE_CODE (type) == ENUMERAL_TYPE = promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
|| TREE_CODE (type) == BOOLEAN_TYPE || TREE_CODE (type) == CHAR_TYPE
|| TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == POINTER_TYPE
|| TREE_CODE (type) == OFFSET_TYPE)
{
PROMOTE_MODE (reg_mode, unsignedp, type);
}
if (TREE_CODE (type) == COMPLEX_TYPE) if (TREE_CODE (type) == COMPLEX_TYPE)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment