Commit 2bbec6d9 by Jeff Law Committed by Jeff Law

tree-vrp.c (stmt_interesting_for_vrp): Some statements with virtual operands are interesting.


	* tree-vrp.c (stmt_interesting_for_vrp): Some statements with
	virtual operands are interesting.
	(vrp_visit_stmt): Corresponding changes.

	* gcc.dg/tree-ssa/20030807-2.c: No longer expected to fail.

From-SVN: r112011
parent 96c30d2a
2006-03-13 Jeff Law <law@redhat.com>
* tree-vrp.c (stmt_interesting_for_vrp): Some statements with
virtual operands are interesting.
(vrp_visit_stmt): Corresponding changes.
2006-03-13 Bernd Schmidt <bernd.schmidt@analog.com> 2006-03-13 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/lib1funcs.asm (___umodsi3): Use stack to save contents * config/bfin/lib1funcs.asm (___umodsi3): Use stack to save contents
......
2006-03-13 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/20030807-2.c: No longer expected to fail.
2006-03-13 Eric Botcazou <ebotcazou@adacore.com> 2006-03-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/switch-9.c: New test. * gcc.dg/switch-9.c: New test.
...@@ -24,5 +24,5 @@ foo(int n) ...@@ -24,5 +24,5 @@ foo(int n)
/* There should be no IF conditionals. */ /* There should be no IF conditionals. */
/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { xfail *-*-* } } } */ /* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */
/* { dg-final { cleanup-tree-dump "dom3" } } */ /* { dg-final { cleanup-tree-dump "dom3" } } */
...@@ -3266,11 +3266,19 @@ stmt_interesting_for_vrp (tree stmt) ...@@ -3266,11 +3266,19 @@ stmt_interesting_for_vrp (tree stmt)
else if (TREE_CODE (stmt) == MODIFY_EXPR) else if (TREE_CODE (stmt) == MODIFY_EXPR)
{ {
tree lhs = TREE_OPERAND (stmt, 0); tree lhs = TREE_OPERAND (stmt, 0);
tree rhs = TREE_OPERAND (stmt, 1);
/* In general, assignments with virtual operands are not useful
for deriving ranges, with the obvious exception of calls to
builtin functions. */
if (TREE_CODE (lhs) == SSA_NAME if (TREE_CODE (lhs) == SSA_NAME
&& (INTEGRAL_TYPE_P (TREE_TYPE (lhs)) && (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
|| POINTER_TYPE_P (TREE_TYPE (lhs))) || POINTER_TYPE_P (TREE_TYPE (lhs)))
&& ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS)) && ((TREE_CODE (rhs) == CALL_EXPR
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
&& DECL_P (TREE_OPERAND (TREE_OPERAND (rhs, 0), 0))
&& DECL_IS_BUILTIN (TREE_OPERAND (TREE_OPERAND (rhs, 0), 0)))
|| ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS)))
return true; return true;
} }
else if (TREE_CODE (stmt) == COND_EXPR || TREE_CODE (stmt) == SWITCH_EXPR) else if (TREE_CODE (stmt) == COND_EXPR || TREE_CODE (stmt) == SWITCH_EXPR)
...@@ -3739,9 +3747,20 @@ vrp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p) ...@@ -3739,9 +3747,20 @@ vrp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p)
} }
ann = stmt_ann (stmt); ann = stmt_ann (stmt);
if (TREE_CODE (stmt) == MODIFY_EXPR if (TREE_CODE (stmt) == MODIFY_EXPR)
&& ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS)) {
return vrp_visit_assignment (stmt, output_p); tree rhs = TREE_OPERAND (stmt, 1);
/* In general, assignments with virtual operands are not useful
for deriving ranges, with the obvious exception of calls to
builtin functions. */
if ((TREE_CODE (rhs) == CALL_EXPR
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
&& DECL_P (TREE_OPERAND (TREE_OPERAND (rhs, 0), 0))
&& DECL_IS_BUILTIN (TREE_OPERAND (TREE_OPERAND (rhs, 0), 0)))
|| ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
return vrp_visit_assignment (stmt, output_p);
}
else if (TREE_CODE (stmt) == COND_EXPR || TREE_CODE (stmt) == SWITCH_EXPR) else if (TREE_CODE (stmt) == COND_EXPR || TREE_CODE (stmt) == SWITCH_EXPR)
return vrp_visit_cond_stmt (stmt, taken_edge_p); return vrp_visit_cond_stmt (stmt, taken_edge_p);
......
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