http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54435

             Bug #: 54435
           Summary: ICE with SELECT TYPE on a non-CLASS object
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org


It crashes in match.c's gfc_match_select_type:

  class_array = expr1->expr_type == EXPR_VARIABLE
                  && expr1->ts.type != BT_UNKNOWN
                  && CLASS_DATA (expr1)
                  ...

as for obvious reasons, a non-BT_CLASS doesn't have CLASS_DATA.


Test case, reported by xarthisius on #gfortran:

subroutine foo(x)
!  type(*) :: x
  integer :: x
  select type (x)
  end select type
end

Reply via email to