public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/94377] New: Won't compile when deallocating a parameterized derived type
@ 2020-03-28  2:43 siteg at mathalacarte dot com
  2020-03-28  4:35 ` [Bug fortran/94377] " kargl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: siteg at mathalacarte dot com @ 2020-03-28  2:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94377

            Bug ID: 94377
           Summary: Won't compile when deallocating a parameterized
                    derived type
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: siteg at mathalacarte dot com
  Target Milestone: ---

Below is the code with the problem.

program pdt
  type :: av_t(n)
    integer, len :: n
    integer :: i
    real :: c
    real :: u(n)
  end type av_t
  type(av_t(:), allocatable :: av(:)
  integer :: k2, k3
  k2 = 3
  k3 = 5
contains
  subroutine al_test(k)
    integer, intent(in) :: k
    integer :: ista
    if (k == 1)  then
      allocate ( av_t(k2) :: av(k3), stat=ista) ! For this ista not needed
      return
    else
      deallocate(av, stat=ista)
    end if
  end subroutine al_test
end program pdt

Here is the compilation.

gfortran -g -o pdt pdt.f90
pdt.f90:20:0:

   20 |       deallocate(av, stat=ista)
      | 
internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:2755
0x7f446356f1a2 __libc_start_main
        ../csu/libc-start.c:308

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

* [Bug fortran/94377] Won't compile when deallocating a parameterized derived type
  2020-03-28  2:43 [Bug fortran/94377] New: Won't compile when deallocating a parameterized derived type siteg at mathalacarte dot com
@ 2020-03-28  4:35 ` kargl at gcc dot gnu.org
  2020-03-28 22:12 ` siteg at mathalacarte dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-03-28  4:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94377

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
Either update to the most recent version of gfortran, or the code
included in this bug report is not the code that demonstrates the problem.
I get

% gfortran -c a.f90
a.f90:8:14:

   type(av_t(:), allocatable :: av(:)
              1
Error: Malformed type-spec at (1)
a.f90:17:29:

       allocate ( av_t(k2) :: av(k3), stat=ista) ! For this ista not needed
                             1
Error: Allocate-object at (1) is neither a data pointer nor an allocatable
variable
a.f90:20:19:

       deallocate(av, stat=ista)
                   1
Error: Allocate-object at (1) is not a nonprocedure pointer nor an allocatable
variable

for 8.3.1, 9.2.1, and 10.0

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

* [Bug fortran/94377] Won't compile when deallocating a parameterized derived type
  2020-03-28  2:43 [Bug fortran/94377] New: Won't compile when deallocating a parameterized derived type siteg at mathalacarte dot com
  2020-03-28  4:35 ` [Bug fortran/94377] " kargl at gcc dot gnu.org
@ 2020-03-28 22:12 ` siteg at mathalacarte dot com
  2020-04-01 16:12 ` siteg at mathalacarte dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: siteg at mathalacarte dot com @ 2020-03-28 22:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94377

--- Comment #2 from Fred Krogh <siteg at mathalacarte dot com> ---
I'm sorry, I made an error when making up this code from a much bigger one. 
There was a missing ')' at line 8.  I've corrected this in the code below. 
Same kind of error here, but that code compiles on both Intel and NAG according
to a friend.

program pdt
  type :: av_t(n)
    integer, len :: n
    integer :: i   real :: c
    real :: u(n)
  end type av_t
  type(av_t(:)), allocatable :: av(:)
  integer :: k2, k3
  k2 = 3
  k3 = 5
contains
  subroutine al_test(k)
    integer, intent(in) :: k
    integer :: ista
    if (k == 1)  then
      allocate ( av_t(k2) :: av(k3), stat=ista) ! For this ista not needed
      return
    else
      deallocate(av, stat=ista)
    end if
  end subroutine al_test
end program pdt

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

* [Bug fortran/94377] Won't compile when deallocating a parameterized derived type
  2020-03-28  2:43 [Bug fortran/94377] New: Won't compile when deallocating a parameterized derived type siteg at mathalacarte dot com
  2020-03-28  4:35 ` [Bug fortran/94377] " kargl at gcc dot gnu.org
  2020-03-28 22:12 ` siteg at mathalacarte dot com
@ 2020-04-01 16:12 ` siteg at mathalacarte dot com
  2020-04-28 19:50 ` siteg at mathalacarte dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: siteg at mathalacarte dot com @ 2020-04-01 16:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94377

--- Comment #3 from Fred Krogh <siteg at mathalacarte dot com> ---
Just got GNU Fortran (GCC) 9.3.1 20200317 (Red Hat 9.3.1-1).  I gives the error
$ gfortran -g -o pdt pdt.f90
pdt.f90:20:0:

   20 |       deallocate(av, stat=ista)
      | 
internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:2755
0x7f48161671a2 __libc_start_main
        ../csu/libc-start.c:308

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

* [Bug fortran/94377] Won't compile when deallocating a parameterized derived type
  2020-03-28  2:43 [Bug fortran/94377] New: Won't compile when deallocating a parameterized derived type siteg at mathalacarte dot com
                   ` (2 preceding siblings ...)
  2020-04-01 16:12 ` siteg at mathalacarte dot com
@ 2020-04-28 19:50 ` siteg at mathalacarte dot com
  2020-06-09 16:46 ` dominiq at lps dot ens.fr
  2024-03-20 22:06 ` [Bug fortran/94377] [PDT] ICE " anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: siteg at mathalacarte dot com @ 2020-04-28 19:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94377

--- Comment #4 from Fred Krogh <siteg at mathalacarte dot com> ---
Same error with GNU Fortran (GCC) 10.0.1 20200328 (Red Hat 10.0.1-0.11)
Error says
internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:2830
This one is at a different place in gimplify, but the same error.  See comment
2 for the correct code to try.

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

* [Bug fortran/94377] Won't compile when deallocating a parameterized derived type
  2020-03-28  2:43 [Bug fortran/94377] New: Won't compile when deallocating a parameterized derived type siteg at mathalacarte dot com
                   ` (3 preceding siblings ...)
  2020-04-28 19:50 ` siteg at mathalacarte dot com
@ 2020-06-09 16:46 ` dominiq at lps dot ens.fr
  2024-03-20 22:06 ` [Bug fortran/94377] [PDT] ICE " anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-06-09 16:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94377

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-06-09
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
I only get errors for both tests (from GCC8 up to master).

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

* [Bug fortran/94377] [PDT] ICE when deallocating a parameterized derived type
  2020-03-28  2:43 [Bug fortran/94377] New: Won't compile when deallocating a parameterized derived type siteg at mathalacarte dot com
                   ` (4 preceding siblings ...)
  2020-06-09 16:46 ` dominiq at lps dot ens.fr
@ 2024-03-20 22:06 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-03-20 22:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94377

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
   Last reconfirmed|2020-06-09 00:00:00         |2024-3-20
           Keywords|                            |ice-on-valid-code
            Summary|Won't compile when          |[PDT] ICE when deallocating
                   |deallocating a              |a parameterized derived
                   |parameterized derived type  |type

--- Comment #6 from anlauf at gcc dot gnu.org ---
Confirmed.

Intel and NAG compile the code.

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

end of thread, other threads:[~2024-03-20 22:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28  2:43 [Bug fortran/94377] New: Won't compile when deallocating a parameterized derived type siteg at mathalacarte dot com
2020-03-28  4:35 ` [Bug fortran/94377] " kargl at gcc dot gnu.org
2020-03-28 22:12 ` siteg at mathalacarte dot com
2020-04-01 16:12 ` siteg at mathalacarte dot com
2020-04-28 19:50 ` siteg at mathalacarte dot com
2020-06-09 16:46 ` dominiq at lps dot ens.fr
2024-03-20 22:06 ` [Bug fortran/94377] [PDT] ICE " anlauf 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).