summaryrefslogtreecommitdiff
path: root/gcc/c-convert.c
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-07-17 04:26:02 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-07-17 04:26:02 +0000
commitdbb5815fe0ad3eb0c2d02002bc8cf6be36755509 (patch)
treee1675dd77c2091e47acd777b3546e54f1a13d7b0 /gcc/c-convert.c
parent4b66ffa413eb1c5e00c49dcdef4321098eca7cd2 (diff)
downloadgcc-dbb5815fe0ad3eb0c2d02002bc8cf6be36755509.tar.gz
(convert_to_integer): Push truncation inside COND_EXPR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1609 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-convert.c')
-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 a4b5a8bd3d5..564992af88f 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))));
}
}
}