From 691073076ba2bdceb294db095293a0453489ab0f Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 12 Apr 2001 03:41:36 +0000 Subject: expmed.c (store_bit_field): Truncate CONST_INTs. * expmed.c (store_bit_field): Truncate CONST_INTs. (expand_mult_highpart, expand_divmod): Likewise. * expr.c (convert_modes, store_field): Likewise. * integrate.c (expand_inline_function): Use promote_mode() to determine whether to convert_modes() an argument as signed or unsigned. * optabs.c (expand_binop): Get CONST_INT operands sign-extended for their appropriate modes. * stmt.c (emit_case_nodes): Convert node values to the appropriate mode. (expand_end_case): Convert minval and range to the appropriate mode. * unroll.c (loop_iterations): Truncate abs_diff to the mode of the iteration variable. * varasm.c (immed_double_const): Don't require words to be narrower than host wide ints to properly sign-extend CONST_INTs. From-SVN: r41285 --- gcc/integrate.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'gcc/integrate.c') diff --git a/gcc/integrate.c b/gcc/integrate.c index 327e8fa..1955c05 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -702,13 +702,24 @@ expand_inline_function (fndecl, parms, target, ignore, type, else if (GET_CODE (loc) != MEM) { if (GET_MODE (loc) != TYPE_MODE (TREE_TYPE (arg))) - /* The mode if LOC and ARG can differ if LOC was a variable - that had its mode promoted via PROMOTED_MODE. */ - arg_vals[i] = convert_modes (GET_MODE (loc), - TYPE_MODE (TREE_TYPE (arg)), - expand_expr (arg, NULL_RTX, mode, - EXPAND_SUM), - TREE_UNSIGNED (TREE_TYPE (formal))); + { + int unsignedp = TREE_UNSIGNED (TREE_TYPE (formal)); + enum machine_mode pmode = TYPE_MODE (TREE_TYPE (formal)); + + pmode = promote_mode (TREE_TYPE (formal), pmode, + &unsignedp, 0); + + if (GET_MODE (loc) != pmode) + abort (); + + /* The mode if LOC and ARG can differ if LOC was a variable + that had its mode promoted via PROMOTED_MODE. */ + arg_vals[i] = convert_modes (pmode, + TYPE_MODE (TREE_TYPE (arg)), + expand_expr (arg, NULL_RTX, mode, + EXPAND_SUM), + unsignedp); + } else arg_vals[i] = expand_expr (arg, NULL_RTX, mode, EXPAND_SUM); } -- cgit v1.1