This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/64787] New: Invalid code on sourced allocation of class(*) character string


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

            Bug ID: 64787
           Summary: Invalid code on sourced allocation of class(*)
                    character string
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antony at cosmologist dot info

On trunk

 module X
 contains

    subroutine AddCopy(C)
    class(*), intent(in) :: C
    class(*), pointer :: P
    allocate(P, source=C)
    end subroutine

 end module X

 program test
 use X

 call AddCopy('test string')

 end program test


compiles, but when compiled with -O3 this always gives me a Seg Fault when run
(and probably invalid code more generally).

It may be related to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44672


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]