doc/extend.texi: Put warning into documentation of attribute regparm.
authorKevin Ryde <user42@zip.com.au>
Tue, 20 May 2003 22:13:34 +0000 (22:13 +0000)
committerWolfgang Bangerth <bangerth@gcc.gnu.org>
Tue, 20 May 2003 22:13:34 +0000 (16:13 -0600)
Co-Authored-By: Wolfgang Bangerth <bangerth@dealii.org>
From-SVN: r67037

gcc/ChangeLog
gcc/doc/extend.texi

index 4ec04bfffd41e4bae875e306cdb7853792068c88..c99a4fdaa483f87b71f5ae500d676022095bcfe4 100644 (file)
@@ -1,3 +1,10 @@
+2003-05-20  Kevin Ryde <user42@zip.com.au>
+           Wolfgang Bangerth <bangerth@dealii.org>
+
+       PR/10355
+       * doc/extend.texi: Put a warning into the documentation
+       of attribute regparm.
+
 2003-05-20  Jason Merrill  <jason@redhat.com>
 
        * tree.c (expr_last): New fn.
index 6006f04f5741b091ed13841b85e385b04514b58d..dc9646ac5b5de00ca15e660216e0ed35adbf0791 100644 (file)
@@ -2368,6 +2368,7 @@ since it is known that the calling function loaded the correct value.
 Not all ELF targets support this attribute.
 
 @item regparm (@var{number})
+@cindex @code{regparm} attribute
 @cindex functions that are passed arguments in registers on the 386
 On the Intel 386, the @code{regparm} attribute causes the compiler to
 pass up to @var{number} integer arguments in registers EAX,
@@ -2375,6 +2376,16 @@ EDX, and ECX instead of on the stack.  Functions that take a
 variable number of arguments will continue to be passed all of their
 arguments on the stack.
 
+Beware that on some ELF systems this attribute is unsuitable for
+global functions in shared libraries with lazy binding (which is the
+default).  Lazy binding will send the first call via resolving code in
+the loader, which might assume EAX, EDX and ECX can be clobbered, as
+per the standard calling conventions.  Solaris 8 is affected by this.
+GNU systems with GLIBC 2.1 or higher, and FreeBSD, are believed to be
+safe since the loaders there save all registers.  (Lazy binding can be
+disabled with the linker or the loader if desired, to avoid the
+problem.)
+
 @item stdcall
 @cindex functions that pop the argument stack on the 386
 On the Intel 386, the @code{stdcall} attribute causes the compiler to