Commit b30e83f8 by Prathamesh Kulkarni Committed by Prathamesh Kulkarni

Use safe_dyn_cast instead of dyn_cast in find_loop_guard to fix PR92608.

2019-11-22  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR tree-optimization/92608
	* tree-ssa-loop-unswitch.c (find_loop_guard): Use safe_dyn_cast instead
	of dyn_cast.

testsuite/
	* gcc.dg/torture/pr92608.c: New test.

From-SVN: r278598
parent d2993abd
2019-11-22 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR tree-optimization/92608
* tree-ssa-loop-unswitch.c (find_loop_guard): Use safe_dyn_cast instead
of dyn_cast.
2019-11-21 Segher Boessenkool <segher@kernel.crashing.org> 2019-11-21 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/predicates.md (extra_insn_branch_comparison_operator): * config/rs6000/predicates.md (extra_insn_branch_comparison_operator):
2019-11-22 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR tree-optimization/92608
* gcc.dg/torture/pr92608.c: New test.
2019-11-21 Iain Sandoe <iain@sandoe.co.uk> 2019-11-21 Iain Sandoe <iain@sandoe.co.uk>
PR testsuite/92619 PR testsuite/92619
......
/* { dg-do compile } */
/* { dg-additional-options "-funswitch-loops" } */
int op, bs;
void
q0 (void)
{
op += 1 % (op == bs);
}
void __attribute__ ((returns_twice))
co (void)
{
}
void __attribute__ ((simd))
uq (void)
{
q0 ();
co ();
while (bs < 1)
++bs;
}
...@@ -586,7 +586,7 @@ find_loop_guard (class loop *loop) ...@@ -586,7 +586,7 @@ find_loop_guard (class loop *loop)
next = single_succ (header); next = single_succ (header);
else else
{ {
cond = dyn_cast <gcond *> (last_stmt (header)); cond = safe_dyn_cast <gcond *> (last_stmt (header));
if (! cond) if (! cond)
return NULL; return NULL;
extract_true_false_edges_from_block (header, &te, &fe); extract_true_false_edges_from_block (header, &te, &fe);
......
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