public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/94587] Intrinsics optimization bug with -O2 -march=skylake-avx512
Date: Tue, 14 Apr 2020 18:51:45 +0000	[thread overview]
Message-ID: <bug-94587-4-qZjOw3V3Uu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94587-4@http.gcc.gnu.org/bugzilla/>

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

  parent reply	other threads:[~2020-04-14 18:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 21:28 [Bug rtl-optimization/94587] New: " lopresti at gmail dot com
2020-04-14  6:47 ` [Bug target/94587] " marxin at gcc dot gnu.org
2020-04-14  9:27 ` jakub at gcc dot gnu.org
2020-04-14 15:25 ` lopresti at gmail dot com
2020-04-14 18:51 ` pinskia at gcc dot gnu.org [this message]
2020-04-14 19:35 ` lopresti at gmail dot com
2020-04-14 20:44 ` pinskia at gcc dot gnu.org
2020-04-14 20:47 ` jakub at gcc dot gnu.org
2020-04-14 21:33 ` lopresti at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94587-4-qZjOw3V3Uu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).