Commit f778dd4d by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/57251 (ICE in optab_handler, at optabs.h:258)

	PR middle-end/57251
	* expr.c (expand_expr_real_2) <case WIDEN_MULT_EXPR>: Handle
	the case when both op0 and op1 have VOIDmode.

	* gcc.dg/torture/pr57251.c: New test.

From-SVN: r198860
parent bad4df9b
2013-05-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/57251
* expr.c (expand_expr_real_2) <case WIDEN_MULT_EXPR>: Handle
the case when both op0 and op1 have VOIDmode.
2013-05-14 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
* config/rl78/rl78.md(mulsi3_g13): Add additional 'nop' required
......
......@@ -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);
......
2013-05-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/57251
* gcc.dg/torture/pr57251.c: New test.
2013-05-13 Uros Bizjak <ubizjak@gmail.com>
PR target/57264
......
/* PR middle-end/57251 */
/* { dg-do compile } */
/* { dg-options "-ftracer" } */
short a, b;
int
f (void)
{
long long i = 2;
a ? f () ? : 0 : b--;
b &= i *= a |= 0;
}
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