[PATCH] Fix leading zero with g0 editing
Jerry DeLisle
jvdelisle@charter.net
Sun Nov 22 21:44:00 GMT 2015
This minor patch brings the leading zero to emitting floats with g0 editing by
moving the block of code up a little before the g0 is handled. This has been
lurking in my trunk for several moths and I would like to get it out of the way.
Updated Test case also.
Regression tested on x86-64-linux.
OK for trunk?
Jerry
2015-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* io/write_float.def (output_float): Move block determining
room for leading zero to before checkng g0 formatting.
Index: fmt_g0_1.f08
===================================================================
--- fmt_g0_1.f08 (revision 230725)
+++ fmt_g0_1.f08 (working copy)
@@ -8,9 +8,9 @@
write(buffer, string) ':',0,':'
if (buffer.ne.":0:") call abort
write(buffer, string) ':',1.0_8/3.0_8,':'
- if (buffer.ne.":.33333333333333331:") call abort
+ if (buffer.ne.":0.33333333333333331:") call abort
write(buffer, '(1x,a,g0,a)') ':',1.0_8/3.0_8,':'
- if (buffer.ne." :.33333333333333331:") call abort
+ if (buffer.ne." :0.33333333333333331:") call abort
write(buffer, string) ':',"hello",':'
if (buffer.ne.":hello:") call abort
write(buffer, "(g0,g0,g0,g0)") ':',.true.,.false.,':'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: write_float.diff
Type: text/x-patch
Size: 1169 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151122/16f6820f/attachment.bin>
More information about the Gcc-patches
mailing list