https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94587

--- Comment #5 from Patrick J. LoPresti <lopresti at gmail dot com> ---
(In reply to Andrew Pinski from comment #4)
> 
> Note this is true even without using intrinsics really.  You can get the
> same behavior you are seeing with using standard C code.  

Yes, which is one reason I am using intrinsics: They provide deterministic
behavior on literally every compiler at every optimization level by default.
Except GCC when AVX512 is enabled, that is.

> > 
> > Wouldn't fp-contract be more appropriate as part of "-ffast-math"?
> 
> No.  This has been discussed many times and decided no.  

A ridiculous but not surprising decision.

> https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/Floating-point-implementation.
> html#Floating-point-implementation

Well, that page is wrong.

"Expressions are currently only contracted if -ffp-contract=fast,
-funsafe-math-optimizations or -ffast-math are used."

I did not use -ffp-contract=fast nor -funsafe-math-optimizations nor
-ffast-math. Yet the statements were contracted. So the documentation has a
bug.

More to the point, it does not answer the question I asked, which is what
options are required to get deterministic behavior from intrinsics.

So I suppose I have to re-read that chapter on every release, then search the
rest of the documentation to learn what the defaults are, to figure out whether
and how you broke something further? OK thanks

Reply via email to