http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55840
Bug #: 55840 Summary: valgrind errors in sparseset.h Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: objc AssignedTo: unassig...@gcc.gnu.org ReportedBy: tkoe...@gcc.gnu.org Created attachment 29068 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29068 valgrind errors from test case in initial comment Compiling the following test case with COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/home/ig25/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper Ziel: x86_64-unknown-linux-gnu Konfiguriert mit: ../trunk/configure --prefix=/home/ig25 --enable-languages=c,fortran --with-mpfr=/usr/local --with-gmp=/usr/local --with-mpc=/usr/local Thread-Modell: posix gcc-Version 4.8.0 20121231 (experimental) (GCC) module m_task implicit none private public tad_elemen, gele, vecino ! integer, parameter :: ngl = 3, nca = 4 ! integer, dimension (nca) :: koe, koi, koj integer, dimension (2*nca) :: coe, coi, coj ! type tad_elemen integer, dimension (nca) :: iele end type tad_elemen type (tad_elemen), dimension (:), pointer :: gele ! contains ! subroutine vecino (gele) type (tad_elemen), dimension (:), intent (inout) :: gele call troubletask (gele) end subroutine vecino ! subroutine troubletask (gele) type (tad_elemen), dimension (:), intent (in):: gele integer :: nel, nci, ncj integer :: l1, l2, h1, h2 integer :: lado, i, j ! nel = size (gele,dim=1) do i = 1, (nel - 1) koi = gele (i) % iele (1:nca) nci = count (koi>0) coi (1:2*nci) = [ koi(1:nci) , koi(1:nci) ] do j = (i+1), nel koj = gele (j) % iele (1:nca) ncj = count (koj > 0) coj (1:2*ncj) = [ koj(1:ncj), koj(1:ncj) ] lado = 0 ! !problematic loops do h1 = 1, nci if (coi (h1) < 1) cycle ! ICE if both are uncommented l1 = h1 + 1 do h2 = 1, ncj if (coj (h2) < 1) cycle ! ICE if both are uncommented l2 = h2 + 1 if (coi (h1) == coj (l2) .and. coi (l1) == coj (h2)) then lado = 1 exit end if end do ! h1 if (lado == 1) exit end do ! h2 ! end do ! j end do ! i ! end subroutine troubletask ! end module m_task ! program test use m_task implicit none print *, "trace 1 " allocate (gele(10)) call vecino (gele) print *, "trace 2 " end program gets a lot of valgrind errors in sparseset.h, which are attached. A few samples: > <static-var>Assembling functions: vecino==6337== Conditional jump or move depends on uninitialised value(s) ==6337== at 0xD70C6B: register_active_defs(df_ref_d**) (sparseset.h:147) ==6337== by 0xD70D02: _ZL14update_df_initP7rtx_defS0_.isra.15 (fwprop.c:895) ==6337== by 0xD71F1E: try_fwprop_subst(df_ref_d*, rtx_def**, rtx_def*, rtx_def*, bool) (fwprop.c:963) ==6337== by 0xD72388: forward_propagate_into(df_ref_d*) (fwprop.c:1337) ==6337== by 0xD728C7: fwprop() (fwprop.c:1474) ==6337== by 0x8C6D17: execute_one_pass(opt_pass*) (passes.c:2335) ==6337== by 0x8C7124: execute_pass_list(opt_pass*) (passes.c:2383) ==6337== by 0x8C7136: execute_pass_list(opt_pass*) (passes.c:2384) ==6337== by 0x696791: expand_function(cgraph_node*) (cgraphunit.c:1641) ==6337== by 0x698556: compile() (cgraphunit.c:1745) ==6337== by 0x698BF9: finalize_compilation_unit() (cgraphunit.c:2120) ==6337== by 0x861550: write_global_declarations() (langhooks.c:323) ==6337== ==6337== Use of uninitialised value of size 8 ==6337== at 0xD70C70: register_active_defs(df_ref_d**) (sparseset.h:147) ==6337== by 0xD70D02: _ZL14update_df_initP7rtx_defS0_.isra.15 (fwprop.c:895) ==6337== by 0xD71F1E: try_fwprop_subst(df_ref_d*, rtx_def**, rtx_def*, rtx_def*, bool) (fwprop.c:963) ==6337== by 0xD72388: forward_propagate_into(df_ref_d*) (fwprop.c:1337) ==6337== by 0xD728C7: fwprop() (fwprop.c:1474) ==6337== by 0x8C6D17: execute_one_pass(opt_pass*) (passes.c:2335) ==6337== by 0x8C7124: execute_pass_list(opt_pass*) (passes.c:2383) ==6337== by 0x8C7136: execute_pass_list(opt_pass*) (passes.c:2384) ==6337== by 0x696791: expand_function(cgraph_node*) (cgraphunit.c:1641) ==6337== by 0x698556: compile() (cgraphunit.c:1745) ==6337== by 0x698BF9: finalize_compilation_unit() (cgraphunit.c:2120) ==6337== by 0x861550: write_global_declarations() (langhooks.c:323)