summaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-11 16:25:05 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-11 16:25:05 +0000
commitedd2f2aec757fc4e8c1bae048a0735785eeb6443 (patch)
tree965a5479e4bfdccd120057916613030f604465fc /gcc/doc
parent8a21fed413cd1fb67ba70fbac5d493ec573630a2 (diff)
downloadgcc-edd2f2aec757fc4e8c1bae048a0735785eeb6443.tar.gz
* config/rs6000/rs6000.c (rs6000_default_long_calls,
rs6000_longcall_switch, rs6000_set_default_type_attributes): New. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Set it. (rs6000_override_options): Handle -m(no-)longcall. (init_cumulative_args, output_mi_thunk): Check for both longcall and shortcall attributes on the function. (rs6000_attribute_table): Add "shortcall". (rs6000_handle_longcall_attribute): Update comment. (altivec_expand_unop_builtin, altivec_expand_binop_builtin, altivec_expand_ternop_builtin): Add default clauses to switches to silence warnings. * config/rs6000/rs6000.h: Declare rs6000_longcall_switch and rs6000_default_long_calls. Define REGISTER_TARGET_PRAGMAS. (TARGET_OPTIONS): Add longcall and no-longcall. * config/rs6000/rs6000.md (call_nonlocal_sysv, call_value_nonlocal_sysv): Split by alternatives. One pair accepts only SYMBOL_REFs and rejects if CALL_LONG is set in the call cookie. The other pair accepts only LR/CTR and has no restriction. * config.gcc (rs6000-*-* | powerpc*-*-* trailer stanza): Set c_target_objs, cxx_target_objs; add t-rs6000-c-rule to tmake_file. * config/rs6000/rs6000-c.c: New file. * config/rs6000/t-rs6000-c-rule: New file. * config/rs6000/rs6000-protos.c: Add multiple-include guard. Prototype rs6000_pragma_longcall. * doc/extend.texi: Document shortcall attribute. * doc/invoke.texi: Document -mlongcall, -mno-longcall. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53382 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi35
-rw-r--r--gcc/doc/invoke.texi18
2 files changed, 49 insertions, 4 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 2545acfa23b..b27bec4c3bf 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2273,12 +2273,17 @@ useful to override the effects of the @option{-mrtd} switch.
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.
+compiler to always call this function via a pointer, just as it would if
+the @option{-mlongcall} option had been specified. The @code{shortcall}
+attribute causes the compiler not to do this. These attributes override
+both the @option{-mlongcall} switch and the @code{#pragma longcall}
+setting.
+
+@xref{RS/6000 and PowerPC Options}, for more information on when long
+calls are and are not necessary.
@item long_call/short_call
@cindex indirect calls on ARM
@@ -5992,6 +5997,7 @@ for further explanation.
@menu
* ARM Pragmas::
+* RS/6000 and PowerPC Pragmas::
* Darwin Pragmas::
* Solaris Pragmas::
* Tru64 Pragmas::
@@ -6020,6 +6026,27 @@ 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. This pragma overrides the @option{-mlongcall}
+option, but not the @code{longcall} and @code{shortcall} attributes.
+@xref{RS/6000 and PowerPC Options}, for more information about when long
+calls are and are not necessary.
+
+@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
+
@c Describe c4x pragmas here.
@c Describe h8300 pragmas here.
@c Describe i370 pragmas here.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index d422bf2ecbf..68b888fca94 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6817,6 +6817,24 @@ All modules should be compiled with the same @option{-G @var{num}} value.
On System V.4 and embedded PowerPC systems do (do not) emit register
names in the assembly language output using symbolic forms.
+@item -mlongcall
+@itemx -mno-longcall
+@opindex mlongcall
+@opindex mno-longcall
+Default to making all function calls via pointers, so that functions
+which reside further than 64 megabytes (67,108,864 bytes) from the
+current location can be called. This setting can be overridden by the
+@code{shortcall} function attribute, or by @code{#pragma longcall(0)}.
+
+Some linkers are capable of detecting out-of-range calls and generating
+glue code on the fly. On these systems, long calls are unnecessary and
+generate slower code. As of this writing, the AIX linker can do this,
+as can the GNU linker for PowerPC/64. It is planned to add this feature
+to the GNU linker for 32-bit PowerPC systems as well.
+
+In the future, we may cause GCC to ignore all longcall specifications
+when the linker is known to generate glue.
+
@item -pthread
@opindex pthread
Adds support for multithreading with the @dfn{pthreads} library.