diff options
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -8390,6 +8390,15 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, else expand_operands (treeop0, treeop1, NULL_RTX, &op1, &op0, EXPAND_NORMAL); + /* op0 and op1 might still be constant, despite the above + != INTEGER_CST check. Handle it. */ + if (GET_MODE (op0) == VOIDmode && GET_MODE (op1) == VOIDmode) + { + op0 = convert_modes (innermode, mode, op0, true); + op1 = convert_modes (innermode, mode, op1, false); + return REDUCE_BIT_FIELD (expand_mult (mode, op0, op1, + target, unsignedp)); + } goto binop3; } } @@ -8412,6 +8421,19 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, { expand_operands (treeop0, treeop1, NULL_RTX, &op0, &op1, EXPAND_NORMAL); + /* op0 and op1 might still be constant, despite the above + != INTEGER_CST check. Handle it. */ + if (GET_MODE (op0) == VOIDmode && GET_MODE (op1) == VOIDmode) + { + widen_mult_const: + op0 = convert_modes (innermode, mode, op0, zextend_p); + op1 + = convert_modes (innermode, mode, op1, + TYPE_UNSIGNED (TREE_TYPE (treeop1))); + return REDUCE_BIT_FIELD (expand_mult (mode, op0, op1, + target, + unsignedp)); + } temp = expand_widening_mult (mode, op0, op1, target, unsignedp, this_optab); return REDUCE_BIT_FIELD (temp); @@ -8424,9 +8446,14 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, op0 = expand_normal (treeop0); if (TREE_CODE (treeop1) == INTEGER_CST) op1 = convert_modes (innermode, mode, - expand_normal (treeop1), unsignedp); + expand_normal (treeop1), + TYPE_UNSIGNED (TREE_TYPE (treeop1))); else op1 = expand_normal (treeop1); + /* op0 and op1 might still be constant, despite the above + != INTEGER_CST check. Handle it. */ + if (GET_MODE (op0) == VOIDmode && GET_MODE (op1) == VOIDmode) + goto widen_mult_const; temp = expand_binop (mode, other_optab, op0, op1, target, unsignedp, OPTAB_LIB_WIDEN); hipart = gen_highpart (innermode, temp); |