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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|REOPENED                    |RESOLVED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Patrick J. LoPresti from comment #3)
> That works; thank you. However...
> 
> I realize there is no formal spec for intrinsics. But when I use them, I
> expect deterministic behavior by default. This has been true on every
> compiler with every set of optimization and architecture flags I have ever
> used (GCC before AVX, many versions of Clang, many versions of the Intel
> compiler).
> 
> Also, the "-DHEISENBUG" example shows that simply adding a side-effect-free
> assert() changes the behavior. This seems... unfriendly... as a default.

Note this is true even without using intrinsics really.  You can get the same
behavior you are seeing with using standard C code.  

> 
> Wouldn't fp-contract be more appropriate as part of "-ffast-math"?

No.  This has been discussed many times and decided no.  

> 
> To my knowledge, no other compiler behaves this way. Are there any other
> options I need to ensure deterministic behavior for SSE intrinsics on GCC?
> Will there be more in the future? I do apologize if I missed the answer in
> the 1000-page GCC manual.

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

Reply via email to