* fold-const.c (fold): Before optimizing unsigned comparison with
0x7fffffffU, make sure arg0 is integral type.
* gcc.c-torture/execute/
20010329-1.c: New test.
From-SVN: r41000
+2001-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ * fold-const.c (fold): Before optimizing unsigned comparison with
+ 0x7fffffffU, make sure arg0 is integral type.
+
2001-04-02 Joseph S. Myers <jsm28@cam.ac.uk>
* c-tree.texi: Document representation of wide strings.
else if (TREE_INT_CST_HIGH (arg1) == 0
&& (TREE_INT_CST_LOW (arg1)
== ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1)
- && TREE_UNSIGNED (TREE_TYPE (arg1)))
+ && TREE_UNSIGNED (TREE_TYPE (arg1))
+ /* signed_type does not work on pointer types. */
+ && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
switch (TREE_CODE (t))
{
+2001-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/20010329-1.c: New test.
+
2001-03-28 Loren J. Rittle <ljrittle@acm.org>
* g++.old-deja/g++.other/eh4.C: Fix typo.
--- /dev/null
+#include <limits.h>
+
+int main (void)
+{
+ void *x = ((void *)((unsigned int)INT_MAX + 2));
+ void *y = ((void *)((unsigned long)LONG_MAX + 2));
+ if (x >= ((void *)((unsigned int)INT_MAX + 1))
+ && x <= ((void *)((unsigned int)INT_MAX + 6))
+ && y >= ((void *)((unsigned long)LONG_MAX + 1))
+ && y <= ((void *)((unsigned long)LONG_MAX + 6)))
+ exit (0);
+ else
+ abort ();
+}