This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[g77] Patch for PR 15151 - incorrect logical I/O in 64 bit mode
- From: Bud Davis <bdavis9659 at comcast dot net>
- To: gfortran <fortran at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Cc: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Thu, 06 May 2004 06:31:40 -0500
- Subject: [g77] Patch for PR 15151 - incorrect logical I/O in 64 bit mode
This is not a regression. Due to the pending end-of-life for g77,
request this be considered for inclusion in 3.4.1.
On sparc when compiled with "-m64" every logical was printed as .FALSE.
Tested by the PR submitter on sparc with -m32 and -m64.
tested on i686/gnu/linux FC1 with no testsuite regressions.
no test suite file is provided. it would have to run on sparc, on
systems that support -m64, with -m64 option. i don't know how to do a
test suite file that does that, and i do not have a system to test it
with. some pointers/help would be welcome.
ChangeLog
2004-05-06 Bud Davis bdavis9659@comcast.net
PR f2c/15151
* libI77/wrtfmt.c(wrt_L): Make sizes and types consistent.
regards,
bud davis
Index: gcc/libf2c/libI77/wrtfmt.c
===================================================================
RCS file: /cvs/gcc/gcc/libf2c/libI77/wrtfmt.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 wrtfmt.c
*** gcc/libf2c/libI77/wrtfmt.c 2 Jun 2002 13:01:12 -0000 1.7
--- gcc/libf2c/libI77/wrtfmt.c 6 May 2004 11:02:45 -0000
*************** int
*** 251,263 ****
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;
for (i = 0; i < len - 1; i++)
(*f__putn) (' ');
if (x)
--- 251,269 ----
wrt_L (Uint * n, int len, ftnlen sz)
{
int i;
! longint x;
! #ifdef Allow_TYQUAD
! if (sizeof (longint) == sz)
! x = n->ili;
else
+ #endif
+ if (sizeof (short ) == sz)
x = n->is;
+ else if (sizeof (char) == sz)
+ x = n->ic;
+ else if (sizeof (integer) == sz)
+ x = n->il;
+
for (i = 0; i < len - 1; i++)
(*f__putn) (' ');
if (x)
Index: gcc/libf2c/libI77/wrtfmt.c
===================================================================
RCS file: /cvs/gcc/gcc/libf2c/libI77/wrtfmt.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 wrtfmt.c
*** gcc/libf2c/libI77/wrtfmt.c 2 Jun 2002 13:01:12 -0000 1.7
--- gcc/libf2c/libI77/wrtfmt.c 6 May 2004 11:02:45 -0000
*************** int
*** 251,263 ****
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;
for (i = 0; i < len - 1; i++)
(*f__putn) (' ');
if (x)
--- 251,269 ----
wrt_L (Uint * n, int len, ftnlen sz)
{
int i;
! longint x;
! #ifdef Allow_TYQUAD
! if (sizeof (longint) == sz)
! x = n->ili;
else
+ #endif
+ if (sizeof (short ) == sz)
x = n->is;
+ else if (sizeof (char) == sz)
+ x = n->ic;
+ else if (sizeof (integer) == sz)
+ x = n->il;
+
for (i = 0; i < len - 1; i++)
(*f__putn) (' ');
if (x)