Description of problem: valgrind gives 'Conditional jump or move depends on uninitialised value' from within libgfortran.so.5.0.0 - for a simple fortran print statement Version-Release number of selected component (if applicable): gcc-gfortran-8.1.1-1.fc28.x86_64 How reproducible: always Steps to Reproduce: balay@asterix /home/balay/junk $ cat x.f program main integer i i = 5 print *, 'Test string',i end balay@asterix /home/balay/junk $ gfortran -g x.f Actual results: balay@asterix /home/balay/junk $ valgrind -q --tool=memcheck --leak-check=yes --num-callers=20 --track-origins=yes ./a.out ==28856== Conditional jump or move depends on uninitialised value(s) ==28856== at 0x506923E: ??? (in /usr/lib64/libgfortran.so.5.0.0) ==28856== by 0x5069623: ??? (in /usr/lib64/libgfortran.so.5.0.0) ==28856== by 0x506A5FD: ??? (in /usr/lib64/libgfortran.so.5.0.0) ==28856== by 0x506B344: ??? (in /usr/lib64/libgfortran.so.5.0.0) ==28856== by 0x4007A3: MAIN__ (x.f:4) ==28856== by 0x4007E9: main (x.f:5) ==28856== Uninitialised value was created by a stack allocation ==28856== at 0x50695E0: ??? (in /usr/lib64/libgfortran.so.5.0.0) ==28856== Test string 5 Expected results: no messages from valgrind Additional info: no such issue with 'GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)' on a different box. [also no valgrind messages with 'GNU Fortran (GCC) 7.2.0' built from source] Also - I get a better stack trace with gfortran 8.1 compiled from source bash-4.2$ valgrind -q --tool=memcheck --leak-check=yes --num-callers=20 --track-origins=yes ./a.out ==40486== Conditional jump or move depends on uninitialised value(s) ==40486== at 0x5057E3B: write_decimal.constprop.10 (write.c:808) ==40486== by 0x50581E3: write_integer (write.c:1351) ==40486== by 0x505905D: list_formatted_write_scalar (write.c:1865) ==40486== by 0x5059D34: _gfortrani_list_formatted_write (write.c:1943) ==40486== by 0x40083F: MAIN__ (x.f:4) ==40486== by 0x400885: main (x.f:5) ==40486== Uninitialised value was created by a stack allocation ==40486== at 0x50581B0: write_integer (write.c:1327) ==40486== Test string 5
Upstream bug here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84156 So probably a valgrind problem in the end?
The upstream PR closed as INVALID, so I'll do the same here.