Commit 38f50ab6 by Richard Biener Committed by Richard Biener

re PR tree-optimization/79244 (ice in replace_uses_by, at tree-cfg.c:1866)

2017-01-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79244
	* tree-vrp.c (remove_range_assertions): Forcefully propagate
	out SSA names even if abnormal.

	* gcc.dg/torture/pr79244.c: New testcase.

From-SVN: r244973
parent c04f4139
2017-01-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/79244
* tree-vrp.c (remove_range_assertions): Forcefully propagate
out SSA names even if abnormal.
2017-01-27 Jakub Jelinek <jakub@redhat.com> 2017-01-27 Jakub Jelinek <jakub@redhat.com>
* realmpfr.h: Poison MPFR_RND{N,Z,U,D}. * realmpfr.h: Poison MPFR_RND{N,Z,U,D}.
......
2017-01-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/79244
* gcc.dg/torture/pr79244.c: New testcase.
2017-01-27 Jakub Jelinek <jakub@redhat.com> 2017-01-27 Jakub Jelinek <jakub@redhat.com>
* g++.dg/cilk-plus/CK/fib-opr-overload.cc (main): Change * g++.dg/cilk-plus/CK/fib-opr-overload.cc (main): Change
......
/* { dg-do compile } */
long buf[5];
int bar (void);
int
foo (int x)
{
int y = __builtin_setjmp (buf);
while (x != 3 && x && x && x != 2)
x = bar ();
return y;
}
...@@ -6974,8 +6974,20 @@ remove_range_assertions (void) ...@@ -6974,8 +6974,20 @@ remove_range_assertions (void)
} }
} }
/* Propagate the RHS into every use of the LHS. */ /* Propagate the RHS into every use of the LHS. For SSA names
replace_uses_by (lhs, var); also propagate abnormals as it merely restores the original
IL in this case (an replace_uses_by would assert). */
if (TREE_CODE (var) == SSA_NAME)
{
imm_use_iterator iter;
use_operand_p use_p;
gimple *use_stmt;
FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
SET_USE (use_p, var);
}
else
replace_uses_by (lhs, var);
/* And finally, remove the copy, it is not needed. */ /* And finally, remove the copy, it is not needed. */
gsi_remove (&si, true); gsi_remove (&si, true);
......
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