This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

docs for 'register' keyword


This explains what the 'register' keyword does.

Tested with 'make info' on x86-linux.

-- 
Geoff Keating <geoffk@redhat.com>

===File ~/patches/gcc-docregister.patch=====================
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.15021
diff -p -u -p -r1.15021 ChangeLog
--- ChangeLog	30 Jul 2002 19:08:18 -0000	1.15021
+++ ChangeLog	31 Jul 2002 00:08:00 -0000
@@ -1,3 +1,8 @@
+2002-07-30  Geoffrey Keating  <geoffk@redhat.com>
+
+	* doc/extend.texi (Hints implementation): Document that GCC
+	mostly ignores `register'.
+
 2002-07-30  Richard Sandiford  <rsandifo@redhat.com>
 
 	* config/mips/mips.h (SUBTARGET_ASM_DEBUGGING_SPEC): Fix typo.
Index: doc/extend.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/extend.texi,v
retrieving revision 1.91
diff -p -u -p -r1.91 extend.texi
--- doc/extend.texi	29 Jul 2002 23:53:47 -0000	1.91
+++ doc/extend.texi	31 Jul 2002 00:08:01 -0000
@@ -248,6 +248,27 @@ of the same array (6.5.6).}
 @cite{The extent to which suggestions made by using the @code{register}
 storage-class specifier are effective (6.7.1).}
 
+The @code{register} specifier affects code generation only in these ways:
+
+@itemize @bullet
+@item
+When used as part of the register variable extension, see 
+@ref{Explicit Reg Vars}.
+
+@item
+When @option{-O0} is in use, the compiler allocates distinct stack
+memory for all variables that do not have the @code{register}
+storage-class specifier; if @code{register} is specified, the variable
+may have a shorter lifespan than the code would indicate and may never
+be placed in memory.
+
+@item
+On some rare x86 targets, @code{setjmp} doesn't save the registers in
+all circumstances.  In those cases, GCC doesn't allocate any variables
+in registers unless they are marked @code{register}.
+
+@end itemize
+
 @item
 @cite{The extent to which suggestions made by using the inline function
 specifier are effective (6.7.4).}
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]