public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline))
@ 2023-01-19 20:48 rth at gcc dot gnu.org
  2023-01-20  8:30 ` [Bug ipa/108470] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rth at gcc dot gnu.org @ 2023-01-19 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108470
           Summary: Missing documentation for alternate uses of
                    __attribute__((noinline))
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rth at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

The noinline attribute affects decisions made by ipa-split.cc
and ipa-icf.cc that are not immediately obvious.

At least the ipa-split choice affects code correctness for QEMU
(in that we expect __builtin_return_address to be used in very
specific contexts, and the transformation done by ipa-split
invalidates that).  Using noinline on the affected functions
prevents the ipa-split optimization and restores functionality.

It would be nice to document the effect, so that the workaround
is not affected in future gcc versions.

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

* [Bug ipa/108470] Missing documentation for alternate uses of __attribute__((noinline))
  2023-01-19 20:48 [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline)) rth at gcc dot gnu.org
@ 2023-01-20  8:30 ` rguenth at gcc dot gnu.org
  2023-02-09 11:40 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-20  8:30 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-01-20

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  'noinline' has historically disabled quite some IPA transforms (now
we have the more complete 'noipa').

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

* [Bug ipa/108470] Missing documentation for alternate uses of __attribute__((noinline))
  2023-01-19 20:48 [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline)) rth at gcc dot gnu.org
  2023-01-20  8:30 ` [Bug ipa/108470] " rguenth at gcc dot gnu.org
@ 2023-02-09 11:40 ` marxin at gcc dot gnu.org
  2023-02-09 11:53 ` rearnsha at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-02-09 11:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Apparently, we support 'noipa' attribute for more than 5 years and so it should
be used rather than noiline attribute. Or do you need to support an older
toolchain as well?

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

* [Bug ipa/108470] Missing documentation for alternate uses of __attribute__((noinline))
  2023-01-19 20:48 [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline)) rth at gcc dot gnu.org
  2023-01-20  8:30 ` [Bug ipa/108470] " rguenth at gcc dot gnu.org
  2023-02-09 11:40 ` marxin at gcc dot gnu.org
@ 2023-02-09 11:53 ` rearnsha at gcc dot gnu.org
  2023-02-09 12:46 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2023-02-09 11:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
The manual entry for this says "This attribute is supported mainly for the
purpose
of testing the compiler." which suggests a lack of long-term commitment to the
option.  Perhaps it would be better to remove that.

In some ways the analogy is with "-fast-math" which is a short-hand for a
number of other flags but not guaranteed to be only those options - although in
this case 'noipa' is, I think, intended to be conservatively safe.

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

* [Bug ipa/108470] Missing documentation for alternate uses of __attribute__((noinline))
  2023-01-19 20:48 [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline)) rth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-02-09 11:53 ` rearnsha at gcc dot gnu.org
@ 2023-02-09 12:46 ` marxin at gcc dot gnu.org
  2024-01-18 23:26 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-02-09 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Yes, noipa attribute is there for some time and I think we commit to support it
in the future.

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

* [Bug ipa/108470] Missing documentation for alternate uses of __attribute__((noinline))
  2023-01-19 20:48 [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline)) rth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-02-09 12:46 ` marxin at gcc dot gnu.org
@ 2024-01-18 23:26 ` cvs-commit at gcc dot gnu.org
  2024-01-18 23:28 ` sandra at gcc dot gnu.org
  2024-01-20 17:22 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-18 23:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Sandra Loosemore <sandra@gcc.gnu.org>:

https://gcc.gnu.org/g:9b6b7d615543d73381cb1f994825d9bca024c838

commit r14-8261-g9b6b7d615543d73381cb1f994825d9bca024c838
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Thu Jan 18 23:19:39 2024 +0000

    Improve documentation of noinline and noipa attributes [PR108470]

    gcc/ChangeLog
            PR ipa/108470
            * doc/extend.texi (Common Function Attributes): Document that
            noinline also disables some interprocedural optimizations and
            improve flow to the part about using inline asm instead to
            disable calls from being optimized away completely.  Remove the
            sentence that says noipa is mainly for internal compiler testing.

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

* [Bug ipa/108470] Missing documentation for alternate uses of __attribute__((noinline))
  2023-01-19 20:48 [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline)) rth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-01-18 23:26 ` cvs-commit at gcc dot gnu.org
@ 2024-01-18 23:28 ` sandra at gcc dot gnu.org
  2024-01-20 17:22 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: sandra at gcc dot gnu.org @ 2024-01-18 23:28 UTC (permalink / raw)
  To: gcc-bugs

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

sandra at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from sandra at gcc dot gnu.org ---
Fixed.

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

* [Bug ipa/108470] Missing documentation for alternate uses of __attribute__((noinline))
  2023-01-19 20:48 [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline)) rth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-01-18 23:28 ` sandra at gcc dot gnu.org
@ 2024-01-20 17:22 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-20 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

end of thread, other threads:[~2024-01-20 17:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 20:48 [Bug ipa/108470] New: Missing documentation for alternate uses of __attribute__((noinline)) rth at gcc dot gnu.org
2023-01-20  8:30 ` [Bug ipa/108470] " rguenth at gcc dot gnu.org
2023-02-09 11:40 ` marxin at gcc dot gnu.org
2023-02-09 11:53 ` rearnsha at gcc dot gnu.org
2023-02-09 12:46 ` marxin at gcc dot gnu.org
2024-01-18 23:26 ` cvs-commit at gcc dot gnu.org
2024-01-18 23:28 ` sandra at gcc dot gnu.org
2024-01-20 17:22 ` pinskia 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).