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]

Re: Patch/RFC: -mlongcall and #pragma longcall for PowerPC


On Mon, May 06, 2002 at 09:14:24PM +0100, Joseph S. Myers wrote:
> On Mon, 6 May 2002, Zack Weinberg wrote:
> 
> > There doesn't seem to be an established place in the manual to
> > document target-specific #pragmas.
> 
> extend.texi, alongside "ARM Pragmas", "Darwin Pragmas", "Solaris Pragmas"  
> and "Tru64 Pragmas".  This is documented in "Anatomy of a Target Back End"  
> in sourcebuild.texi.

Thanks.

===================================================================
Index: doc/extend.texi
--- doc/extend.texi	11 Apr 2002 21:33:31 -0000	1.69
+++ doc/extend.texi	6 May 2002 20:27:13 -0000
@@ -2273,12 +2273,15 @@ useful to override the effects of the @o
 The PowerPC compiler for Windows NT currently ignores the @code{cdecl}
 attribute.
 
-@item longcall
+@item longcall/shortcall
 @cindex functions called via pointer on the RS/6000 and PowerPC
 On the RS/6000 and PowerPC, the @code{longcall} attribute causes the
 compiler to always call the function via a pointer, so that functions
 which reside further than 64 megabytes (67,108,864 bytes) from the
-current location can be called.
+current location can be called.  The @code{shortcall} attribute causes
+the compiler not to do this.  Both attributes override the
+@option{-mlongcall} switch (@pxref{RS/6000 and PowerPC Options}) and the
+@code{#pragma longcall} setting.
 
 @item long_call/short_call
 @cindex indirect calls on ARM
@@ -5992,6 +5995,7 @@ for further explanation.
 
 @menu
 * ARM Pragmas::
+* RS/6000 and PowerPC Pragmas::
 * Darwin Pragmas::
 * Solaris Pragmas::
 * Tru64 Pragmas::
@@ -6019,6 +6023,28 @@ Set all subsequent functions to have the
 Do not affect the @code{long_call} or @code{short_call} attributes of
 subsequent functions.
 @end table
+
+@node RS/6000 and PowerPC Pragmas
+@subsection RS/6000 and PowerPC Pragmas
+
+The RS/6000 and PowerPC targets define one pragma for controlling
+whether or not the @code{longcall} attribute is added to function
+declarations by default.  @xref{Function Attributes}, for information
+about the effect of this attribute.
+
+@table @code
+@item longcall (1)
+@cindex pragma, longcall
+Apply the @code{longcall} attribute to all subsequent function
+declarations.
+
+@item longcall (0)
+Do not apply the @code{longcall} attribute to subsequent function
+declarations.
+@end table
+
+This pragma overrides the @option{-mlongcall} option (@pxref{RS/6000 and
+PowerPC Options}).
 
 @c Describe c4x pragmas here.
 @c Describe h8300 pragmas here.


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