mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-22 21:51:36 +08:00
re PR middle-end/30338 (infinite loop in maybe_canonicalize_comparison)
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. * gcc.c-torture/compile/pr30338.c: New testcase. From-SVN: r120297
This commit is contained in:
parent
20a037d5f5
commit
72ff1a9609
@ -1,3 +1,9 @@
|
||||
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.
|
||||
|
@ -9009,7 +9009,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
|
||||
/* 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))
|
||||
{
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
14
gcc/testsuite/gcc.c-torture/compile/pr30338.c
Normal file
14
gcc/testsuite/gcc.c-torture/compile/pr30338.c
Normal file
@ -0,0 +1,14 @@
|
||||
/* 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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user