From: Jason Merrill Date: Wed, 24 May 1995 19:41:29 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1180eb10426d15d188cdfca38495035f48b1dfd2;p=gcc.git *** empty log message *** From-SVN: r9801 --- diff --git a/gcc/c-common.c b/gcc/c-common.c index fc368c8a53d..acd66d0abae 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -2019,6 +2019,7 @@ truthvalue_conversion (expr) case TRUTH_AND_EXPR: case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: + case TRUTH_NOT_EXPR: TREE_TYPE (expr) = boolean_type_node; return expr; diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e3470b33581..e95a2c8ef57 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