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/32903] New: Default initializer and intent(OUT): default initializer not used


I found the following program on my disc; it might well belong to some PR, but
I could not find it anywhere in bugzilla.
I think the program is valid; due to the default initializer, it should print
"2" (as it does with g95, NAG f95, ifort, openf95), but gfortran prints "4".

The problem looks similar to PR31205 in so far that gfortran did the
initialization in the caller and not in the called procedure.

Dump:
set (x1) {  (void) 0; }

d.i = 4;
set (&d);


program test
  implicit none
  type data_type
    integer :: i=2
  end type data_type
  type(data_type) :: d
  d%i = 4
  call set(d)
  print *, d%i
contains
  subroutine set(x1)
    type(data_type),intent(out):: x1
  end subroutine set
end program test


-- 
           Summary: Default initializer and intent(OUT): default initializer
                    not used
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32903


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