aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.0/gcc/convert.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.0/gcc/convert.c')
-rw-r--r--gcc-4.4.0/gcc/convert.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc-4.4.0/gcc/convert.c b/gcc-4.4.0/gcc/convert.c
index e98b6578d..6a2c817f0 100644
--- a/gcc-4.4.0/gcc/convert.c
+++ b/gcc-4.4.0/gcc/convert.c
@@ -740,10 +740,16 @@ convert_to_integer (tree type, tree expr)
case COND_EXPR:
/* It is sometimes worthwhile to push the narrowing down through
- the conditional and never loses. */
+ the conditional and never loses. A COND_EXPR may have a throw
+ as one operand, which then has void type. Just leave void
+ operands as they are. */
return fold_build3 (COND_EXPR, type, TREE_OPERAND (expr, 0),
- convert (type, TREE_OPERAND (expr, 1)),
- convert (type, TREE_OPERAND (expr, 2)));
+ VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 1)))
+ ? TREE_OPERAND (expr, 1)
+ : convert (type, TREE_OPERAND (expr, 1)),
+ VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 2)))
+ ? TREE_OPERAND (expr, 2)
+ : convert (type, TREE_OPERAND (expr, 2)));
default:
break;