Hi! On Fri, Feb 10, 2023 at 10:06:03AM +0100, Gerald Pfeifer wrote: > 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?
Thanks, committed with those tweaks. Martin would like to see some note in porting_to.html for it too, here is my attempt to do so: diff --git a/htdocs/gcc-13/porting_to.html b/htdocs/gcc-13/porting_to.html index 9a9a3147..5cbeefb6 100644 --- a/htdocs/gcc-13/porting_to.html +++ b/htdocs/gcc-13/porting_to.html @@ -120,5 +120,29 @@ the operand as an lvalue.<br> } </code></pre> +<h3 id="excess-precision">Excess precision changes</h3> +<p>GCC 13 implements in C++ <a href="changes.html#cxx">excess precision support</a> +which has been implemented just in the C front-end before. The new behavior is +enabled by default in <code>-std=c++</code><em>NN</em> modes and when +<code>FLT_EVAL_METHOD</code> is 1 or 2 affects behavior of floating point +constants and expressions. E.g. for <code>FLT_EVAL_METHOD</code> equal +to 2 on ia32: + +<pre><code> +#include <stdlib.h> +void foo (void) { if (1.1f + 3.3f != 1.1L + 3.3L) abort (); } +void bar (void) { double d = 4.2; if (d == 4.2) abort (); } +</code></pre> + +will not abort with standard excess precision, because constants and expressions +in <code>float</code> or <code>double</code> are evaluated in precision of +<code>long double</code> and demoted only on casts or assignments, but will +abort with fast excess precision, where whether something is evaluated in +precision of <code>long double</code> or not depends on what evaluations are +done in the i387 floating point stack or are spilled from it. + +The <code>-fexcess-precision=fast</code> option can be used to request the +previous behavior. + </body> </html> Jakub