aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/c-convert.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index a4b5a8b..564992a 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -335,6 +335,13 @@ convert_to_integer (type, expr)
convert (typex, arg1),
convert (typex, arg2))));
}
+ else
+ /* It is sometimes worthwhile
+ to push the narrowing down through the conditional. */
+ return fold (build (COND_EXPR, type,
+ TREE_OPERAND (expr, 0),
+ convert (type, TREE_OPERAND (expr, 1)),
+ convert (type, TREE_OPERAND (expr, 2))));
}
}
}