+2005-07-11 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR middle-end/22398
+ * fold-const.c (build_range_check): Convert high/low to etype
+ if we are only comparing against exp.
+
2005-07-13 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/22376
return fold_convert (type, integer_one_node);
if (low == 0)
- return fold_build2 (LE_EXPR, type, exp, high);
+ return fold_build2 (LE_EXPR, type, exp,
+ fold_convert (etype, high));
if (high == 0)
- return fold_build2 (GE_EXPR, type, exp, low);
+ return fold_build2 (GE_EXPR, type, exp,
+ fold_convert (etype, low));
if (operand_equal_p (low, high, 0))
- return fold_build2 (EQ_EXPR, type, exp, low);
+ return fold_build2 (EQ_EXPR, type, exp,
+ fold_convert (etype, low));
if (integer_zerop (low))
{
--- /dev/null
+#if ULONG_MAX != 4294967295u && ULONG_MAX != 18446744073709551615ull
+int main(void) { exit (0); }
+#else
+#if ULONG_MAX != 18446744073709551615ull
+#define NUM 0xf0000000
+#else
+#define NUM 0xf000000000000000
+#endif
+
+
+int func1(void *rw)
+{
+ return (rw && (((unsigned long) rw) >= NUM) );
+}
+
+void func2(void *rw)
+{
+ while(rw && (((unsigned long) rw) >= NUM) ) {}
+}
+
+#endif