summaryrefslogtreecommitdiff
path: root/gcc/c-convert.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-convert.c')
-rw-r--r--gcc/c-convert.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index 5d7ea00f82b..7f57725b7c1 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -88,6 +88,8 @@ convert (type, expr)
#endif
if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
return fold (convert_to_integer (type, e));
+ if (code == BOOLEAN_TYPE)
+ return fold (build1 (NOP_EXPR, type, truthvalue_conversion (expr)));
if (code == POINTER_TYPE || code == REFERENCE_TYPE)
return fold (convert_to_pointer (type, e));
if (code == REAL_TYPE)