Commit 6261ab0e by Jeff Law Committed by Jeff Law

tree-vrp.c (identify_jump_threads): Slightly simplify type check for operands of conditional.

 	* tree-vrp.c (identify_jump_threads): Slightly simplify type
 	check for operands of conditional.  Allow type to be a
 	pointer.
 
 
 	* gcc.dg/tree-ssa/vrp55.c: New test.

From-SVN: r171055
parent 23d956f9
2011-03-16 Jeff Law <law@redhat.com>
* tree-vrp.c (identify_jump_threads): Slightly simplify type
check for operands of conditional. Allow type to be a
pointer.
2011-03-16 Richard Guenther <rguenther@suse.de> 2011-03-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/48149 PR tree-optimization/48149
......
2011-03-16 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/vrp55.c: New test.
2011-03-16 Jason Merrill <jason@redhat.com> 2011-03-16 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/auto22.C: New. * g++.dg/cpp0x/auto22.C: New.
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp1-blocks-vops-details" } */
fu (char *p, int x)
{
if (x)
*p = 69;
if (p)
arf ();
}
/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "vrp1" } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
...@@ -7538,12 +7538,14 @@ identify_jump_threads (void) ...@@ -7538,12 +7538,14 @@ identify_jump_threads (void)
continue; continue;
/* We're basically looking for any kind of conditional with /* We're basically looking for any kind of conditional with
integral type arguments. */ integral or pointer type arguments. Note the type of the second
argument will be the same as the first argument, so no need to
check it explicitly. */
if (TREE_CODE (gimple_cond_lhs (last)) == SSA_NAME if (TREE_CODE (gimple_cond_lhs (last)) == SSA_NAME
&& INTEGRAL_TYPE_P (TREE_TYPE (gimple_cond_lhs (last))) && (INTEGRAL_TYPE_P (TREE_TYPE (gimple_cond_lhs (last)))
|| POINTER_TYPE_P (TREE_TYPE (gimple_cond_lhs (last))))
&& (TREE_CODE (gimple_cond_rhs (last)) == SSA_NAME && (TREE_CODE (gimple_cond_rhs (last)) == SSA_NAME
|| is_gimple_min_invariant (gimple_cond_rhs (last))) || is_gimple_min_invariant (gimple_cond_rhs (last))))
&& INTEGRAL_TYPE_P (TREE_TYPE (gimple_cond_rhs (last))))
{ {
edge_iterator ei; edge_iterator ei;
......
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