re PR rtl-optimization/71916 (ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start")

PR rtl-optimization/71916
	* cfgrtl.c (contains_no_active_insn_p): Return false also for
	bb which have a single succ fake edge.

	* gcc.c-torture/compile/pr71916.c: New test.

From-SVN: r238490
This commit is contained in:
Jakub Jelinek 2016-07-19 21:54:49 +02:00 committed by Jakub Jelinek
parent f36a3ff7f7
commit 4833f5615e
4 changed files with 49 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2016-07-19 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/71916
* cfgrtl.c (contains_no_active_insn_p): Return false also for
bb which have a single succ fake edge.
2016-07-19 Aldy Hernandez <aldyh@redhat.com>
PR debug/71855

View File

@ -574,8 +574,10 @@ contains_no_active_insn_p (const_basic_block bb)
{
rtx_insn *insn;
if (bb == EXIT_BLOCK_PTR_FOR_FN (cfun) || bb == ENTRY_BLOCK_PTR_FOR_FN (cfun)
|| !single_succ_p (bb))
if (bb == EXIT_BLOCK_PTR_FOR_FN (cfun)
|| bb == ENTRY_BLOCK_PTR_FOR_FN (cfun)
|| !single_succ_p (bb)
|| (single_succ_edge (bb)->flags & EDGE_FAKE) != 0)
return false;
for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn))

View File

@ -1,5 +1,8 @@
2016-07-19 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/71916
* gcc.c-torture/compile/pr71916.c: New test.
PR middle-end/71874
* g++.dg/torture/pr71874.C: New test.

View File

@ -0,0 +1,36 @@
/* PR rtl-optimization/71916 */
int a, b, c, d, f, g;
short h;
short
foo (short p1)
{
return a >= 2 || p1 > 7 >> a ? p1 : p1 << a;
}
void
bar (void)
{
for (;;)
{
int i, j[3];
h = b >= 2 ? d : d >> b;
if (foo (f > h ^ c))
{
d = 0;
while (f <= 2)
{
char k[2];
for (;;)
k[i++] = 7;
}
}
else
for (;;)
g = j[2];
if (g)
for (;;)
;
}
}