diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-07-15 09:52:51 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-07-15 09:52:51 +0200 |
commit | 79c743005119639f4d30b82a708613a072e26681 (patch) | |
tree | ced7209a704077c4ef91e239bb92fdbc4850a087 /gcc/fortran/trans-stmt.c | |
parent | 23b1042021c8e95a5faa7c58c6ef1665d48afed7 (diff) | |
download | gcc-79c743005119639f4d30b82a708613a072e26681.zip gcc-79c743005119639f4d30b82a708613a072e26681.tar.gz gcc-79c743005119639f4d30b82a708613a072e26681.tar.bz2 |
re PR fortran/40206 ([gfortran] Incorrect warning with -Wuninitialized)
PR fortran/40206
* trans-stmt.c (gfc_trans_character_select): Always use NULL for high
in CASE_LABEL_EXPR and use NULL for low for the default case.
* gfortran.dg/select_char_3.f90: New test.
From-SVN: r162209
Diffstat (limited to 'gcc/fortran/trans-stmt.c')
-rw-r--r-- | gcc/fortran/trans-stmt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 8bd0f91..cc3dd72 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -1681,8 +1681,9 @@ gfc_trans_character_select (gfc_code *code) { label = gfc_build_label_decl (NULL_TREE); tmp = fold_build3 (CASE_LABEL_EXPR, void_type_node, - build_int_cst (NULL_TREE, d->n), - build_int_cst (NULL_TREE, d->n), label); + (d->low == NULL && d->high == NULL) + ? NULL : build_int_cst (NULL_TREE, d->n), + NULL, label); gfc_add_expr_to_block (&body, tmp); } |