This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/8861] [3.3/3.4 regression] [ABI] mangling floating point literal in template arg expression
- From: "rearnsha at arm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jun 2003 11:10:18 -0000
- Subject: [Bug c++/8861] [3.3/3.4 regression] [ABI] mangling floating point literal in template arg expression
- References: <20021207125600.8861.catherin@ca.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8861
------- Additional Comments From rearnsha@arm.com 2003-06-10 11:09 -------
Subject: Re: Revised patch - floating point literal mangling
+ Here are some examples, assuming the IEEE standard representation
+ for floating point numbers. (Spaces are for readability, not
+ part of the encoding.)
+
+ 1.0f Lf 3f80 0000 E
+ -1.0f Lf bf80 0000 E
+ 1.17549435e-38f Lf 0080 0000 E
+ 1.40129846e-45f Lf 0000 0001 E
+ 0.0f Lf 0000 0000 E"
+
What about issues related to accuracy of translation (rounding style,
excess precision etc). There are many floating point numbers where it is
hard if not impossible to guarantee that two independent implementations
will produce the same result. That effectively means that the ABI is
mandating something which is ambiguously specified.
I'm surprised, given that
template <int I> void f(A<I+int(1.234+1.234)> a) { ... }
and
template <int I> void f(A<I+int(2.468)> a) { ... }
don't mangle identically, that a representation of the literal *as it
appeared in the source* isn't used.
R.