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/69834] New: Collision in derived type hashes


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

            Bug ID: 69834
           Summary: Collision in derived type hashes
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pault at gcc dot gnu.org
  Target Milestone: ---

As reported by James van Buskirk on clf
https://groups.google.com/forum/#!topic/comp.lang.fortran/0bm3E5xJpkM

module types
   implicit none
   type CS5SS
      integer x
      real y
   end type CS5SS
   type SQS3C
      logical u
      character(7) v
   end type SQS3C
   contains
      subroutine sub(x)
         class(*), allocatable :: x
         select type(x)
            type is(CS5SS)
               write(*,'(a)') 'TYPE IS CS5SS'
            type is(SQS3C)
               write(*,'(a)') 'TYPE IS SQS3C'
            class default
               write(*,'(a)') 'TYPE could not be determined'
         end select
      end subroutine sub
end module types

program test
   use types
   implicit none
   class(*), allocatable :: u1, u2

   allocate(u1,source = CS5SS(2,1.414))
   allocate(u2,source = SQS3C(.TRUE.,'Message'))
   call sub(u1)
   call sub(u2)
end program test

Both derived types have the hash value 43152863.

Paul

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