http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56081
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org Known to fail| |4.7.0, 4.8.0 --- Comment #1 from kargl at gcc dot gnu.org 2013-01-23 01:27:11 UTC --- Reduced testcase. subroutine pickle(s, a) implicit none logical, intent(out) :: s integer, intent(inout) :: a(4) a = 3 select case(a) case (0) s = .true. case (1) s = .false. end select end subroutine pickle Possible patch (cut-n-paste to tabs are corrupted). Index: match.c =================================================================== --- match.c (revision 195396) +++ match.c (working copy) @@ -5128,6 +5128,17 @@ gfc_match_select (void) if (m != MATCH_YES) return m; + /* R812 case-expr is scalar-int-expr + or scalar-char-expr + or scalar-logical-expr. */ + + if (expr->rank != 0) + { + gfc_error ("case-expr of SELECT construct at %C should be a " + "scalar-int-expr, scalar-char-expr, or scalar-logical-expr"); + return MATCH_ERROR; + } + new_st.op = EXEC_SELECT; new_st.expr1 = expr;