Commit 56010684 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/80112 (ICE in doloop_condition_get at loop-doloop.c:158)

	PR rtl-optimization/80112
	* loop-doloop.c (doloop_condition_get): Don't check condition
	if cmp isn't SET with IF_THEN_ELSE src.

	* gcc.dg/pr80112.c: New test.

From-SVN: r246441
parent f0d7b52d
2017-03-24 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/80112
* loop-doloop.c (doloop_condition_get): Don't check condition
if cmp isn't SET with IF_THEN_ELSE src.
2017-03-24 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/80158
......
......@@ -153,10 +153,13 @@ doloop_condition_get (rtx_insn *doloop_pat)
}
else
inc = PATTERN (prev_insn);
/* We expect the condition to be of the form (reg != 0) */
cond = XEXP (SET_SRC (cmp), 0);
if (GET_CODE (cond) != NE || XEXP (cond, 1) != const0_rtx)
return 0;
if (GET_CODE (cmp) == SET && GET_CODE (SET_SRC (cmp)) == IF_THEN_ELSE)
{
/* We expect the condition to be of the form (reg != 0) */
cond = XEXP (SET_SRC (cmp), 0);
if (GET_CODE (cond) != NE || XEXP (cond, 1) != const0_rtx)
return 0;
}
}
else
{
......
2017-03-24 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/80112
* gcc.dg/pr80112.c: New test.
2017-03-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* c-c++-common/Wimplicit-fallthrough-7.c: Adjust dg-warning
......
/* PR rtl-optimization/80112 */
/* { dg-do compile } */
/* { dg-options "-Os -fmodulo-sched" } */
void **a;
void
foo (int c)
{
void *d[] = {&&e, &&f};
a = d;
switch (c)
{
f:
c = 9;
/* FALLTHRU */
case 9:
goto *a++;
e:;
}
}
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