public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/53051] New: I/O: Support reading floating-point numbers which use "Q" for the exponent
@ 2012-04-19 21:34 burnus at gcc dot gnu.org
2012-04-20 8:21 ` [Bug libfortran/53051] " jb at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-04-19 21:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53051
Bug #: 53051
Summary: I/O: Support reading floating-point numbers which use
"Q" for the exponent
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
CC: jvdelisle@gcc.gnu.org
gfortran supports since GCC 4.6 quadprecision on common hardware. Thus, users
started to expect that "q" works for the exponents, e.g., 4.0q0. (The "q" is a
vendor extension.)
In 4.7, the "q" became supported in the source code (with -Wreal-q-constant as
warning). Well, it seems as if we should to also support "q" in the library.
Cf. https://groups.google.com/forum/#!topic/comp.lang.fortran/rfDXj9VQRZM
Untested draft patch below.
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1138,2 +1138,4 @@ parse_real (st_parameter_dt *dtp, void *buffer, int
length)
case 'D':
+ case 'q':
+ case 'Q':
push_char (dtp, 'e');
@@ -1451,2 +1453,4 @@ read_real (st_parameter_dt *dtp, void * dest, int length)
case 'd':
+ case 'Q':
+ case 'q':
goto exp1;
@@ -1548,2 +1552,4 @@ read_real (st_parameter_dt *dtp, void * dest, int length)
case 'd':
+ case 'Q'
+ case 'q':
goto exp1;
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c
index aa41bc7..32c8b32 100644
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -1028,2 +1028,4 @@ found_digit:
case 'D':
+ case 'q':
+ case 'Q':
++p;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libfortran/53051] I/O: Support reading floating-point numbers which use "Q" for the exponent
2012-04-19 21:34 [Bug libfortran/53051] New: I/O: Support reading floating-point numbers which use "Q" for the exponent burnus at gcc dot gnu.org
@ 2012-04-20 8:21 ` jb at gcc dot gnu.org
2012-04-22 17:29 ` burnus at gcc dot gnu.org
2012-04-22 17:30 ` burnus at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: jb at gcc dot gnu.org @ 2012-04-20 8:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53051
Janne Blomqvist <jb at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-04-20
CC| |jb at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Janne Blomqvist <jb at gcc dot gnu.org> 2012-04-20 08:21:05 UTC ---
The argument against supporting this, I suppose, is that we never generate a
"Q|q" exponent on output.
As a result, the example in c.l.f doesn't try to parse something that was
previously written by formatting a floating point number, but rather a
hand-crafted string. IOW, it seems rather artificial.
That being said, it seems ifort supports it, so maybe we need to as well..
*sigh*.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libfortran/53051] I/O: Support reading floating-point numbers which use "Q" for the exponent
2012-04-19 21:34 [Bug libfortran/53051] New: I/O: Support reading floating-point numbers which use "Q" for the exponent burnus at gcc dot gnu.org
2012-04-20 8:21 ` [Bug libfortran/53051] " jb at gcc dot gnu.org
@ 2012-04-22 17:29 ` burnus at gcc dot gnu.org
2012-04-22 17:30 ` burnus at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-04-22 17:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53051
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-04-22 17:28:39 UTC ---
Author: burnus
Date: Sun Apr 22 17:28:34 2012
New Revision: 186675
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186675
Log:
2012-04-22 Tobias Burnus <burnus@net-b.de>
PR fortran/53051
* io/list_read.c (parse_real): Support "q" for the
exponential.
* io/read.c (read_f): Ditto.
2012-04-22 Tobias Burnus <burnus@net-b.de>
PR fortran/53051
* gfortran.dg/read_float_4.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/read_float_4.f90
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/list_read.c
trunk/libgfortran/io/read.c
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libfortran/53051] I/O: Support reading floating-point numbers which use "Q" for the exponent
2012-04-19 21:34 [Bug libfortran/53051] New: I/O: Support reading floating-point numbers which use "Q" for the exponent burnus at gcc dot gnu.org
2012-04-20 8:21 ` [Bug libfortran/53051] " jb at gcc dot gnu.org
2012-04-22 17:29 ` burnus at gcc dot gnu.org
@ 2012-04-22 17:30 ` burnus at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-04-22 17:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53051
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |burnus at gcc dot gnu.org
Resolution| |FIXED
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-04-22 17:30:02 UTC ---
FIXED on the 4.8 trunk.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-22 17:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19 21:34 [Bug libfortran/53051] New: I/O: Support reading floating-point numbers which use "Q" for the exponent burnus at gcc dot gnu.org
2012-04-20 8:21 ` [Bug libfortran/53051] " jb at gcc dot gnu.org
2012-04-22 17:29 ` burnus at gcc dot gnu.org
2012-04-22 17:30 ` burnus at gcc dot gnu.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).