[Bug fortran/88393] New: [7/8/9 Regression] [OOP] Segfault with type-bound assignment

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/88393] New: [7/8/9 Regression] [OOP] Segfault with type-bound assignment

kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88393

            Bug ID: 88393
           Summary: [7/8/9 Regression] [OOP] Segfault with type-bound
                    assignment
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janus at gcc dot gnu.org
  Target Milestone: ---

Simple test case:


module m
   implicit none
   type :: t
      character(len=:), allocatable :: cs
   contains
      procedure :: ass
      generic :: assignment(=) => ass
   end type
contains
   subroutine ass(a, b)
      class(t), intent(inout) :: a
      class(t), intent(in)    :: b
      print *, "ass"
   end subroutine
end module

program p
   use m
   implicit none
   type :: t2
      type(t) :: c
   end type
   type(t2), dimension(1:2) :: arr
   arr(2)%c = arr(1)%c
   print *, "done"
end


While this runs flawlessly with gfortran 6.4.0, it segfaults at runtime with
7.3.0 and above.
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/88393] [7/8/9 Regression] [OOP] Segfault with type-bound assignment

kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88393

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
      Known to work|                            |6.4.0
   Target Milestone|---                         |7.5
Reply | Threaded
Open this post in threaded view
|

[Bug fortran/88393] [7/8/9 Regression] [OOP] Segfault with type-bound assignment

kargl at gcc dot gnu.org
In reply to this post by kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88393

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-12-09
     Ever confirmed|0                           |1
      Known to fail|                            |7.3.0, 8.2.0, 9.0

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The test compiled with r241883 + patches (2016-11-06) gives the expected
result, compiled with r241924 + patches (2016-11-07) gives a segfault at run
time.