This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/28120] The option -f[no-]inline-functions is invalid with -O2
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jun 2006 10:06:04 -0000
- Subject: [Bug c/28120] The option -f[no-]inline-functions is invalid with -O2
- References: <bug-28120-1611@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from rguenth at gcc dot gnu dot org 2006-06-23 10:06 -------
Newer gcc always inline _static_ functions that are used _once_ into their only
caller (regardless of being declared inline or not). You can disable this
behavior with -fno-inline-functions-called-once.
All gcc inline small functions regardless of beind declared inline or not, if
-finline-functions is in effect (which it is automatically at -O3).
But... why do you care? The "inline" keyword is only a hint to the compiler,
not
something it has to obey to (or obey to the reverse case, where "inline" is not
specified). So yes, you cannot control what is inlined or what not. If you
need to for correctness, there's two function attributes,
__attribute__((noinline)) and __attribute__((always_inline)).
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28120