+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>
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>
* g++.dg/cpp0x/auto22.C: New.
--- /dev/null
+/* { 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" } } */
+
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;