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

           Summary: [OOP] ICE with polymorphic array elements as dummy
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org


Follow up to PR 47569.

The following program is invalid (Cf. F2008 12.5.2.4) - but my diagnostic in
interface.c (cf. patch for PR 47569) is not reached due to an earlier ICE.

The problem is:

1898          else if (ref->type == REF_ARRAY && ref->u.ar.type == AR_FULL
1899                   && ref->u.ar.as->lower && ref->u.ar.as->upper)
1900            for (i = 0; i < ref->u.ar.as->rank; i++)

(gdb) p ref->u.ar
$4 = {type = AR_FULL, dimen = 0, codimen = 0, in_allocate = 0 '\000', where =
{nextc = 0x148e95c, lb = 0x148e900}, as = 0x0, c_where = {{nextc = 0x0,
      lb = 0x0}, {nextc = 0x0, lb = 0x0}, {nextc = 0x0, lb = 0x0}, {nextc =
0x0, lb = 0x0}, {nextc = 0x0, lb = 0x0}, {nextc = 0x0, lb = 0x0}, {
      nextc = 0x0, lb = 0x0}}, start = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, end
= {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, stride = {0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, dimen_type = {0, 0, 0, 0, 0, 0, 0}, offset = 0x0}
(gdb) p ref->u.ar->as
$5 = (gfc_array_spec *) 0x0


I assume that that is a side effect of the extra BT_CLASS wrapper, but I might
be wrong.

module m
type t
 integer :: i
end type t
contains
subroutine classtest(x)
  class(t) :: x(4)
  call foo(x(1)) ! <<<<< ICE
contains
  subroutine foo(a,b)
    class(t) :: a(*)
  end subroutine
end subroutine
end module m

Reply via email to