This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] doc: discourage use of __attribute__((optimize())) in production code
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 13 Dec 2015 09:19:11 +0100
- Subject: [PATCH] doc: discourage use of __attribute__((optimize())) in production code
- Authentication-results: sourceware.org; auth=none
Many developers are still using __attribute__((optimize())) in
production code, although it quite broken.
* doc/extend.texi (Common Function Attributes) [optimize]:
Discourage use of the optimize attribute.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 883d9b334ab5..a1359f5579ce 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3021,10 +3021,8 @@ that affect more than one function.
@xref{Function Specific Option Pragmas}, for details about the
@samp{#pragma GCC optimize} pragma.
-This can be used for instance to have frequently-executed functions
-compiled with more aggressive optimization options that produce faster
-and larger code, while other functions can be compiled with less
-aggressive options.
+This attribute should only be used for debugging purposes. It is not
+suitable for production code.
@item pure
@cindex @code{pure} function attribute
--
Markus