[wwwdocs] gcc-13/changes.html: Document C++ -fexcess-precision=standard
Checks
Commit Message
Hi!
Martin Liska mentioned that porting_to.html doesn't mention
the C++ excess precision changes. Not really sure if porting_to
should document those, but I think changes.html certainly should.
And perhaps porting_to could have some examples and link to this
spot in changes.
Ok for wwwdocs?
Jakub
Comments
On Thu, 9 Feb 2023, Jakub Jelinek wrote:
> Martin Liska mentioned that porting_to.html doesn't mention
> the C++ excess precision changes. Not really sure if porting_to
> should document those, but I think changes.html certainly should.
Do you think this is a widely spread issue for existing software? Did
it materialize a couple of times building/testing Fedora with GCC 13
snapshots (assuming you have done so as in the past)?
> Ok for wwwdocs?
Yes, thank you! Two minor suggestions/questions below:
> --- a/htdocs/gcc-13/changes.html
> +++ b/htdocs/gcc-13/changes.html
> + <code>-fexcess-precision=fast</code>. The option affects mainly
Here I'd say "mainly affects".
> + IA-32/x86-64 where when defaulting to x87 math and in some cases on
> + Motorola 68000 <code>float</code> and <code>double</code> expressions
> + are evaluated in <code>long double</code> precision and S/390, System z,
> + IBM z Systems where <code>float</code> expressions are evaluated in
> + <code>double</code> precision.
The "where when" part proved a bit tricky for my brain. :-)
I think it is precise, but am wondering whether
...IA-32/x64 using x87 math and in some cases on Motorola 68000, where
<code>float</code> and <code>double</code> expressions are evaluated...
might work? What do you think?
Gerald
@@ -230,6 +230,21 @@ a work-in-progress.</p>
<h3 id="cxx">C++</h3>
<ul>
+ <li>Excess precision support (which has been available in C since GCC 4.5)
+ has been implemented for C++ as well. It is enabled by default
+ in strict standard modes like <code>-std=c++17</code>, where it
+ defaults to <code>-fexcess-precision=standard</code>, while in GNU
+ standard modes like <code>-std=gnu++20</code> it defaults to
+ <code>-fexcess-precision=fast</code>. The option affects mainly
+ IA-32/x86-64 where when defaulting to x87 math and in some cases on
+ Motorola 68000 <code>float</code> and <code>double</code> expressions
+ are evaluated in <code>long double</code> precision and S/390, System z,
+ IBM z Systems where <code>float</code> expressions are evaluated in
+ <code>double</code> precision. Also, on several architectures where
+ <code>std::float16_t</code> or <code>std::bfloat16_t</code> types
+ are supported those are evaluated in <code>float</code> precision.
+ <code>-fexcess-precision=fast</code> restores previous behavior.
+ </li>
<li>Several C++23 features have been implemented:
<ul>
<li><a href="https://wg21.link/p2324">P2324R1</a>, Labels at the end of