[Bug fortran/55978] [4.8 Regression] class_optional_2.f90 -Os fails

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 5 21:26:00 GMT 2013


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

--- Comment #12 from janus at gcc dot gnu.org 2013-02-05 21:25:09 UTC ---
Here is a further reduced test case, based on comment 1 and 3 (which are
basically identical):


program main
  implicit none

  integer, pointer :: y(:)

  y => null()
  call a4t2(y)

contains

 subroutine a4t2(x)
   integer, intent(in) :: x(4)
 end subroutine

end


It yields valgrind errors with all gfortran versions I tried (trunk, 4.7, 4.6
and 4.3):

==5664== Conditional jump or move depends on uninitialised value(s)
==5664==    at 0x4F25F05: _gfortran_internal_pack (in_pack_generic.c:53)
==5664==    by 0x40076E: MAIN__ (in /home/jweil/GSoC/PRs/55978/a.out)
==5664==    by 0x4007CA: main (in /home/jweil/GSoC/PRs/55978/a.out)


So it seems this is not an actual regression?!? class_optional_2.f90 was
introduced only in 4.8, and possibly r195125 only uncovered an existing bug
(e.g. by adding a call to  _gfortran_internal_pack).



More information about the Gcc-bugs mailing list