From 78911e8b93e43c3fb9bb40d5292abe6d92aa2cb8 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 18 Apr 1994 14:52:26 -0400 Subject: [PATCH] (expand_expr, case VAR_DECL, SAVE_EXPR): Use promote_mode. From-SVN: r7069 --- gcc/expr.c | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/gcc/expr.c b/gcc/expr.c index f8531ff8de0..ae23c94577e 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -3829,14 +3829,10 @@ expand_expr (exp, target, tmode, modifier) if (GET_CODE (DECL_RTL (exp)) == REG && GET_MODE (DECL_RTL (exp)) != mode) { - enum machine_mode decl_mode = DECL_MODE (exp); - /* Get the signedness used for this variable. Ensure we get the same mode we got when the variable was declared. */ - - PROMOTE_MODE (decl_mode, unsignedp, type); - - if (decl_mode != GET_MODE (DECL_RTL (exp))) + if (GET_MODE (DECL_RTL (exp)) + != promote_mode (type, DECL_MODE (exp), &unsignedp, 0)) abort (); temp = gen_rtx (SUBREG, mode, DECL_RTL (exp), 0); @@ -3924,22 +3920,7 @@ expand_expr (exp, target, tmode, modifier) || TREE_CODE (type) == ARRAY_TYPE); } else - { - enum machine_mode var_mode = mode; - - 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 (var_mode, unsignedp, type); - } - - temp = gen_reg_rtx (var_mode); - } + temp = gen_reg_rtx (promote_mode (type, mode, &unsignedp, 0)); SAVE_EXPR_RTL (exp) = temp; if (!optimize && GET_CODE (temp) == REG) @@ -3969,20 +3950,8 @@ expand_expr (exp, target, tmode, modifier) if (GET_CODE (SAVE_EXPR_RTL (exp)) == REG && GET_MODE (SAVE_EXPR_RTL (exp)) != mode) { - enum machine_mode var_mode = mode; - - 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 (var_mode, unsignedp, type); - } - - temp = gen_rtx (SUBREG, mode, SAVE_EXPR_RTL (exp), 0); + temp = gen_rtx (SUBREG, promote_mode (type, mode, &unsignedp, 0), + SAVE_EXPR_RTL (exp), 0); SUBREG_PROMOTED_VAR_P (temp) = 1; SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp; return temp; -- 2.30.2