aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-04-18 14:53:01 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-04-18 14:53:01 -0400
commit28612f9eb6f0aa1a5e441a1c42bc261a08c3d7e2 (patch)
treec77a91be6174b5cdebd7d048be438d5e3e002d4d
parent78911e8b93e43c3fb9bb40d5292abe6d92aa2cb8 (diff)
downloadgcc-28612f9eb6f0aa1a5e441a1c42bc261a08c3d7e2.zip
gcc-28612f9eb6f0aa1a5e441a1c42bc261a08c3d7e2.tar.gz
gcc-28612f9eb6f0aa1a5e441a1c42bc261a08c3d7e2.tar.bz2
(expand_value_return, expand_decl): Use promote_mode.
From-SVN: r7070
-rw-r--r--gcc/stmt.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 8303c35..cac0a66 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2655,17 +2655,11 @@ expand_value_return (val)
if (return_reg != val)
{
#ifdef PROMOTE_FUNCTION_RETURN
- enum machine_mode mode = DECL_MODE (DECL_RESULT (current_function_decl));
tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
int unsignedp = TREE_UNSIGNED (type);
-
- if (TREE_CODE (type) == INTEGER_TYPE || TREE_CODE (type) == ENUMERAL_TYPE
- || 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 (mode, unsignedp, type);
- }
+ enum machine_mode mode
+ = promote_mode (type, DECL_MODE (DECL_RESULT (current_function_decl)),
+ &unsignedp, 1);
if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
convert_move (return_reg, val, unsignedp);
@@ -3406,16 +3400,9 @@ expand_decl (decl)
&& (DECL_REGISTER (decl) || ! obey_regdecls))
{
/* Automatic variable that can go in a register. */
- enum machine_mode reg_mode = DECL_MODE (decl);
int unsignedp = TREE_UNSIGNED (type);
-
- if (TREE_CODE (type) == INTEGER_TYPE || TREE_CODE (type) == ENUMERAL_TYPE
- || 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);
- }
+ enum machine_mode reg_mode
+ = promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
if (TREE_CODE (type) == COMPLEX_TYPE)
{