Commit 44b00dbc by Richard Biener Committed by Richard Biener

re PR tree-optimization/77988 (ICE on valid code at -Os and above on…

re PR tree-optimization/77988 (ICE on valid code at -Os and above on x86_64-linux-gnu: verify_gimple failed)

2016-10-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77988
	* tree-vrp.c (remove_range_assertions): Use replace_uses_by.

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

From-SVN: r241242
parent a9260b7e
2016-10-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/77988
* tree-vrp.c (remove_range_assertions): Use replace_uses_by.
2016-10-17 Marek Polacek <polacek@redhat.com> 2016-10-17 Marek Polacek <polacek@redhat.com>
* Makefile.in (C_COMMON_OBJS): Add c-family/c-attribs.o. * Makefile.in (C_COMMON_OBJS): Add c-family/c-attribs.o.
......
2016-10-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/77988
* gcc.dg/torture/pr77988.c: New testcase.
2016-10-17 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> 2016-10-17 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* gcc.dg/pr71636-1.c: New test-case. * gcc.dg/pr71636-1.c: New test-case.
......
/* { dg-do compile } */
static int a = 2;
int b[1], c, d;
int main ()
{
int e = a, *f = &b[0];
if (d)
for (e = 0; e < 1; e++)
;
if (e)
{
L1:
if (b < f)
__builtin_abort ();
if (*f)
c++;
return 0;
}
f = 0;
goto L1;
return 0;
}
...@@ -6882,7 +6882,6 @@ remove_range_assertions (void) ...@@ -6882,7 +6882,6 @@ remove_range_assertions (void)
for (si = gsi_after_labels (bb), is_unreachable = -1; !gsi_end_p (si);) for (si = gsi_after_labels (bb), is_unreachable = -1; !gsi_end_p (si);)
{ {
gimple *stmt = gsi_stmt (si); gimple *stmt = gsi_stmt (si);
gimple *use_stmt;
if (is_gimple_assign (stmt) if (is_gimple_assign (stmt)
&& gimple_assign_rhs_code (stmt) == ASSERT_EXPR) && gimple_assign_rhs_code (stmt) == ASSERT_EXPR)
...@@ -6890,8 +6889,6 @@ remove_range_assertions (void) ...@@ -6890,8 +6889,6 @@ remove_range_assertions (void)
tree lhs = gimple_assign_lhs (stmt); tree lhs = gimple_assign_lhs (stmt);
tree rhs = gimple_assign_rhs1 (stmt); tree rhs = gimple_assign_rhs1 (stmt);
tree var; tree var;
use_operand_p use_p;
imm_use_iterator iter;
var = ASSERT_EXPR_VAR (rhs); var = ASSERT_EXPR_VAR (rhs);
...@@ -6927,12 +6924,7 @@ remove_range_assertions (void) ...@@ -6927,12 +6924,7 @@ remove_range_assertions (void)
} }
/* Propagate the RHS into every use of the LHS. */ /* Propagate the RHS into every use of the LHS. */
FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs) replace_uses_by (lhs, var);
{
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
SET_USE (use_p, var);
update_stmt (use_stmt);
}
/* 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