$ cat pox.f LOGICAL LL LL=.TRUE. IF (LL) THEN WRITE(*,*)'TRUE ',LL ELSE WRITE(*,*)'FALSE ',LL ENDIF STOP END When compiled with: $ /usr/local/gcc-3.3.3/bin/g77 -Wall -m64 -o pox pox.f produces an executable that is linked thus: $ ldd ./pox libg2c.so.0 => /usr/local/gcc-3.3.3/lib/sparcv9//libg2c.so.0 libm.so.1 => /usr/lib/64/libm.so.1 libgcc_s.so.1 => /usr/local/gcc-3.3.3/lib/sparcv9//libgcc_s.so.1 libc.so.1 => /usr/lib/64/libc.so.1 libdl.so.1 => /usr/lib/64/libdl.so.1 /usr/platform/SUNW,Sun-Blade-100/lib/sparcv9/libc_psr.so.1 and produces this output: $ ./pox TRUE F If compiled without the -m64 flag, and the environment variable LD_LIBRARY_PATH is changed to /usr/local/gcc-3.3.3/lib (from /usr/local/gcc-3.3.3/lib/sparcv9) then the output is correct: $ ./pox TRUE T $ ldd ./pox libg2c.so.0 => /usr/local/gcc-3.3.3/lib//libg2c.so.0 libm.so.1 => /usr/lib/libm.so.1 libgcc_s.so.1 => /usr/local/gcc-3.3.3/lib//libgcc_s.so.1 libc.so.1 => /usr/lib/libc.so.1 libdl.so.1 => /usr/lib/libdl.so.1 /usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1 gcc built with: ../gcc-3.3.3/configure --prefix=/usr/local/gcc-3.3.3 \ --enable-languages=c,fortran,c++ make bootstrap su umask 022 make install
Can you test 3.4.0?
this snippet of code in wrtfmt.c looks suspect. wrt_L (Uint * n, int len, ftnlen sz) { int i; long x; if (sizeof (long) == sz) x = n->il; else if (sz == sizeof (char)) x = n->ic; else x = n->is; maybe should be something like this: if (sizeof (long) == sz) x = n->il; else if (sz == sizeof (longint) x = n->ili .... i do not have access to a SPARC system to debug this, but this may (or may not:) help someone else looking at this. regards, bud davis
(In reply to comment #2) > Can you test 3.4.0? Yes, and I get the same response: $ /usr/local/gcc-3.4.0/bin/g77 -m64 -o pox pox.f $ export LD_LIBRARY_PATH=/usr/local/gcc-3.4.0/lib/sparcv9 $ ./pox TRUE F Roger.
Okay thanks, I do not know if this is going to be fixed for g77 but it is already fixed if I read the source correctly for gfortran so suspending as fixed on the tree-ssa (which is the branch where gfortran is located right now).
Since 3.4.x is the last release branch on which g77 will be supported, it may make sense to fix it there even if it is not a regression. Let's let one of the g77 maintainers comment on this first, before we suspend this PR. W.
> i do not have access to a SPARC system to debug this, but this may (or may > not:) help someone else looking at this. I tried your patch but it doesn't seem to help. I also tried: Index: wrtfmt.c =================================================================== RCS file: /cvs/gcc/gcc/libf2c/libI77/wrtfmt.c,v retrieving revision 1.7 diff -u -r1.7 wrtfmt.c --- wrtfmt.c 2 Jun 2002 13:01:12 -0000 1.7 +++ wrtfmt.c 2 May 2004 07:42:27 -0000 @@ -251,11 +251,15 @@ wrt_L (Uint * n, int len, ftnlen sz) { int i; - long x; + longint x; if (sizeof (long) == sz) x = n->il; else if (sz == sizeof (char)) x = n->ic; +#ifdef Allow_TYQUAD + else if (sz == sizeof (longint)) + x = n->ili; +#endif else x = n->is; for (i = 0; i < len - 1; i++) with the same result.
proposed patch: http://gcc.gnu.org/ml/fortran/2004-05/msg00038.html
I've removed the target milestone, as this is not a regression. Toon -- that said, if you want to review and apply this patch for 3.4.1, go ahead.
Fixed from 3.4.1 onwards by applying Bud Davis' patch to the 3.4 branch. Thanks, Bud !