public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47680] New: [OOP] ICE with polymorphic array elements as dummy
@ 2011-02-10 15:02 burnus at gcc dot gnu.org
  2011-02-10 21:16 ` [Bug fortran/47680] " janus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-10 15:02 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: burnus@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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/47680] [OOP] ICE with polymorphic array elements as dummy
  2011-02-10 15:02 [Bug fortran/47680] New: [OOP] ICE with polymorphic array elements as dummy burnus at gcc dot gnu.org
@ 2011-02-10 21:16 ` janus at gcc dot gnu.org
  2011-02-10 21:26 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu.org @ 2011-02-10 21:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from janus at gcc dot gnu.org 2011-02-10 21:09:40 UTC ---
Actually I think it would be best to reject polymorphic arrays altogether for
the 4.6 release, i.e. throw an error as soon as we encounter something like

>   class(t) :: x(4)

and tell the user that this feature is not yet supported.

This would convey a much cleaner message than the various ICEs one runs into at
present. For 4.7 we can then take out the error message again, and start
implementing polymorphic arrays.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/47680] [OOP] ICE with polymorphic array elements as dummy
  2011-02-10 15:02 [Bug fortran/47680] New: [OOP] ICE with polymorphic array elements as dummy burnus at gcc dot gnu.org
  2011-02-10 21:16 ` [Bug fortran/47680] " janus at gcc dot gnu.org
@ 2011-02-10 21:26 ` dominiq at lps dot ens.fr
  2013-01-15 21:44 ` mikael at gcc dot gnu.org
  2013-06-10 17:24 ` mikael at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-02-10 21:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-02-10 21:16:27 UTC ---
> Actually I think it would be best to reject polymorphic arrays altogether for
> the 4.6 release, i.e. throw an error as soon as we encounter something like
>
> >   class(t) :: x(4)
>
> and tell the user that this feature is not yet supported.
>
> This would convey a much cleaner message than the various ICEs one runs into at
> present. For 4.7 we can then take out the error message again, and start
> implementing polymorphic arrays.

I fully agree that it would be more user friendly (and prevent duplicates;-).


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/47680] [OOP] ICE with polymorphic array elements as dummy
  2011-02-10 15:02 [Bug fortran/47680] New: [OOP] ICE with polymorphic array elements as dummy burnus at gcc dot gnu.org
  2011-02-10 21:16 ` [Bug fortran/47680] " janus at gcc dot gnu.org
  2011-02-10 21:26 ` dominiq at lps dot ens.fr
@ 2013-01-15 21:44 ` mikael at gcc dot gnu.org
  2013-06-10 17:24 ` mikael at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-01-15 21:44 UTC (permalink / raw)
  To: gcc-bugs


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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org
      Known to work|                            |4.8.0

--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> 2013-01-15 21:43:32 UTC ---
The ICE is gone in 4.8.0:

:11.20:

    class(t) :: a(*)
                    1
Error: Assumed size polymorphic objects or components, such as that at (1),
have not yet been implemented
:8.11:

  call foo(x(1)) ! <<<<< ICE
           1
Error: Type mismatch in argument 'a' at (1); passed CLASS(t) to REAL(4)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/47680] [OOP] ICE with polymorphic array elements as dummy
  2011-02-10 15:02 [Bug fortran/47680] New: [OOP] ICE with polymorphic array elements as dummy burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-01-15 21:44 ` mikael at gcc dot gnu.org
@ 2013-06-10 17:24 ` mikael at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-06-10 17:24 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #4)
> Per comment #3, this PR should probably be closed.

Let's do it then.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-10 17:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-10 15:02 [Bug fortran/47680] New: [OOP] ICE with polymorphic array elements as dummy burnus at gcc dot gnu.org
2011-02-10 21:16 ` [Bug fortran/47680] " janus at gcc dot gnu.org
2011-02-10 21:26 ` dominiq at lps dot ens.fr
2013-01-15 21:44 ` mikael at gcc dot gnu.org
2013-06-10 17:24 ` mikael at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).