diff options
author | Richard Guenther <rguenther@suse.de> | 2006-12-31 14:01:19 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-12-31 14:01:19 +0000 |
commit | 72ff1a96091ff6a1fb93e1c7087dc17f3c6c5d4b (patch) | |
tree | 0e17d9cce9536e7be84953e12a0a7bddb8f48b4c /gcc/fold-const.c | |
parent | 20a037d5f58c824cb402275fa47f241377a5fde5 (diff) | |
download | gcc-72ff1a96091ff6a1fb93e1c7087dc17f3c6c5d4b.zip gcc-72ff1a96091ff6a1fb93e1c7087dc17f3c6c5d4b.tar.gz gcc-72ff1a96091ff6a1fb93e1c7087dc17f3c6c5d4b.tar.bz2 |
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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 1874609..dbdc9c2 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -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)) { |