2008-05-13 Richard Guenther <rguenther@suse.de>
PR middle-end/36227
* fold-const.c (fold_sign_changed_comparison): Do not allow
changes in pointer-ness.
* gcc.dg/pr36227.c: New testcase.
From-SVN: r135260
+2008-05-13 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36227
+ * fold-const.c (fold_sign_changed_comparison): Do not allow
+ changes in pointer-ness.
+
2008-05-12 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/24713
&& TREE_TYPE (TREE_OPERAND (arg1, 0)) == inner_type))
return NULL_TREE;
- if (TYPE_UNSIGNED (inner_type) != TYPE_UNSIGNED (outer_type)
+ if ((TYPE_UNSIGNED (inner_type) != TYPE_UNSIGNED (outer_type)
+ || POINTER_TYPE_P (inner_type) != POINTER_TYPE_P (outer_type))
&& code != NE_EXPR
&& code != EQ_EXPR)
return NULL_TREE;
+2008-05-13 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36227
+ * gcc.dg/pr36227.c: New testcase.
+
2008-05-13 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/discr7.adb: New test
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-overflow=3" } */
+
+volatile unsigned long *
+sat_add(volatile unsigned long *ptr, unsigned long i, volatile unsigned long *end)
+{
+ if ((unsigned long)ptr + i * sizeof(*ptr) > (unsigned long)ptr) /* { dg-bogus "pointer wraparound" } */
+ return ptr + i;
+ else
+ return end;
+}
+