Commit a2998ed1 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/82875 (ICE at -Os on valid code on x86_64-linux-gnu: in…

re PR middle-end/82875 (ICE at -Os on valid code on x86_64-linux-gnu: in find_widening_optab_handler_and_mode, at optabs-query.c:414)

	PR middle-end/82875
	* optabs.c (expand_doubleword_mult, expand_binop): Before calling
	expand_binop with *mul_widen_optab, make sure at least one of the
	operands doesn't have VOIDmode.

	* gcc.dg/pr82875.c: New test.
	* gcc.c-torture/compile/pr82875.c: New test.

From-SVN: r255050
parent 0a770b59
2017-11-22 Jakub Jelinek <jakub@redhat.com>
PR middle-end/82875
* optabs.c (expand_doubleword_mult, expand_binop): Before calling
expand_binop with *mul_widen_optab, make sure at least one of the
operands doesn't have VOIDmode.
PR debug/83034
* dwarf2out.c (mem_loc_descriptor): Handle VEC_SERIES.
......@@ -861,6 +861,11 @@ expand_doubleword_mult (machine_mode mode, rtx op0, rtx op1, rtx target,
if (target && !REG_P (target))
target = NULL_RTX;
/* *_widen_optab needs to determine operand mode, make sure at least
one operand has non-VOID mode. */
if (GET_MODE (op0_low) == VOIDmode && GET_MODE (op1_low) == VOIDmode)
op0_low = force_reg (word_mode, op0_low);
if (umulp)
product = expand_binop (mode, umul_widen_optab, op0_low, op1_low,
target, 1, OPTAB_DIRECT);
......@@ -1199,6 +1204,10 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1,
: smul_widen_optab),
wider_mode, mode) != CODE_FOR_nothing))
{
/* *_widen_optab needs to determine operand mode, make sure at least
one operand has non-VOID mode. */
if (GET_MODE (op0) == VOIDmode && GET_MODE (op1) == VOIDmode)
op0 = force_reg (mode, op0);
temp = expand_binop (wider_mode,
unsignedp ? umul_widen_optab : smul_widen_optab,
op0, op1, NULL_RTX, unsignedp, OPTAB_DIRECT);
......
2017-11-22 Jakub Jelinek <jakub@redhat.com>
PR middle-end/82875
* gcc.dg/pr82875.c: New test.
* gcc.c-torture/compile/pr82875.c: New test.
2017-11-22 Jakub Jelinek <jakub@redhat.com>
PR debug/83034
* gcc.dg/pr83034.c: New test.
......
/* PR middle-end/82875 */
signed char a;
unsigned b;
long c, d;
long long e;
void
foo (void)
{
short f = a = 6;
while (0)
while (a <= 7)
{
for (;;)
;
lab:
while (c <= 73)
;
e = 20;
d ? (a %= c) * (e *= a ? f : b) : 0;
}
goto lab;
}
/* PR middle-end/82875 */
/* { dg-do compile } */
/* { dg-options "-ftree-ter" } */
const int a = 100;
void
foo (void)
{
int c[a];
}
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