public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/61284] New: non_overridable produces segmentation fault
@ 2014-05-22 11:04 mrestelli at gmail dot com
  2014-05-22 11:16 ` [Bug fortran/61284] " dominiq at lps dot ens.fr
  0 siblings, 1 reply; 2+ messages in thread
From: mrestelli at gmail dot com @ 2014-05-22 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61284
           Summary: non_overridable produces segmentation fault
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mrestelli at gmail dot com

The attached code produces a segmentation fault when including the
non_overridable attribute in t2.

$ gfortran --version
GNU Fortran (GCC) 4.10.0 20140508 (experimental)

$ ./bhg 

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7F46D0A23797
#1  0x7F46D0A23D64
#2  0x7F46CFF5453F
#3  0x0



module m
 implicit none

 type, abstract :: t1
  integer :: i
 contains
  procedure(i_f), pass(u), deferred :: ff
 end type t1

 type, abstract, extends(t1) :: t2
 contains
  procedure, non_overridable, pass(u) :: ff => f ! Segmentation fault 
  !procedure, pass(u) :: ff => f ! works
 end type t2

 type, extends(t2) :: t3
 end type t3

 abstract interface
  subroutine i_f(u)
   import :: t1
   class(t1), intent(inout) :: u
  end subroutine i_f
 end interface

contains

 subroutine f(u)
  class(t2), intent(inout) :: u
   u%i = 3*u%i
 end subroutine f

end module m


program p

 use m

 implicit none

 class(t1), allocatable :: v

 allocate(t3::v)
 v%i = 2
 call v%ff()
 write(*,*) v%i
end program p


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

* [Bug fortran/61284] non_overridable produces segmentation fault
  2014-05-22 11:04 [Bug fortran/61284] New: non_overridable produces segmentation fault mrestelli at gmail dot com
@ 2014-05-22 11:16 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-05-22 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-22
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed from 4.7 up to trunk (4.10). Likely related to pr61115.


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

end of thread, other threads:[~2014-05-22 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-22 11:04 [Bug fortran/61284] New: non_overridable produces segmentation fault mrestelli at gmail dot com
2014-05-22 11:16 ` [Bug fortran/61284] " dominiq at lps dot ens.fr

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).