First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 15151
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Roger Hill-Cottingham <eesrjhc@bath.ac.uk>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15151 depends on: Show dependency tree
Show dependency graph
Bug 15151 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-04-30 15:45 Opened: 2004-04-26 15:31
$ 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

------- Comment #1 From Andrew Pinski 2004-04-27 21:09 -------
Can you test 3.4.0?

------- Comment #2 From Andrew Pinski 2004-04-27 21:09 -------
Can you test 3.4.0?

------- Comment #3 From bdavis9659@comcast.net 2004-04-28 00:33 -------
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
 

------- Comment #4 From Roger Hill-Cottingham 2004-04-30 15:11 -------
(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.

------- Comment #5 From Andrew Pinski 2004-04-30 15:20 -------
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).

------- Comment #6 From Wolfgang Bangerth 2004-04-30 15:45 -------
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. 

------- Comment #7 From Eric Botcazou 2004-05-02 07:49 -------
> 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.

------- Comment #8 From bdavis9659@comcast.net 2004-05-06 11:33 -------
proposed patch:

http://gcc.gnu.org/ml/fortran/2004-05/msg00038.html

------- Comment #9 From Mark Mitchell 2004-06-14 17:24 -------
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.

------- Comment #10 From Toon Moene 2004-06-19 11:12 -------
Fixed from 3.4.1 onwards by applying Bud Davis' patch to the 3.4 branch.

Thanks, Bud !

First Last Prev Next    No search results available      Search page      Enter new bug