public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77)
@ 2004-04-26 16:55 eesrjhc at bath dot ac dot uk
  2004-04-26 19:34 ` [Bug fortran/15151] " ebotcazou at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: eesrjhc at bath dot ac dot uk @ 2004-04-26 16:55 UTC (permalink / raw)
  To: gcc-bugs

$ 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

-- 
           Summary: -m64 flag causes incorrect logical i/o (g77)
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eesrjhc at bath dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.8
  GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug fortran/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
@ 2004-04-26 19:34 ` ebotcazou at gcc dot gnu dot org
  2004-04-27 21:57 ` [Bug libf2c/15151] " pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-04-26 19:34 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
  2004-04-26 19:34 ` [Bug fortran/15151] " ebotcazou at gcc dot gnu dot org
@ 2004-04-27 21:57 ` pinskia at gcc dot gnu dot org
  2004-04-27 22:11 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-27 21:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-27 21:09 -------
Can you test 3.4.0?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|fortran                     |libf2c


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
  2004-04-26 19:34 ` [Bug fortran/15151] " ebotcazou at gcc dot gnu dot org
  2004-04-27 21:57 ` [Bug libf2c/15151] " pinskia at gcc dot gnu dot org
@ 2004-04-27 22:11 ` pinskia at gcc dot gnu dot org
  2004-04-28  1:40 ` bdavis9659 at comcast dot net
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-27 22:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-27 21:09 -------
Can you test 3.4.0?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (2 preceding siblings ...)
  2004-04-27 22:11 ` pinskia at gcc dot gnu dot org
@ 2004-04-28  1:40 ` bdavis9659 at comcast dot net
  2004-04-30 15:51 ` [Bug fortran/15151] " eesrjhc at bath dot ac dot uk
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: bdavis9659 at comcast dot net @ 2004-04-28  1:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis9659 at comcast dot 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
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug fortran/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (3 preceding siblings ...)
  2004-04-28  1:40 ` bdavis9659 at comcast dot net
@ 2004-04-30 15:51 ` eesrjhc at bath dot ac dot uk
  2004-04-30 15:54 ` [Bug libf2c/15151] " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: eesrjhc at bath dot ac dot uk @ 2004-04-30 15:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From eesrjhc at bath dot ac dot uk  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.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libf2c                      |fortran


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (4 preceding siblings ...)
  2004-04-30 15:51 ` [Bug fortran/15151] " eesrjhc at bath dot ac dot uk
@ 2004-04-30 15:54 ` pinskia at gcc dot gnu dot org
  2004-04-30 15:57 ` bangerth at dealii dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-30 15:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  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).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |SUSPENDED
          Component|fortran                     |libf2c
   Target Milestone|---                         |tree-ssa


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (5 preceding siblings ...)
  2004-04-30 15:54 ` [Bug libf2c/15151] " pinskia at gcc dot gnu dot org
@ 2004-04-30 15:57 ` bangerth at dealii dot org
  2004-05-01 15:00 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: bangerth at dealii dot org @ 2004-04-30 15:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  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. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |toon at moene dot indiv dot
                   |                            |nluug dot nl
             Status|SUSPENDED                   |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-30 15:45:21
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (6 preceding siblings ...)
  2004-04-30 15:57 ` bangerth at dealii dot org
@ 2004-05-01 15:00 ` pinskia at gcc dot gnu dot org
  2004-05-02  7:49 ` ebotcazou at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-01 15:00 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|tree-ssa                    |3.4.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] -m64 flag causes incorrect logical i/o (g77)
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (7 preceding siblings ...)
  2004-05-01 15:00 ` pinskia at gcc dot gnu dot org
@ 2004-05-02  7:49 ` ebotcazou at gcc dot gnu dot org
  2004-05-06 11:33 ` [Bug libf2c/15151] incorrect logical i/o in 64-bit mode bdavis9659 at comcast dot net
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2004-05-02  7:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  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.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] incorrect logical i/o in 64-bit mode
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (8 preceding siblings ...)
  2004-05-02  7:49 ` ebotcazou at gcc dot gnu dot org
@ 2004-05-06 11:33 ` bdavis9659 at comcast dot net
  2004-06-14 17:25 ` [Bug libf2c/15151] [g77] " mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: bdavis9659 at comcast dot net @ 2004-05-06 11:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bdavis9659 at comcast dot net  2004-05-06 11:33 -------
proposed patch:

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

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] [g77] incorrect logical i/o in 64-bit mode
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (9 preceding siblings ...)
  2004-05-06 11:33 ` [Bug libf2c/15151] incorrect logical i/o in 64-bit mode bdavis9659 at comcast dot net
@ 2004-06-14 17:25 ` mmitchel at gcc dot gnu dot org
  2004-06-19 11:12 ` toon at moene dot indiv dot nluug dot nl
  2004-06-19 15:53 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-14 17:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  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.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.1                       |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] [g77] incorrect logical i/o in 64-bit mode
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (10 preceding siblings ...)
  2004-06-14 17:25 ` [Bug libf2c/15151] [g77] " mmitchel at gcc dot gnu dot org
@ 2004-06-19 11:12 ` toon at moene dot indiv dot nluug dot nl
  2004-06-19 15:53 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: toon at moene dot indiv dot nluug dot nl @ 2004-06-19 11:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From toon at moene dot indiv dot nluug dot nl  2004-06-19 11:12 -------
Fixed from 3.4.1 onwards by applying Bud Davis' patch to the 3.4 branch.

Thanks, Bud !

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug libf2c/15151] [g77] incorrect logical i/o in 64-bit mode
  2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
                   ` (11 preceding siblings ...)
  2004-06-19 11:12 ` toon at moene dot indiv dot nluug dot nl
@ 2004-06-19 15:53 ` pinskia at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-19 15:53 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15151


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-06-19 15:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-26 16:55 [Bug fortran/15151] New: -m64 flag causes incorrect logical i/o (g77) eesrjhc at bath dot ac dot uk
2004-04-26 19:34 ` [Bug fortran/15151] " ebotcazou at gcc dot gnu dot org
2004-04-27 21:57 ` [Bug libf2c/15151] " pinskia at gcc dot gnu dot org
2004-04-27 22:11 ` pinskia at gcc dot gnu dot org
2004-04-28  1:40 ` bdavis9659 at comcast dot net
2004-04-30 15:51 ` [Bug fortran/15151] " eesrjhc at bath dot ac dot uk
2004-04-30 15:54 ` [Bug libf2c/15151] " pinskia at gcc dot gnu dot org
2004-04-30 15:57 ` bangerth at dealii dot org
2004-05-01 15:00 ` pinskia at gcc dot gnu dot org
2004-05-02  7:49 ` ebotcazou at gcc dot gnu dot org
2004-05-06 11:33 ` [Bug libf2c/15151] incorrect logical i/o in 64-bit mode bdavis9659 at comcast dot net
2004-06-14 17:25 ` [Bug libf2c/15151] [g77] " mmitchel at gcc dot gnu dot org
2004-06-19 11:12 ` toon at moene dot indiv dot nluug dot nl
2004-06-19 15:53 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).