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

            Bug ID: 90355
           Summary: Uninitialized read in
                    gfortran.dg/ISO_Fortran_binding_4.f90 test
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sch...@linux-m68k.org
                CC: pault at gcc dot gnu.org
  Target Milestone: ---

The second argument of gfc_desc_to_cfi_desc is not fully initialized, the
initializer for the span field is missing.

$ valgrind ./ISO_Fortran_binding_4.exe 
==29601== Memcheck, a memory error detector
==29601== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==29601== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==29601== Command: ./ISO_Fortran_binding_4.exe
==29601== 
==29601== Conditional jump or move depends on uninitialised value(s)
==29601==    at 0x505E10D: _gfortran_cfi_desc_to_gfc_desc
(ISO_Fortran_binding.c:56)
==29601==    by 0x400882: ctg (ISO_Fortran_binding_4.f90:18)
==29601==    by 0x400A5F: p (ISO_Fortran_binding_4.f90:27)
==29601==    by 0x400A5F: main (ISO_Fortran_binding_4.f90:21)
==29601== 
==29601== Use of uninitialised value of size 8
==29601==    at 0x4008A4: ctg (ISO_Fortran_binding_4.f90:11)
==29601==    by 0x400A5F: p (ISO_Fortran_binding_4.f90:27)
==29601==    by 0x400A5F: main (ISO_Fortran_binding_4.f90:21)
==29601== 
 OK
==29601== Use of uninitialised value of size 8
==29601==    at 0x400917: ctg (ISO_Fortran_binding_4.f90:17)
==29601==    by 0x400A5F: p (ISO_Fortran_binding_4.f90:27)
==29601==    by 0x400A5F: main (ISO_Fortran_binding_4.f90:21)
==29601== 
==29601== Use of uninitialised value of size 8
==29601==    at 0x40091E: ctg (ISO_Fortran_binding_4.f90:17)
==29601==    by 0x400A5F: p (ISO_Fortran_binding_4.f90:27)
==29601==    by 0x400A5F: main (ISO_Fortran_binding_4.f90:21)
==29601== 
==29601== Conditional jump or move depends on uninitialised value(s)
==29601==    at 0x505E10D: _gfortran_cfi_desc_to_gfc_desc
(ISO_Fortran_binding.c:56)
==29601==    by 0x400A6E: p (ISO_Fortran_binding_4.f90:27)
==29601==    by 0x400A6E: main (ISO_Fortran_binding_4.f90:21)
==29601== 
==29601== 
==29601== HEAP SUMMARY:
==29601==     in use at exit: 0 bytes in 0 blocks
==29601==   total heap usage: 22 allocs, 22 frees, 13,944 bytes allocated
==29601== 
==29601== All heap blocks were freed -- no leaks are possible
==29601== 
==29601== For counts of detected and suppressed errors, rerun with: -v
==29601== Use --track-origins=yes to see where uninitialised values come from
==29601== ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 0 from 0)

Reply via email to