+2006-12-31 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/30338
+ * fold-const.c (fold_binary): Fix type-mismatch in folding
+ of -1 - A to ~A.
+
2006-12-30 Kazu Hirata <kazu@codesourcery.com>
* tree-inline.c: Fix a comment typo.
/* Convert -1 - A to ~A. */
if (INTEGRAL_TYPE_P (type)
&& integer_all_onesp (arg0))
- return fold_build1 (BIT_NOT_EXPR, type, arg1);
+ return fold_build1 (BIT_NOT_EXPR, type, op1);
if (! FLOAT_TYPE_P (type))
{
+2006-12-31 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/30338
+ * gcc.c-torture/compile/pr30338.c: New testcase.
+
2006-12-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/27900
--- /dev/null
+/* We used to do folding with mismatched types which caused us to
+ infinitely loop in comparison foldings. */
+
+extern char *grub_scratch_mem;
+int testload_func (char *arg, int flags)
+{
+ int i;
+ for (i = 0; i < 0x10ac0; i++)
+ if (*((unsigned char *) ((0x200000 + i + (int) grub_scratch_mem)))
+ != *((unsigned char *) ((0x300000 + i + (int) grub_scratch_mem))))
+ return 0;
+ return 1;
+}
+