summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2011-03-16 11:32:58 -0600
committerJeff Law <law@gcc.gnu.org>2011-03-16 11:32:58 -0600
commit6261ab0ee61da61460b541fd877d741f3b8dbd05 (patch)
tree9ed551087a24fe1b4ebf541c50da971c2db7d7a5 /gcc/tree-vrp.c
parent23d956f9358316e3a65455ff3dc4caffb6b67de3 (diff)
downloadgcc-6261ab0ee61da61460b541fd877d741f3b8dbd05.tar.gz
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
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 65d249f9ae2..d2e6551d992 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -7538,12 +7538,14 @@ identify_jump_threads (void)
continue;
/* 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
- && 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
- || is_gimple_min_invariant (gimple_cond_rhs (last)))
- && INTEGRAL_TYPE_P (TREE_TYPE (gimple_cond_rhs (last))))
+ || is_gimple_min_invariant (gimple_cond_rhs (last))))
{
edge_iterator ei;