The following program produces incorrect output when compiled with the current gfortran from the gomp branch, but correct output when run with current mainline gfortran:
program test implicit none character(len=80) :: filename logical :: file_present filename="testfile" inquire(file=trim(filename),exist=file_present) print *,file_present end /scratch/test/test2>ls a.out* test.f90 /scratch/test/test2>source ~/bin/enable_ugccgomp.csh /scratch/test/test2>gfortran -v test.f90 Driving: gfortran -v test.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc Using built-in specs. Target: i686-pc-linux-gnu Configured with: /scratch/gompcc/configure --quiet --prefix=/scratch/ugccgomp --enable-languages=c++,fortran --with-gmp=/afs/mpa/data/martin/mygmp --disable-checking Thread model: posix gcc version 4.1.0-gomp-20050608-branch 20051109 (experimental) (merged 20051109) /scratch/ugccgomp/libexec/gcc/i686-pc-linux-gnu/4.1.0-gomp-20050608-branch/f951 test.f90 -quiet -dumpbase test.f90 -mtune=pentiumpro -auxbase test -version -o /tmp/cc66JMtB.s GNU F95 version 4.1.0-gomp-20050608-branch 20051109 (experimental) (merged 20051109) (i686-pc-linux-gnu) compiled by GNU C version 4.1.0-gomp-20050608-branch 20051109 (experimental) (merged 20051109). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 as -V -Qy -o /tmp/cc00mDh1.o /tmp/cc66JMtB.s GNU assembler version 2.15 (i686-pc-linux-gnu) using BFD version 2.15 /scratch/ugccgomp/libexec/gcc/i686-pc-linux-gnu/4.1.0-gomp-20050608-branch/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /scratch/ugccgomp/lib/gcc/i686-pc-linux-gnu/4.1.0-gomp-20050608-branch/crtbegin.o -L/scratch/ugccgomp/lib/gcc/i686-pc-linux-gnu/4.1.0-gomp-20050608-branch -L/scratch/ugccgomp/lib/gcc/i686-pc-linux-gnu/4.1.0-gomp-20050608-branch/../../.. /tmp/cc00mDh1.o -lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /scratch/ugccgomp/lib/gcc/i686-pc-linux-gnu/4.1.0-gomp-20050608-branch/crtend.o /usr/lib/crtn.o /scratch/test/test2>./a.out T /scratch/test/test2>source ~/bin/enable_ugcc.csh /scratch/test/test2>gfortran -v test.f90 Driving: gfortran -v test.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc Using built-in specs. Target: i686-pc-linux-gnu Configured with: /scratch/gcc/configure --quiet --prefix=/afs/mpa/data/martin/ugcc --enable-languages=c++,fortran --with-gmp=/afs/mpa/data/martin/mygmp --disable-checking Thread model: posix gcc version 4.1.0 20051109 (experimental) /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.1.0/f951 test.f90 -quiet -dumpbase test.f90 -mtune=pentiumpro -auxbase test -version -o /tmp/cchwV3R4.s GNU F95 version 4.1.0 20051109 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 4.1.0 20051109 (experimental). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 as -V -Qy -o /tmp/ccaxTfO2.o /tmp/cchwV3R4.s GNU assembler version 2.15 (i686-pc-linux-gnu) using BFD version 2.15 /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.1.0/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0/crtbegin.o -L/afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0 -L/afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0/../../.. /tmp/ccaxTfO2.o -lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0/crtend.o /usr/lib/crtn.o /scratch/test/test2>./a.out F Any ideas what's happening here? -- Summary: [gomp-branch] wrong results for INQUIRE statement Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: martin at mpa-garching dot mpg dot de GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24774