This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA:] doc: mention asm ("") as method to keep noinline calls
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 Feb 2008 13:07:32 +0100
- Subject: Re: [RFA:] doc: mention asm ("") as method to keep noinline calls
> Date: Fri, 1 Feb 2008 14:41:43 +0100
> From: Hans-Peter Nilsson <hp@axis.com>
Here's an updated version, on request from Richi to mention
(special) side-effects and that the asm serves as one, tested
same way, same ChangeLog entry.
Ok to commit?
> Tested by "make dvi" and "make info" and inspected dvi and info output.
>
> * doc/extend.texi (Function Attributes) <noinline>: Mention
> asm ("") as method to keep calls.
Index: doc/extend.texi
===================================================================
--- doc/extend.texi (revision 130734)
+++ doc/extend.texi (working copy)
@@ -2513,6 +2513,17 @@ Functions with this attribute will not b
@cindex @code{noinline} function attribute
This function attribute prevents a function from being considered for
inlining.
+@c Don't enumerate the optimizations by name here; we try to be
+@c future-compatible with this mechanism.
+If the function does not have special side-effects, there are
+optimizations other than inlining that causes function calls to be
+optimized away, although the function call is live. To keep such
+calls from being optimized away, put
+@smallexample
+asm ("");
+@end smallexample
+(@pxref{Extended Asm}) in the called function, to serve as a special
+side-effect.
@item nonnull (@var{arg-index}, @dots{})
@cindex @code{nonnull} function attribute
brgds, H-P