* tree-vrp.c (simplify_cond_using_ranges): Don't optimize
comparison of conversion from pointer type to integral type
with integer.
* gcc.c-torture/compile/pr57331.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199148
138bc75d-0d04-0410-961f-
82ee72b054a4
+2013-05-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/57331
+ * tree-vrp.c (simplify_cond_using_ranges): Don't optimize
+ comparison of conversion from pointer type to integral type
+ with integer.
+
2013-05-21 Martin Jambor <mjambor@suse.cz>
PR lto/57289
+2013-05-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/57331
+ * gcc.c-torture/compile/pr57331.c: New test.
+
2013-05-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/57330
--- /dev/null
+/* PR tree-optimization/57331 */
+
+int
+foo (int x)
+{
+ void *p = x ? (void *) 1 : (void *) 0;
+ __INTPTR_TYPE__ b = (__INTPTR_TYPE__) p;
+ if (b)
+ return 0;
+ return 1;
+}
innerop = gimple_assign_rhs1 (def_stmt);
- if (TREE_CODE (innerop) == SSA_NAME)
+ if (TREE_CODE (innerop) == SSA_NAME
+ && !POINTER_TYPE_P (TREE_TYPE (innerop)))
{
value_range_t *vr = get_value_range (innerop);