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/81048] [6/7/8 Regression] incorrect derived type initialization


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |5.4.0
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2017-06-10
     Ever confirmed|0                           |1
            Summary|incorrect derived type      |[6/7/8 Regression]
                   |initialization              |incorrect derived type
                   |                            |initialization
      Known to fail|                            |6.3.0, 7.1.0, 8.0

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The change occurred between revisions r224647 (2015-06-19, OK) and r225925
(2015-07-17, wrong result).

Reduced test

program test
   type f
       integer :: f = -1
   end type
   type(f) :: a, b(3)
   write (*,*) ' a%f = ', a%f
   write (*,*) ' b(1:3)%f =  ', b(1:3)%f
   b = g2(a)
   write (*,*) '                     b = g(a) gives b(1:3)%f = ', b(1:3)%f
   b = g2(a)
   write (*,*) '                     b = g(a) gives b(1:3)%f = ', b(1:3)%f
contains
   function g2(a)
      type(f) :: a, g2(3)
      write (*,*) ' a%f = ', a%f
      write (*,*) ' g2(1:3)%f = ', g2(1:3)%f
      do j = 1, 3
         if (g2(j)%f == -1) then
             g2(j)%f = a%f - 1
         else
             g2(j)%f = a%f - 12345
         endif
      enddo
   end function g2
end program test

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