diff options
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e3470b3..e95a2c8 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4201,7 +4201,11 @@ fold (expr) and its values must be 0 or 1. ("true" is a fixed value perhaps depending on the language, but we don't handle values other than 1 correctly yet.) */ - return invert_truthvalue (arg0); + tem = invert_truthvalue (arg0); + /* Avoid infinite recursion. */ + if (TREE_CODE (tem) == TRUTH_NOT_EXPR) + return t; + return convert (type, tem); case TRUTH_ANDIF_EXPR: /* Note that the operands of this must be ints |