------- Comment #6 from hp at gcc dot gnu dot org 2008-12-07 21:42 ------- I noticed something odd while looking at simulator traces: running the test-case streamio_1 at -O1 (passing) yielded a different execution path than at -O0 (failing) *in the library*. At -O0, no write system calls were done for that file but at -O1, I see libgfortran flushes and write calls. So, it looks like internal inconsistency rather than target system oddness.
Anyway, I've been somewhat blind. This gfortran.dg is a "torture-testsuite"; it iterates over -O0, -O1 etc. and most failures happen at -O0 *only* so it should not have take more than a glance to see that it cannot (for sane bugs) be a fault of the target system (e.g. the lseek implementation). Instead, I believe the observed internal inconsistency is due to a missing initialization on part of libgfortran, which should explain why this isn't visible on all systems. Running streamio_1 from r142537 at -O1 using valgrind on a native i686-unknown-linux-gnu (where FWIW no gfortran test FAILs) seems to support this theory: "env LD_LIBRARY_PATH=<copy this from your gfortran.log> valgrind -q ./streamio_1.exe" yields: --9635-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x55 ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF47: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x8048863: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF47: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x80488B9: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF4D: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x80488B9: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF58: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x80488B9: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF47: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x804890F: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF4D: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x804890F: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF58: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x804890F: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF47: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x8048965: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF4D: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x8048965: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF58: finalize_transfer (transfer.c:2962) ==9635== by 0x40ABFE0: _gfortran_st_write_done (transfer.c:3130) ==9635== by 0x8048965: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40AD378: data_transfer_init (transfer.c:2144) ==9635== by 0x40AE09D: _gfortran_st_read (transfer.c:3069) ==9635== by 0x80489A9: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF47: finalize_transfer (transfer.c:2962) ==9635== by 0x40AC0C0: _gfortran_st_read_done (transfer.c:3101) ==9635== by 0x8048A2A: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF4D: finalize_transfer (transfer.c:2962) ==9635== by 0x40AC0C0: _gfortran_st_read_done (transfer.c:3101) ==9635== by 0x8048A2A: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) ==9635== ==9635== Conditional jump or move depends on uninitialised value(s) ==9635== at 0x40ABF58: finalize_transfer (transfer.c:2962) ==9635== by 0x40AC0C0: _gfortran_st_read_done (transfer.c:3101) ==9635== by 0x8048A2A: MAIN__ (in /home/hp/gcc/o/gcc/testsuite/gfortran/streamio_1.exe) ==9635== by 0x8048ABA: main (fmain.c:21) (-v doesn't yield further details, but I'll attach -v output from valgrind when streamio_1 is linked static. Lots of interesting libgfortran-related information. :) So, I'll unassign myself from this PR, but will stand by for assistance. Jerry? -- hp at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|hp at gcc dot gnu dot org |unassigned at gcc dot gnu | |dot org Status|ASSIGNED |NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38430