aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1993-09-17 21:43:29 -0700
committerPer Bothner <bothner@gcc.gnu.org>1993-09-17 21:43:29 -0700
commitefc1a4d9b4b426c5c26e2ef599f9992c7ba04914 (patch)
tree65b55ac5b9156abb7b7349edf877f614fcfd667a /gcc
parent925d5bbfe9aab62d196da3cc1afb238c6d8b5b4c (diff)
downloadgcc-efc1a4d9b4b426c5c26e2ef599f9992c7ba04914.zip
gcc-efc1a4d9b4b426c5c26e2ef599f9992c7ba04914.tar.gz
gcc-efc1a4d9b4b426c5c26e2ef599f9992c7ba04914.tar.bz2
(invert_truthvalue): Allow arbitrary BOOLEAN_TYPE arguments.
From-SVN: r5351
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fold-const.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 4f0e8b89..62ead45 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2181,12 +2181,14 @@ invert_truthvalue (arg)
invert_truthvalue (TREE_OPERAND (arg, 0)));
case BIT_AND_EXPR:
- if (! integer_onep (TREE_OPERAND (arg, 1)))
- abort ();
+ if (!integer_onep (TREE_OPERAND (arg, 1)))
+ break;
return build (EQ_EXPR, type, arg, convert (type, integer_zero_node));
- }
- abort ();
+ }
+ if (TREE_CODE (TREE_TYPE (arg)) != BOOLEAN_TYPE)
+ abort();
+ return build1 (TRUTH_NOT_EXPR, type, arg);
}
/* Given a bit-wise operation CODE applied to ARG0 and ARG1, see if both