public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/61261] New: [OOP] Segfault on source-allocating polymorphic variables
@ 2014-05-21  1:52 thatcadguy at gmail dot com
  2014-05-21  1:52 ` [Bug fortran/61261] " thatcadguy at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: thatcadguy at gmail dot com @ 2014-05-21  1:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61261
           Summary: [OOP] Segfault on source-allocating polymorphic
                    variables
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thatcadguy at gmail dot com

Created attachment 32835
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32835&action=edit
Test source file

The attached code produces a segfault on Ubuntu 14.04 with gfortran 4.8.2. I
think this may be related to an existing bug, but not sure.

MODULE modu

IMPLICIT NONE

TYPE element
 CLASS(*), ALLOCATABLE :: e
END TYPE element

CONTAINS
 SUBROUTINE sub(el, p)
  TYPE(element), INTENT(INOUT)  :: el
  CLASS(*), POINTER, INTENT(IN) :: p
  ALLOCATE(el%e, SOURCE = p)
 END SUBROUTINE sub
END MODULE modu

PROGRAM x

USE modu
IMPLICIT NONE

CHARACTER(LEN=80), TARGET :: c80
CLASS(*), POINTER :: p
TYPE(element) :: el

c80 = 'the quick brown fox jumps over the lazy dog'
p => c80
CALL  sub(el, p)

END PROGRAM x


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

end of thread, other threads:[~2015-08-07 20:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-21  1:52 [Bug fortran/61261] New: [OOP] Segfault on source-allocating polymorphic variables thatcadguy at gmail dot com
2014-05-21  1:52 ` [Bug fortran/61261] " thatcadguy at gmail dot com
2014-05-21  1:53 ` thatcadguy at gmail dot com
2014-05-21  1:55 ` thatcadguy at gmail dot com
2014-05-21  8:50 ` dominiq at lps dot ens.fr
2014-05-21 15:01 ` thatcadguy at gmail dot com
2014-05-21 21:18 ` jouko.orava at iki dot fi
2014-12-15 11:41 ` pault at gcc dot gnu.org
2015-08-07 20:16 ` 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).