public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "danielhanchen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/96535] [10/11 Regression] GCC 10 ignoring function __attribute__ optimize for all x86 since r11-1019
Date: Tue, 11 Aug 2020 10:22:38 +0000	[thread overview]
Message-ID: <bug-96535-4-Ee092iS2sb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96535-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Daniel Han-Chen <danielhanchen at gmail dot com> ---
Oh lolll I was just about to add a comment about further experimentation

Seems like Jakub and Hongtao have found the root cause of the issues?

Anyways what I was gonna write [probs not necessary anymore so no need to read]

"""
Anyways from more experimentation, it seems like O1, O2, O3 are not ignored,
but the unrolling only gets turned on via O3. So if one passes O1, O2 in
__attribute__, but the command line is O3, the function still unrolls.

For eg, when commandline is O3, in GCC 9, __attribute__((optimize("O1 / 2"))
causes code to use VMULPS and VADDPS with an unroll factor of 1.

However in GCC 10.x, when the commandline is O3, VMULPS and VADDPS is used
(optimize("O1/2")), however, unrolling is still done??? Passing
"no-unroll-loops" in attribute also does not work.

It seems like the commandline O3 overrides unrolling or something? The
resulting assembly does use VMULPS/VADDPS and not VFMADDPS for O1/O2, but O3
causes an unrolling factor of 6 or so [it should be 1]

https://gcc.godbolt.org/z/qb3d5M for new example.
"""

  parent reply	other threads:[~2020-08-11 10:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-08 10:23 [Bug c++/96535] New: GCC 10 ignoring function __attribute__ optimize for all x86 danielhanchen at gmail dot com
2020-08-10  7:55 ` [Bug c++/96535] " crazylht at gmail dot com
2020-08-11 10:09 ` [Bug c++/96535] [10/11 Regression] GCC 10 ignoring function __attribute__ optimize for all x86 since r11-1019 jakub at gcc dot gnu.org
2020-08-11 10:22 ` danielhanchen at gmail dot com [this message]
2020-08-11 10:45 ` [Bug tree-optimization/96535] " jakub at gcc dot gnu.org
2020-08-11 10:45 ` jakub at gcc dot gnu.org
2020-08-11 11:28 ` marxin at gcc dot gnu.org
2020-08-11 13:36 ` jakub at gcc dot gnu.org
2020-08-11 14:04 ` guojiufu at gcc dot gnu.org
2020-08-12 15:02 ` cvs-commit at gcc dot gnu.org
2020-08-25 17:45 ` [Bug tree-optimization/96535] [10 " cvs-commit at gcc dot gnu.org
2020-08-25 18:24 ` jakub at gcc dot gnu.org

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-96535-4-Ee092iS2sb@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).