public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes
@ 2008-03-26 23:58 janis at gcc dot gnu dot org
2008-04-03 23:51 ` [Bug c/35712] " janis at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: janis at gcc dot gnu dot org @ 2008-03-26 23:58 UTC (permalink / raw)
To: gcc-bugs
Decimal floating point types support significant trailing zeroes to
specify how much precision a value has. Trailing zeroes are relevant
even for values of zero; for example, rounding 1.e-11dd to 10 places
after the decimal point results in 0.e-10dd.
The draft Technical Report N1241 for ISO/IEC TR 24732 doesn't specify
this directly, but section 9.5 "Formatted input/output specifiers"
shows expected output for five different representations of zero:
0, -0, 0.000000, 0e-07, and 0e+02.
Currently GCC converts all decimal float literal values of zero to
0.DF, 0.DD, or 0.DL.
I'm testing a patch to fix this but want a PR to record the issue.
--
Summary: decimal float literal constant zero loses significant
trailing zeroes
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: c
AssignedTo: janis at gcc dot gnu dot org
ReportedBy: janis at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35712
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/35712] decimal float literal constant zero loses significant trailing zeroes
2008-03-26 23:58 [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes janis at gcc dot gnu dot org
@ 2008-04-03 23:51 ` janis at gcc dot gnu dot org
2008-06-23 19:59 ` bergner at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: janis at gcc dot gnu dot org @ 2008-04-03 23:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from janis at gcc dot gnu dot org 2008-04-03 23:50 -------
Subject: Bug 35712
Author: janis
Date: Thu Apr 3 23:49:35 2008
New Revision: 133881
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133881
Log:
2008-04-03 Janis Johnson <janis187@us.ibm.com>
gcc/
PR c/35712
* dfp.c (decimal_from_decnumber): Retain trailing zeroes for
decimal-float literal constant zero.
testsuite/
PR c/35712
* gcc.dg/dfp/constants-zero.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/dfp/constants-zero.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dfp.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35712
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/35712] decimal float literal constant zero loses significant trailing zeroes
2008-03-26 23:58 [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes janis at gcc dot gnu dot org
2008-04-03 23:51 ` [Bug c/35712] " janis at gcc dot gnu dot org
@ 2008-06-23 19:59 ` bergner at gcc dot gnu dot org
2008-09-11 16:57 ` janis at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: bergner at gcc dot gnu dot org @ 2008-06-23 19:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from bergner at gcc dot gnu dot org 2008-06-23 19:59 -------
Janis, is this fixed so we can close this bugzilla?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35712
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/35712] decimal float literal constant zero loses significant trailing zeroes
2008-03-26 23:58 [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes janis at gcc dot gnu dot org
2008-04-03 23:51 ` [Bug c/35712] " janis at gcc dot gnu dot org
2008-06-23 19:59 ` bergner at gcc dot gnu dot org
@ 2008-09-11 16:57 ` janis at gcc dot gnu dot org
2008-09-11 16:58 ` janis at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: janis at gcc dot gnu dot org @ 2008-09-11 16:57 UTC (permalink / raw)
To: gcc-bugs
--
janis at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-09-11 16:55:59
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35712
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/35712] decimal float literal constant zero loses significant trailing zeroes
2008-03-26 23:58 [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes janis at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-09-11 16:57 ` janis at gcc dot gnu dot org
@ 2008-09-11 16:58 ` janis at gcc dot gnu dot org
2008-09-18 18:36 ` janis at gcc dot gnu dot org
2009-06-26 18:24 ` rguenth at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: janis at gcc dot gnu dot org @ 2008-09-11 16:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from janis at gcc dot gnu dot org 2008-09-11 16:56 -------
Fixed in mainline. It's not a regression so the fix has not been applied to
4.3.
--
janis at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35712
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/35712] decimal float literal constant zero loses significant trailing zeroes
2008-03-26 23:58 [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes janis at gcc dot gnu dot org
` (3 preceding siblings ...)
2008-09-11 16:58 ` janis at gcc dot gnu dot org
@ 2008-09-18 18:36 ` janis at gcc dot gnu dot org
2009-06-26 18:24 ` rguenth at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: janis at gcc dot gnu dot org @ 2008-09-18 18:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from janis at gcc dot gnu dot org 2008-09-18 18:35 -------
Subject: Bug 35712
Author: janis
Date: Thu Sep 18 18:33:58 2008
New Revision: 140466
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140466
Log:
Backport from mainline:
2008-04-03 Janis Johnson <janis187@us.ibm.com>
gcc/
PR c/35712
* dfp.c (decimal_from_decnumber): Retain trailing zeroes for
decimal-float literal constant zero.
testsuite/
PR c/35712
* gcc.dg/dfp/constants-zero.c: New test.
Added:
branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/dfp/constants-zero.c
Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/dfp.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35712
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/35712] decimal float literal constant zero loses significant trailing zeroes
2008-03-26 23:58 [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes janis at gcc dot gnu dot org
` (4 preceding siblings ...)
2008-09-18 18:36 ` janis at gcc dot gnu dot org
@ 2009-06-26 18:24 ` rguenth at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-06-26 18:24 UTC (permalink / raw)
To: gcc-bugs
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.3.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35712
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-06-26 18:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-26 23:58 [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes janis at gcc dot gnu dot org
2008-04-03 23:51 ` [Bug c/35712] " janis at gcc dot gnu dot org
2008-06-23 19:59 ` bergner at gcc dot gnu dot org
2008-09-11 16:57 ` janis at gcc dot gnu dot org
2008-09-11 16:58 ` janis at gcc dot gnu dot org
2008-09-18 18:36 ` janis at gcc dot gnu dot org
2009-06-26 18:24 ` rguenth 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).