Commit 44ab146a by Richard Biener Committed by Richard Biener

re PR tree-optimization/70986 (ICE on valid code at -O3 on x86_64-linux-gnu in…

re PR tree-optimization/70986 (ICE on valid code at -O3 on x86_64-linux-gnu in combine_blocks, at tree-if-conv.c:2219)

2016-05-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/70986
	* cfganal.c: Include cfgloop.h.
	(dfs_find_deadend): Prefer to take edges exiting loops.

	* gcc.dg/torture/pr70986-1.c: New testcase.
	* gcc.dg/torture/pr70986-2.c: Likewise.
	* gcc.dg/torture/pr70986-3.c: Likewise.

From-SVN: r236158
parent b5aa474d
2016-05-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/70986
* cfganal.c: Include cfgloop.h.
(dfs_find_deadend): Prefer to take edges exiting loops.
2016-05-11 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/pr70963.c: Require at least power8 at both
......
......@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfghooks.h"
#include "timevar.h"
#include "cfganal.h"
#include "cfgloop.h"
/* Store the data structures necessary for depth-first search. */
struct depth_first_search_ds {
......@@ -747,7 +748,21 @@ dfs_find_deadend (basic_block bb)
return bb;
}
bb = EDGE_SUCC (bb, 0)->dest;
/* If we are in an analyzed cycle make sure to try exiting it.
Note this is a heuristic only and expected to work when loop
fixup is needed as well. */
if (! bb->loop_father
|| ! loop_outer (bb->loop_father))
bb = EDGE_SUCC (bb, 0)->dest;
else
{
edge_iterator ei;
edge e;
FOR_EACH_EDGE (e, ei, bb->succs)
if (loop_exit_edge_p (bb->loop_father, e))
break;
bb = e ? e->dest : EDGE_SUCC (bb, 0)->dest;
}
}
gcc_unreachable ();
......
2016-05-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/70986
* gcc.dg/torture/pr70986-1.c: New testcase.
* gcc.dg/torture/pr70986-2.c: Likewise.
* gcc.dg/torture/pr70986-3.c: Likewise.
2016-05-11 Mikhail Maltsev <maltsevm@gmail.com>
PR c/43651
......
/* { dg-do compile } */
int a, g;
char b, c;
short d, e, f;
char
fn1 ()
{
return a ? a : 1;
}
void
fn2 ()
{
char h;
for (; d;)
for (; e; e++)
c = (fn1 () && h) & !(f |= 9 ^ (b > (g = c)));
for (;;)
;
}
/* { dg-do compile } */
int gi, dg;
void
fe (void)
{
int ka = gi;
for (;;)
{
if (ka != 0)
{
if (dg != 0)
gi = 0;
++ka;
}
++dg;
}
}
/* { dg-do compile } */
int a, b;
int
fn1 (int p1)
{
return p1 < 0 ? p1 : a;
}
void
fn2 ()
{
lbl_100:
b = 1;
for (; b != 21; b = fn1 (b))
;
goto lbl_100;
}
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