diff options
author | Joseph Myers <joseph@codesourcery.com> | 2016-06-20 23:58:20 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2016-06-20 23:58:20 +0100 |
commit | 5a5786714dc8638bf1a757eb89c2030dbfd239f1 (patch) | |
tree | 77aba49c84485917b8be4c68189cb2c5e87af15d /gcc/c | |
parent | 50aa64d58fd4cea25df2a9d9ddfc38e74dcdd94c (diff) | |
download | gcc-5a5786714dc8638bf1a757eb89c2030dbfd239f1.zip gcc-5a5786714dc8638bf1a757eb89c2030dbfd239f1.tar.gz gcc-5a5786714dc8638bf1a757eb89c2030dbfd239f1.tar.bz2 |
Fix ICE on conditional expression between DFP and non-DFP float (PR c/71601).
A conditional expression between DFP and non-DFP floating-point
produces an ICE. This patch fixes this by making
build_conditional_expr return early when c_common_type produces an
error.
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
PR c/71601
gcc/c:
* c-typeck.c (build_conditional_expr): Return error_mark_node if
c_common_type returns error_mark_node.
gcc/testsuite:
* gcc.dg/dfp/usual-arith-conv-bad-3.c: New test.
From-SVN: r237622
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index bd25eca..35b3de4 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2016-06-20 Joseph Myers <joseph@codesourcery.com> + + PR c/71601 + * c-typeck.c (build_conditional_expr): Return error_mark_node if + c_common_type returns error_mark_node. + 2016-06-19 Martin Sebor <msebor@redhat.com> PR c/69507 diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index f03c07b..7c6241c 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -4846,6 +4846,8 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp, || code2 == COMPLEX_TYPE)) { result_type = c_common_type (type1, type2); + if (result_type == error_mark_node) + return error_mark_node; do_warn_double_promotion (result_type, type1, type2, "implicit conversion from %qT to %qT to " "match other result of conditional", |