* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162209
138bc75d-0d04-0410-961f-
82ee72b054a4
or NE_EXPR and one of the strings is string literal with LEN_TRIM
bigger than the length of the other string, they compare unequal.
+ 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.
+
2010-07-14 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_conv_section_upper_bound): Remove
{
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);
}
+2010-07-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/40206
+ * gfortran.dg/select_char_3.f90: New test.
+
2010-07-15 Magnus Granberg <zorry@gentoo.org>
Kevin F. Quinn <kevquinn@gentoo.org>
--- /dev/null
+! PR fortran/40206
+! { dg-do compile }
+! { dg-options "-O2 -Wuninitialized" }
+
+function char2type (char)
+ character, intent(in) :: char
+ integer :: char2type
+
+ select case (char)
+ case ('E','e')
+ char2type=1
+ case default
+ char2type=-1234
+ end select
+end function