public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/22217] New: Z edit descriptor with negative numbers
@ 2005-06-28 13:45 tkoenig at gcc dot gnu dot org
  2005-06-29 20:53 ` [Bug libfortran/22217] " fxcoudert at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-06-28 13:45 UTC (permalink / raw)
  To: gcc-bugs

$ cat foo3.f90
program main
  i = -1
  print '(Z8)',i
end program main
$ gfortran foo3.f90
$ ./a.out
********
$ gfortran -v
Using built-in specs.
Target: ia64-unknown-linux-gnu
Configured with: ../gcc-4.1-20050625/configure --prefix=/home/zfkts --enable-
languages=c,f95
Thread model: posix
gcc version 4.1.0 20050625 (experimental)

The output should be

FFFFFFFF

-- 
           Summary: Z edit descriptor with negative numbers
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug libfortran/22217] Z edit descriptor with negative numbers
  2005-06-28 13:45 [Bug libfortran/22217] New: Z edit descriptor with negative numbers tkoenig at gcc dot gnu dot org
@ 2005-06-29 20:53 ` fxcoudert at gcc dot gnu dot org
  2005-06-30  8:30 ` tkoenig at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-06-29 20:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-06-29 20:53 -------
Confirmed. This bug is due to my recent patch to support large integer kinds.
I'm thinking about how we should fix this.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-06-29 20:53:37
               date|                            |


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


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

* [Bug libfortran/22217] Z edit descriptor with negative numbers
  2005-06-28 13:45 [Bug libfortran/22217] New: Z edit descriptor with negative numbers tkoenig at gcc dot gnu dot org
  2005-06-29 20:53 ` [Bug libfortran/22217] " fxcoudert at gcc dot gnu dot org
@ 2005-06-30  8:30 ` tkoenig at gcc dot gnu dot org
  2005-07-05  7:52 ` fxcoudert at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-06-30  8:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tkoenig at gcc dot gnu dot org  2005-06-30 08:29 -------
It's probably easiest to have xtoa() and friends extract
the integer for themselves.

If you do this, don't forget to increase the size of buffer[]
so it can hold largest_integer_kind*8+1 characters for binary
representation.

Would it be possible to define a macro GFC_LARGEST_INTEGER_KIND 
in kinds.h?

-- 


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


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

* [Bug libfortran/22217] Z edit descriptor with negative numbers
  2005-06-28 13:45 [Bug libfortran/22217] New: Z edit descriptor with negative numbers tkoenig at gcc dot gnu dot org
  2005-06-29 20:53 ` [Bug libfortran/22217] " fxcoudert at gcc dot gnu dot org
  2005-06-30  8:30 ` tkoenig at gcc dot gnu dot org
@ 2005-07-05  7:52 ` fxcoudert at gcc dot gnu dot org
  2005-07-09 11:34 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-07-05  7:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-07-05 07:52 -------
For the GFC_LARGEST_INTEGER_KIND macro, there is already a GFC_INTEGER_LARGEST.
Or do you mean that GFC_LARGEST_INTEGER_KIND should be just 8 (or 16), not
GFC_INTEGER_8 (or GFC_INTEGER_16)?

As for this bug, the solution you mention was the one I thought of, but it means
changing prototypes. A better solution (at least, I think it is better) is to
have an extract_uint() function that does cast to GFC_UINTEGER_4 before casting
to GFC_UINTEGER_LARGEST.

Attached patch fixes the problem (for Z, O and B edit descriptors, with all kinds).

I'm leaving town tomorrow, won't have access to an internet connection and lots
of things to do before tomorrow. So, please feel free to test and commit this
patch! If nobody does it, I'll do it when I come back (in August).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
   Last reconfirmed|2005-06-29 20:53:37         |2005-07-05 07:52:45
               date|                            |


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


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

* [Bug libfortran/22217] Z edit descriptor with negative numbers
  2005-06-28 13:45 [Bug libfortran/22217] New: Z edit descriptor with negative numbers tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-07-05  7:52 ` fxcoudert at gcc dot gnu dot org
@ 2005-07-09 11:34 ` cvs-commit at gcc dot gnu dot org
  2005-07-09 15:13 ` [Bug libfortran/22217] [4.0 only] " pinskia at gcc dot gnu dot org
  2005-07-19  8:18 ` [Bug libfortran/22217] " fxcoudert at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-09 11:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-07-09 09:33 -------
Subject: Bug 22217

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tkoenig@gcc.gnu.org	2005-07-09 09:33:32

Modified files:
	libgfortran    : ChangeLog 
	libgfortran/io : write.c 
	libgfortran/runtime: error.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: negative-z-descriptor.f90 

Log message:
	2005-07-07  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
	Thomas Koenig  <Thomas.Koenig@online.de>
	
	PR libfortran/22217
	* io/write.c (extract_unit):  New function; extract
	ints as unsigned signed int of the correct size.
	* io/write.c (write_int):  Use it.
	* runtime/error.c:  Adjust copyright years.
	Adjust size of buffer to maximum that can occur.
	
	2005-07-07  Thomas Koenig  <Thomas.Koenig@online.de>
	
	PR libfortran/22217
	* gfortran.dg/negative-z-descriptor.f90:  New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.258&r2=1.259
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/write.c.diff?cvsroot=gcc&r1=1.39&r2=1.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/runtime/error.c.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5745&r2=1.5746
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/negative-z-descriptor.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug libfortran/22217] [4.0 only] Z edit descriptor with negative numbers
  2005-06-28 13:45 [Bug libfortran/22217] New: Z edit descriptor with negative numbers tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-07-09 11:34 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-09 15:13 ` pinskia at gcc dot gnu dot org
  2005-07-19  8:18 ` [Bug libfortran/22217] " fxcoudert at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-09 15:13 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Z edit descriptor with      |[4.0 only] Z edit descriptor
                   |negative numbers            |with negative numbers
   Target Milestone|---                         |4.0.2


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


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

* [Bug libfortran/22217] Z edit descriptor with negative numbers
  2005-06-28 13:45 [Bug libfortran/22217] New: Z edit descriptor with negative numbers tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-07-09 15:13 ` [Bug libfortran/22217] [4.0 only] " pinskia at gcc dot gnu dot org
@ 2005-07-19  8:18 ` fxcoudert at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-07-19  8:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-07-19 08:18 -------
No need to apply on 4.0 branch, since support for large kinds is only in
mainline. Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
            Summary|[4.0 only] Z edit descriptor|Z edit descriptor with
                   |with negative numbers       |negative numbers
   Target Milestone|4.0.2                       |4.1.0


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


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

end of thread, other threads:[~2005-07-19  8:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-28 13:45 [Bug libfortran/22217] New: Z edit descriptor with negative numbers tkoenig at gcc dot gnu dot org
2005-06-29 20:53 ` [Bug libfortran/22217] " fxcoudert at gcc dot gnu dot org
2005-06-30  8:30 ` tkoenig at gcc dot gnu dot org
2005-07-05  7:52 ` fxcoudert at gcc dot gnu dot org
2005-07-09 11:34 ` cvs-commit at gcc dot gnu dot org
2005-07-09 15:13 ` [Bug libfortran/22217] [4.0 only] " pinskia at gcc dot gnu dot org
2005-07-19  8:18 ` [Bug libfortran/22217] " fxcoudert 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).