*** empty log message ***
authorJason Merrill <merrill@gnu.org>
Wed, 24 May 1995 19:41:29 +0000 (19:41 +0000)
committerJason Merrill <merrill@gnu.org>
Wed, 24 May 1995 19:41:29 +0000 (19:41 +0000)
From-SVN: r9801

gcc/c-common.c
gcc/fold-const.c

index fc368c8..acd66d0 100644 (file)
@@ -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;
 
index e3470b3..e95a2c8 100644 (file)
@@ -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