public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96535] New: GCC 10 ignoring function __attribute__ optimize for all x86
@ 2020-08-08 10:23 danielhanchen at gmail dot com
  2020-08-10  7:55 ` [Bug c++/96535] " crazylht at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: danielhanchen at gmail dot com @ 2020-08-08 10:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96535
           Summary: GCC 10 ignoring function __attribute__ optimize for
                    all x86
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danielhanchen at gmail dot com
  Target Milestone: ---

Hey GCC team!

In GCC 10.x, it seems like any argument to __attribute__((optimize(...)) is
ignored at the function level. GCC 9.x and previous do not have this issue. [Or
maybe only -funroll-loops is ignored not 100% sure]

Detailed example at: https://gcc.godbolt.org/z/PTK4WE

3 Scenarios

1. [GCC 10.2: -O2 -ffast-math -march=haswell -std=c++2a -fopenmp] +
[__attribute__((optimize("O2","fast-math","unroll-loops")))] DOES NOT unroll.

2. [GCC 10.2: -funroll-loops -O2 -ffast-math -march=haswell -std=c++2a
-fopenmp] + [__attribute__((optimize("O2","fast-math","unroll-loops")))] DOES
unroll.

3. [GCC 9.3:  -O2 -ffast-math -march=haswell -std=c++2a -fopenmp] +
[__attribute__((optimize("O2","fast-math","unroll-loops")))] DOES unroll.

It seems that in GCC 10.x, you have to place -funroll-loops in the compilation
string, and function level __attribute__s are ignored?

PS: Code in godbolt is a matrix multiplication kernel. It multiplies 1 column *
1 row of a matrix.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-08-25 18:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).