OSDN Git Service

* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
[pf3gnuchains/gcc-fork.git] / gcc / doc / tm.texi
1 @c Copyright (C) 1988,1989,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001
2 @c Free Software Foundation, Inc.
3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi.
5
6 @node Target Macros
7 @chapter Target Description Macros
8 @cindex machine description macros
9 @cindex target description macros
10 @cindex macros, target description
11 @cindex @file{tm.h} macros
12
13 In addition to the file @file{@var{machine}.md}, a machine description
14 includes a C header file conventionally given the name
15 @file{@var{machine}.h}.  This header file defines numerous macros
16 that convey the information about the target machine that does not fit
17 into the scheme of the @file{.md} file.  The file @file{tm.h} should be
18 a link to @file{@var{machine}.h}.  The header file @file{config.h}
19 includes @file{tm.h} and most compiler source files include
20 @file{config.h}.
21
22 @menu
23 * Driver::              Controlling how the driver runs the compilation passes.
24 * Run-time Target::     Defining @samp{-m} options like @option{-m68000} and @option{-m68020}.
25 * Per-Function Data::   Defining data structures for per-function information.
26 * Storage Layout::      Defining sizes and alignments of data.
27 * Type Layout::         Defining sizes and properties of basic user data types.
28 * Registers::           Naming and describing the hardware registers.
29 * Register Classes::    Defining the classes of hardware registers.
30 * Stack and Calling::   Defining which way the stack grows and by how much.
31 * Varargs::             Defining the varargs macros.
32 * Trampolines::         Code set up at run time to enter a nested function.
33 * Library Calls::       Controlling how library routines are implicitly called.
34 * Addressing Modes::    Defining addressing modes valid for memory operands.
35 * Condition Code::      Defining how insns update the condition code.
36 * Costs::               Defining relative costs of different operations.
37 * Sections::            Dividing storage into text, data, and other sections.
38 * PIC::                 Macros for position independent code.
39 * Assembler Format::    Defining how to write insns and pseudo-ops to output.
40 * Debugging Info::      Defining the format of debugging output.
41 * Cross-compilation::   Handling floating point for cross-compilers.
42 * Mode Switching::      Insertion of mode-switching instructions.
43 * Misc::                Everything else.
44 @end menu
45
46 @node Driver
47 @section Controlling the Compilation Driver, @file{gcc}
48 @cindex driver
49 @cindex controlling the compilation driver
50
51 @c prevent bad page break with this line
52 You can control the compilation driver.
53
54 @table @code
55 @findex SWITCH_TAKES_ARG
56 @item SWITCH_TAKES_ARG (@var{char})
57 A C expression which determines whether the option @option{-@var{char}}
58 takes arguments.  The value should be the number of arguments that
59 option takes--zero, for many options.
60
61 By default, this macro is defined as
62 @code{DEFAULT_SWITCH_TAKES_ARG}, which handles the standard options
63 properly.  You need not define @code{SWITCH_TAKES_ARG} unless you
64 wish to add additional options which take arguments.  Any redefinition
65 should call @code{DEFAULT_SWITCH_TAKES_ARG} and then check for
66 additional options.
67
68 @findex WORD_SWITCH_TAKES_ARG
69 @item WORD_SWITCH_TAKES_ARG (@var{name})
70 A C expression which determines whether the option @option{-@var{name}}
71 takes arguments.  The value should be the number of arguments that
72 option takes--zero, for many options.  This macro rather than
73 @code{SWITCH_TAKES_ARG} is used for multi-character option names.
74
75 By default, this macro is defined as
76 @code{DEFAULT_WORD_SWITCH_TAKES_ARG}, which handles the standard options
77 properly.  You need not define @code{WORD_SWITCH_TAKES_ARG} unless you
78 wish to add additional options which take arguments.  Any redefinition
79 should call @code{DEFAULT_WORD_SWITCH_TAKES_ARG} and then check for
80 additional options.
81
82 @findex SWITCH_CURTAILS_COMPILATION
83 @item SWITCH_CURTAILS_COMPILATION (@var{char})
84 A C expression which determines whether the option @option{-@var{char}}
85 stops compilation before the generation of an executable.  The value is
86 boolean, non-zero if the option does stop an executable from being
87 generated, zero otherwise.
88
89 By default, this macro is defined as
90 @code{DEFAULT_SWITCH_CURTAILS_COMPILATION}, which handles the standard
91 options properly.  You need not define
92 @code{SWITCH_CURTAILS_COMPILATION} unless you wish to add additional
93 options which affect the generation of an executable.  Any redefinition
94 should call @code{DEFAULT_SWITCH_CURTAILS_COMPILATION} and then check
95 for additional options.
96
97 @findex SWITCHES_NEED_SPACES
98 @item SWITCHES_NEED_SPACES
99 A string-valued C expression which enumerates the options for which
100 the linker needs a space between the option and its argument.
101
102 If this macro is not defined, the default value is @code{""}.
103
104 @findex CPP_SPEC
105 @item CPP_SPEC
106 A C string constant that tells the GCC driver program options to
107 pass to CPP.  It can also specify how to translate options you
108 give to GCC into options for GCC to pass to the CPP.
109
110 Do not define this macro if it does not need to do anything.
111
112 @findex CPLUSPLUS_CPP_SPEC
113 @item CPLUSPLUS_CPP_SPEC
114 This macro is just like @code{CPP_SPEC}, but is used for C++, rather
115 than C.  If you do not define this macro, then the value of
116 @code{CPP_SPEC} (if any) will be used instead.
117
118 @findex NO_BUILTIN_SIZE_TYPE
119 @item NO_BUILTIN_SIZE_TYPE
120 If this macro is defined, the preprocessor will not define the built-in macro
121 @code{__SIZE_TYPE__}.  The macro @code{__SIZE_TYPE__} must then be defined
122 by @code{CPP_SPEC} instead.
123
124 This should be defined if @code{SIZE_TYPE} depends on target dependent flags
125 which are not accessible to the preprocessor.  Otherwise, it should not
126 be defined.
127
128 @findex NO_BUILTIN_PTRDIFF_TYPE
129 @item NO_BUILTIN_PTRDIFF_TYPE
130 If this macro is defined, the preprocessor will not define the built-in macro
131 @code{__PTRDIFF_TYPE__}.  The macro @code{__PTRDIFF_TYPE__} must then be
132 defined by @code{CPP_SPEC} instead.
133
134 This should be defined if @code{PTRDIFF_TYPE} depends on target dependent flags
135 which are not accessible to the preprocessor.  Otherwise, it should not
136 be defined.
137
138 @findex NO_BUILTIN_WCHAR_TYPE
139 @item NO_BUILTIN_WCHAR_TYPE
140 If this macro is defined, the preprocessor will not define the built-in macro
141 @code{__WCHAR_TYPE__}.  The macro @code{__WCHAR_TYPE__} must then be
142 defined by @code{CPP_SPEC} instead.
143
144 This should be defined if @code{WCHAR_TYPE} depends on target dependent flags
145 which are not accessible to the preprocessor.  Otherwise, it should not
146 be defined.
147
148 @findex NO_BUILTIN_WINT_TYPE
149 @item NO_BUILTIN_WINT_TYPE
150 If this macro is defined, the preprocessor will not define the built-in macro
151 @code{__WINT_TYPE__}.  The macro @code{__WINT_TYPE__} must then be
152 defined by @code{CPP_SPEC} instead.
153
154 This should be defined if @code{WINT_TYPE} depends on target dependent flags
155 which are not accessible to the preprocessor.  Otherwise, it should not
156 be defined.
157
158 @findex SIGNED_CHAR_SPEC
159 @item SIGNED_CHAR_SPEC
160 A C string constant that tells the GCC driver program options to
161 pass to CPP.  By default, this macro is defined to pass the option
162 @option{-D__CHAR_UNSIGNED__} to CPP if @code{char} will be treated as
163 @code{unsigned char} by @code{cc1}.
164
165 Do not define this macro unless you need to override the default
166 definition.
167
168 @findex CC1_SPEC
169 @item CC1_SPEC
170 A C string constant that tells the GCC driver program options to
171 pass to @code{cc1}, @code{cc1plus}, @code{f771}, and the other language
172 front ends.
173 It can also specify how to translate options you give to GCC into options
174 for GCC to pass to front ends.
175
176 Do not define this macro if it does not need to do anything.
177
178 @findex CC1PLUS_SPEC
179 @item CC1PLUS_SPEC
180 A C string constant that tells the GCC driver program options to
181 pass to @code{cc1plus}.  It can also specify how to translate options you
182 give to GCC into options for GCC to pass to the @code{cc1plus}.
183
184 Do not define this macro if it does not need to do anything.
185 Note that everything defined in CC1_SPEC is already passed to
186 @code{cc1plus} so there is no need to duplicate the contents of
187 CC1_SPEC in CC1PLUS_SPEC.
188
189 @findex ASM_SPEC
190 @item ASM_SPEC
191 A C string constant that tells the GCC driver program options to
192 pass to the assembler.  It can also specify how to translate options
193 you give to GCC into options for GCC to pass to the assembler.
194 See the file @file{sun3.h} for an example of this.
195
196 Do not define this macro if it does not need to do anything.
197
198 @findex ASM_FINAL_SPEC
199 @item ASM_FINAL_SPEC
200 A C string constant that tells the GCC driver program how to
201 run any programs which cleanup after the normal assembler.
202 Normally, this is not needed.  See the file @file{mips.h} for
203 an example of this.
204
205 Do not define this macro if it does not need to do anything.
206
207 @findex LINK_SPEC
208 @item LINK_SPEC
209 A C string constant that tells the GCC driver program options to
210 pass to the linker.  It can also specify how to translate options you
211 give to GCC into options for GCC to pass to the linker.
212
213 Do not define this macro if it does not need to do anything.
214
215 @findex LIB_SPEC
216 @item LIB_SPEC
217 Another C string constant used much like @code{LINK_SPEC}.  The difference
218 between the two is that @code{LIB_SPEC} is used at the end of the
219 command given to the linker.
220
221 If this macro is not defined, a default is provided that
222 loads the standard C library from the usual place.  See @file{gcc.c}.
223
224 @findex LIBGCC_SPEC
225 @item LIBGCC_SPEC
226 Another C string constant that tells the GCC driver program
227 how and when to place a reference to @file{libgcc.a} into the
228 linker command line.  This constant is placed both before and after
229 the value of @code{LIB_SPEC}.
230
231 If this macro is not defined, the GCC driver provides a default that
232 passes the string @option{-lgcc} to the linker.
233
234 @findex STARTFILE_SPEC
235 @item STARTFILE_SPEC
236 Another C string constant used much like @code{LINK_SPEC}.  The
237 difference between the two is that @code{STARTFILE_SPEC} is used at
238 the very beginning of the command given to the linker.
239
240 If this macro is not defined, a default is provided that loads the
241 standard C startup file from the usual place.  See @file{gcc.c}.
242
243 @findex ENDFILE_SPEC
244 @item ENDFILE_SPEC
245 Another C string constant used much like @code{LINK_SPEC}.  The
246 difference between the two is that @code{ENDFILE_SPEC} is used at
247 the very end of the command given to the linker.
248
249 Do not define this macro if it does not need to do anything.
250
251 @findex THREAD_MODEL_SPEC
252 @item THREAD_MODEL_SPEC
253 GCC @code{-v} will print the thread model GCC was configured to use.
254 However, this doesn't work on platforms that are multilibbed on thread
255 models, such as AIX 4.3.  On such platforms, define
256 @code{THREAD_MODEL_SPEC} such that it evaluates to a string without
257 blanks that names one of the recognized thread models.  @code{%*}, the
258 default value of this macro, will expand to the value of
259 @code{thread_file} set in @file{config.gcc}.
260
261 @findex EXTRA_SPECS
262 @item EXTRA_SPECS
263 Define this macro to provide additional specifications to put in the
264 @file{specs} file that can be used in various specifications like
265 @code{CC1_SPEC}.
266
267 The definition should be an initializer for an array of structures,
268 containing a string constant, that defines the specification name, and a
269 string constant that provides the specification.
270
271 Do not define this macro if it does not need to do anything.
272
273 @code{EXTRA_SPECS} is useful when an architecture contains several
274 related targets, which have various @code{@dots{}_SPECS} which are similar
275 to each other, and the maintainer would like one central place to keep
276 these definitions.
277
278 For example, the PowerPC System V.4 targets use @code{EXTRA_SPECS} to
279 define either @code{_CALL_SYSV} when the System V calling sequence is
280 used or @code{_CALL_AIX} when the older AIX-based calling sequence is
281 used.
282
283 The @file{config/rs6000/rs6000.h} target file defines:
284
285 @example
286 #define EXTRA_SPECS \
287   @{ "cpp_sysv_default", CPP_SYSV_DEFAULT @},
288
289 #define CPP_SYS_DEFAULT ""
290 @end example
291
292 The @file{config/rs6000/sysv.h} target file defines:
293 @smallexample
294 #undef CPP_SPEC
295 #define CPP_SPEC \
296 "%@{posix: -D_POSIX_SOURCE @} \
297 %@{mcall-sysv: -D_CALL_SYSV @} %@{mcall-aix: -D_CALL_AIX @} \
298 %@{!mcall-sysv: %@{!mcall-aix: %(cpp_sysv_default) @}@} \
299 %@{msoft-float: -D_SOFT_FLOAT@} %@{mcpu=403: -D_SOFT_FLOAT@}"
300
301 #undef CPP_SYSV_DEFAULT
302 #define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
303 @end smallexample
304
305 while the @file{config/rs6000/eabiaix.h} target file defines
306 @code{CPP_SYSV_DEFAULT} as:
307
308 @smallexample
309 #undef CPP_SYSV_DEFAULT
310 #define CPP_SYSV_DEFAULT "-D_CALL_AIX"
311 @end smallexample
312
313 @findex LINK_LIBGCC_SPECIAL
314 @item LINK_LIBGCC_SPECIAL
315 Define this macro if the driver program should find the library
316 @file{libgcc.a} itself and should not pass @option{-L} options to the
317 linker.  If you do not define this macro, the driver program will pass
318 the argument @option{-lgcc} to tell the linker to do the search and will
319 pass @option{-L} options to it.
320
321 @findex LINK_LIBGCC_SPECIAL_1
322 @item LINK_LIBGCC_SPECIAL_1
323 Define this macro if the driver program should find the library
324 @file{libgcc.a}.  If you do not define this macro, the driver program will pass
325 the argument @option{-lgcc} to tell the linker to do the search.
326 This macro is similar to @code{LINK_LIBGCC_SPECIAL}, except that it does
327 not affect @option{-L} options.
328
329 @findex LINK_COMMAND_SPEC
330 @item LINK_COMMAND_SPEC
331 A C string constant giving the complete command line need to execute the
332 linker.  When you do this, you will need to update your port each time a
333 change is made to the link command line within @file{gcc.c}.  Therefore,
334 define this macro only if you need to completely redefine the command
335 line for invoking the linker and there is no other way to accomplish
336 the effect you need.
337
338 @findex LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
339 @item LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
340 A nonzero value causes collect2 to remove duplicate -L<directory> search
341 directories from linking commands.  Do not give it a nonzero value if
342 removing duplicate search directories changes the linker's semantics.
343
344 @findex MULTILIB_DEFAULTS
345 @item MULTILIB_DEFAULTS
346 Define this macro as a C expression for the initializer of an array of
347 string to tell the driver program which options are defaults for this
348 target and thus do not need to be handled specially when using
349 @code{MULTILIB_OPTIONS}.
350
351 Do not define this macro if @code{MULTILIB_OPTIONS} is not defined in
352 the target makefile fragment or if none of the options listed in
353 @code{MULTILIB_OPTIONS} are set by default.
354 @xref{Target Fragment}.
355
356 @findex RELATIVE_PREFIX_NOT_LINKDIR
357 @item RELATIVE_PREFIX_NOT_LINKDIR
358 Define this macro to tell @code{gcc} that it should only translate
359 a @option{-B} prefix into a @option{-L} linker option if the prefix
360 indicates an absolute file name.
361
362 @findex STANDARD_EXEC_PREFIX
363 @item STANDARD_EXEC_PREFIX
364 Define this macro as a C string constant if you wish to override the
365 standard choice of @file{/usr/local/lib/gcc-lib/} as the default prefix to
366 try when searching for the executable files of the compiler.
367
368 @findex MD_EXEC_PREFIX
369 @item MD_EXEC_PREFIX
370 If defined, this macro is an additional prefix to try after
371 @code{STANDARD_EXEC_PREFIX}.  @code{MD_EXEC_PREFIX} is not searched
372 when the @option{-b} option is used, or the compiler is built as a cross
373 compiler.  If you define @code{MD_EXEC_PREFIX}, then be sure to add it
374 to the list of directories used to find the assembler in @file{configure.in}.
375
376 @findex STANDARD_STARTFILE_PREFIX
377 @item STANDARD_STARTFILE_PREFIX
378 Define this macro as a C string constant if you wish to override the
379 standard choice of @file{/usr/local/lib/} as the default prefix to
380 try when searching for startup files such as @file{crt0.o}.
381
382 @findex MD_STARTFILE_PREFIX
383 @item MD_STARTFILE_PREFIX
384 If defined, this macro supplies an additional prefix to try after the
385 standard prefixes.  @code{MD_EXEC_PREFIX} is not searched when the
386 @option{-b} option is used, or when the compiler is built as a cross
387 compiler.
388
389 @findex MD_STARTFILE_PREFIX_1
390 @item MD_STARTFILE_PREFIX_1
391 If defined, this macro supplies yet another prefix to try after the
392 standard prefixes.  It is not searched when the @option{-b} option is
393 used, or when the compiler is built as a cross compiler.
394
395 @findex INIT_ENVIRONMENT
396 @item INIT_ENVIRONMENT
397 Define this macro as a C string constant if you wish to set environment
398 variables for programs called by the driver, such as the assembler and
399 loader.  The driver passes the value of this macro to @code{putenv} to
400 initialize the necessary environment variables.
401
402 @findex LOCAL_INCLUDE_DIR
403 @item LOCAL_INCLUDE_DIR
404 Define this macro as a C string constant if you wish to override the
405 standard choice of @file{/usr/local/include} as the default prefix to
406 try when searching for local header files.  @code{LOCAL_INCLUDE_DIR}
407 comes before @code{SYSTEM_INCLUDE_DIR} in the search order.
408
409 Cross compilers do not use this macro and do not search either
410 @file{/usr/local/include} or its replacement.
411
412 @findex MODIFY_TARGET_NAME
413 @item MODIFY_TARGET_NAME
414 Define this macro if you with to define command-line switches that modify the
415 default target name
416
417 For each switch, you can include a string to be appended to the first
418 part of the configuration name or a string to be deleted from the
419 configuration name, if present.  The definition should be an initializer
420 for an array of structures.  Each array element should have three
421 elements: the switch name (a string constant, including the initial
422 dash), one of the enumeration codes @code{ADD} or @code{DELETE} to
423 indicate whether the string should be inserted or deleted, and the string
424 to be inserted or deleted (a string constant).
425
426 For example, on a machine where @samp{64} at the end of the
427 configuration name denotes a 64-bit target and you want the @option{-32}
428 and @option{-64} switches to select between 32- and 64-bit targets, you would
429 code
430
431 @smallexample
432 #define MODIFY_TARGET_NAME \
433   @{ @{ "-32", DELETE, "64"@}, \
434      @{"-64", ADD, "64"@}@}
435 @end smallexample
436
437
438 @findex SYSTEM_INCLUDE_DIR
439 @item SYSTEM_INCLUDE_DIR
440 Define this macro as a C string constant if you wish to specify a
441 system-specific directory to search for header files before the standard
442 directory.  @code{SYSTEM_INCLUDE_DIR} comes before
443 @code{STANDARD_INCLUDE_DIR} in the search order.
444
445 Cross compilers do not use this macro and do not search the directory
446 specified.
447
448 @findex STANDARD_INCLUDE_DIR
449 @item STANDARD_INCLUDE_DIR
450 Define this macro as a C string constant if you wish to override the
451 standard choice of @file{/usr/include} as the default prefix to
452 try when searching for header files.
453
454 Cross compilers do not use this macro and do not search either
455 @file{/usr/include} or its replacement.
456
457 @findex STANDARD_INCLUDE_COMPONENT
458 @item STANDARD_INCLUDE_COMPONENT
459 The ``component'' corresponding to @code{STANDARD_INCLUDE_DIR}.
460 See @code{INCLUDE_DEFAULTS}, below, for the description of components.
461 If you do not define this macro, no component is used.
462
463 @findex INCLUDE_DEFAULTS
464 @item INCLUDE_DEFAULTS
465 Define this macro if you wish to override the entire default search path
466 for include files.  For a native compiler, the default search path
467 usually consists of @code{GCC_INCLUDE_DIR}, @code{LOCAL_INCLUDE_DIR},
468 @code{SYSTEM_INCLUDE_DIR}, @code{GPLUSPLUS_INCLUDE_DIR}, and
469 @code{STANDARD_INCLUDE_DIR}.  In addition, @code{GPLUSPLUS_INCLUDE_DIR}
470 and @code{GCC_INCLUDE_DIR} are defined automatically by @file{Makefile},
471 and specify private search areas for GCC.  The directory
472 @code{GPLUSPLUS_INCLUDE_DIR} is used only for C++ programs.
473
474 The definition should be an initializer for an array of structures.
475 Each array element should have four elements: the directory name (a
476 string constant), the component name (also a string constant), a flag
477 for C++-only directories,
478 and a flag showing that the includes in the directory don't need to be
479 wrapped in @code{extern @samp{C}} when compiling C++.  Mark the end of
480 the array with a null element.
481
482 The component name denotes what GNU package the include file is part of,
483 if any, in all upper-case letters.  For example, it might be @samp{GCC}
484 or @samp{BINUTILS}.  If the package is part of a vendor-supplied
485 operating system, code the component name as @samp{0}.
486
487 For example, here is the definition used for VAX/VMS:
488
489 @example
490 #define INCLUDE_DEFAULTS \
491 @{                                       \
492   @{ "GNU_GXX_INCLUDE:", "G++", 1, 1@},   \
493   @{ "GNU_CC_INCLUDE:", "GCC", 0, 0@},    \
494   @{ "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0@},  \
495   @{ ".", 0, 0, 0@},                      \
496   @{ 0, 0, 0, 0@}                         \
497 @}
498 @end example
499 @end table
500
501 Here is the order of prefixes tried for exec files:
502
503 @enumerate
504 @item
505 Any prefixes specified by the user with @option{-B}.
506
507 @item
508 The environment variable @code{GCC_EXEC_PREFIX}, if any.
509
510 @item
511 The directories specified by the environment variable @code{COMPILER_PATH}.
512
513 @item
514 The macro @code{STANDARD_EXEC_PREFIX}.
515
516 @item
517 @file{/usr/lib/gcc/}.
518
519 @item
520 The macro @code{MD_EXEC_PREFIX}, if any.
521 @end enumerate
522
523 Here is the order of prefixes tried for startfiles:
524
525 @enumerate
526 @item
527 Any prefixes specified by the user with @option{-B}.
528
529 @item
530 The environment variable @code{GCC_EXEC_PREFIX}, if any.
531
532 @item
533 The directories specified by the environment variable @code{LIBRARY_PATH}
534 (or port-specific name; native only, cross compilers do not use this).
535
536 @item
537 The macro @code{STANDARD_EXEC_PREFIX}.
538
539 @item
540 @file{/usr/lib/gcc/}.
541
542 @item
543 The macro @code{MD_EXEC_PREFIX}, if any.
544
545 @item
546 The macro @code{MD_STARTFILE_PREFIX}, if any.
547
548 @item
549 The macro @code{STANDARD_STARTFILE_PREFIX}.
550
551 @item
552 @file{/lib/}.
553
554 @item
555 @file{/usr/lib/}.
556 @end enumerate
557
558 @node Run-time Target
559 @section Run-time Target Specification
560 @cindex run-time target specification
561 @cindex predefined macros
562 @cindex target specifications
563
564 @c prevent bad page break with this line
565 Here are run-time target specifications.
566
567 @table @code
568 @findex CPP_PREDEFINES
569 @item CPP_PREDEFINES
570 Define this to be a string constant containing @option{-D} options to
571 define the predefined macros that identify this machine and system.
572 These macros will be predefined unless the @option{-ansi} option (or a
573 @option{-std} option for strict ISO C conformance) is specified.
574
575 In addition, a parallel set of macros are predefined, whose names are
576 made by appending @samp{__} at the beginning and at the end.  These
577 @samp{__} macros are permitted by the ISO standard, so they are
578 predefined regardless of whether @option{-ansi} or a @option{-std} option
579 is specified.
580
581 For example, on the Sun, one can use the following value:
582
583 @smallexample
584 "-Dmc68000 -Dsun -Dunix"
585 @end smallexample
586
587 The result is to define the macros @code{__mc68000__}, @code{__sun__}
588 and @code{__unix__} unconditionally, and the macros @code{mc68000},
589 @code{sun} and @code{unix} provided @option{-ansi} is not specified.
590
591 @findex extern int target_flags
592 @item extern int target_flags;
593 This declaration should be present.
594
595 @cindex optional hardware or system features
596 @cindex features, optional, in system conventions
597 @item TARGET_@dots{}
598 This series of macros is to allow compiler command arguments to
599 enable or disable the use of optional features of the target machine.
600 For example, one machine description serves both the 68000 and
601 the 68020; a command argument tells the compiler whether it should
602 use 68020-only instructions or not.  This command argument works
603 by means of a macro @code{TARGET_68020} that tests a bit in
604 @code{target_flags}.
605
606 Define a macro @code{TARGET_@var{featurename}} for each such option.
607 Its definition should test a bit in @code{target_flags}.  It is
608 recommended that a helper macro @code{TARGET_MASK_@var{featurename}}
609 is defined for each bit-value to test, and used in
610 @code{TARGET_@var{featurename}} and @code{TARGET_SWITCHES}.  For
611 example:
612
613 @smallexample
614 #define TARGET_MASK_68020 1
615 #define TARGET_68020 (target_flags & TARGET_MASK_68020)
616 @end smallexample
617
618 One place where these macros are used is in the condition-expressions
619 of instruction patterns.  Note how @code{TARGET_68020} appears
620 frequently in the 68000 machine description file, @file{m68k.md}.
621 Another place they are used is in the definitions of the other
622 macros in the @file{@var{machine}.h} file.
623
624 @findex TARGET_SWITCHES
625 @item TARGET_SWITCHES
626 This macro defines names of command options to set and clear
627 bits in @code{target_flags}.  Its definition is an initializer
628 with a subgrouping for each command option.
629
630 Each subgrouping contains a string constant, that defines the option
631 name, a number, which contains the bits to set in
632 @code{target_flags}, and a second string which is the description
633 displayed by @option{--help}.  If the number is negative then the bits specified
634 by the number are cleared instead of being set.  If the description
635 string is present but empty, then no help information will be displayed
636 for that option, but it will not count as an undocumented option.  The
637 actual option name is made by appending @samp{-m} to the specified name.
638 Non-empty description strings should be marked with @code{N_(@dots{})} for
639 @command{xgettext}.  In addition to the description for @option{--help},
640 more detailed documentation for each option should be added to
641 @file{invoke.texi}.
642
643 One of the subgroupings should have a null string.  The number in
644 this grouping is the default value for @code{target_flags}.  Any
645 target options act starting with that value.
646
647 Here is an example which defines @option{-m68000} and @option{-m68020}
648 with opposite meanings, and picks the latter as the default:
649
650 @smallexample
651 #define TARGET_SWITCHES \
652   @{ @{ "68020", TARGET_MASK_68020, "" @},      \
653     @{ "68000", -TARGET_MASK_68020, \
654       N_("Compile for the 68000") @}, \
655     @{ "", TARGET_MASK_68020, "" @}@}
656 @end smallexample
657
658 @findex TARGET_OPTIONS
659 @item TARGET_OPTIONS
660 This macro is similar to @code{TARGET_SWITCHES} but defines names of command
661 options that have values.  Its definition is an initializer with a
662 subgrouping for each command option.
663
664 Each subgrouping contains a string constant, that defines the fixed part
665 of the option name, the address of a variable, and a description string
666 (which should again be marked with @code{N_(@dots{})}).
667 The variable, type @code{char *}, is set to the variable part of the
668 given option if the fixed part matches.  The actual option name is made
669 by appending @samp{-m} to the specified name.  Again, each option should
670 also be documented in @file{invoke.texi}.
671
672 Here is an example which defines @option{-mshort-data-@var{number}}.  If the
673 given option is @option{-mshort-data-512}, the variable @code{m88k_short_data}
674 will be set to the string @code{"512"}.
675
676 @smallexample
677 extern char *m88k_short_data;
678 #define TARGET_OPTIONS \
679  @{ @{ "short-data-", &m88k_short_data, \
680      N_("Specify the size of the short data section") @} @}
681 @end smallexample
682
683 @findex TARGET_VERSION
684 @item TARGET_VERSION
685 This macro is a C statement to print on @code{stderr} a string
686 describing the particular machine description choice.  Every machine
687 description should define @code{TARGET_VERSION}.  For example:
688
689 @smallexample
690 #ifdef MOTOROLA
691 #define TARGET_VERSION \
692   fprintf (stderr, " (68k, Motorola syntax)");
693 #else
694 #define TARGET_VERSION \
695   fprintf (stderr, " (68k, MIT syntax)");
696 #endif
697 @end smallexample
698
699 @findex OVERRIDE_OPTIONS
700 @item OVERRIDE_OPTIONS
701 Sometimes certain combinations of command options do not make sense on
702 a particular target machine.  You can define a macro
703 @code{OVERRIDE_OPTIONS} to take account of this.  This macro, if
704 defined, is executed once just after all the command options have been
705 parsed.
706
707 Don't use this macro to turn on various extra optimizations for
708 @option{-O}.  That is what @code{OPTIMIZATION_OPTIONS} is for.
709
710 @findex OPTIMIZATION_OPTIONS
711 @item OPTIMIZATION_OPTIONS (@var{level}, @var{size})
712 Some machines may desire to change what optimizations are performed for
713 various optimization levels.   This macro, if defined, is executed once
714 just after the optimization level is determined and before the remainder
715 of the command options have been parsed.  Values set in this macro are
716 used as the default values for the other command line options.
717
718 @var{level} is the optimization level specified; 2 if @option{-O2} is
719 specified, 1 if @option{-O} is specified, and 0 if neither is specified.
720
721 @var{size} is non-zero if @option{-Os} is specified and zero otherwise.
722
723 You should not use this macro to change options that are not
724 machine-specific.  These should uniformly selected by the same
725 optimization level on all supported machines.  Use this macro to enable
726 machine-specific optimizations.
727
728 @strong{Do not examine @code{write_symbols} in
729 this macro!} The debugging options are not supposed to alter the
730 generated code.
731
732 @findex CAN_DEBUG_WITHOUT_FP
733 @item CAN_DEBUG_WITHOUT_FP
734 Define this macro if debugging can be performed even without a frame
735 pointer.  If this macro is defined, GCC will turn on the
736 @option{-fomit-frame-pointer} option whenever @option{-O} is specified.
737 @end table
738
739 @node Per-Function Data
740 @section Defining data structures for per-function information.
741 @cindex per-function data
742 @cindex data structures
743
744 If the target needs to store information on a per-function basis, GCC
745 provides a macro and a couple of variables to allow this.  Note, just
746 using statics to store the information is a bad idea, since GCC supports
747 nested functions, so you can be halfway through encoding one function
748 when another one comes along.
749
750 GCC defines a data structure called @code{struct function} which
751 contains all of the data specific to an individual function.  This
752 structure contains a field called @code{machine} whose type is
753 @code{struct machine_function *}, which can be used by targets to point
754 to their own specific data.
755
756 If a target needs per-function specific data it should define the type
757 @code{struct machine_function} and also the macro
758 @code{INIT_EXPANDERS}.  This macro should be used to initialise some or
759 all of the function pointers @code{init_machine_status},
760 @code{free_machine_status} and @code{mark_machine_status}.  These
761 pointers are explained below.
762
763 One typical use of per-function, target specific data is to create an
764 RTX to hold the register containing the function's return address.  This
765 RTX can then be used to implement the @code{__builtin_return_address}
766 function, for level 0.
767
768 Note - earlier implementations of GCC used a single data area to hold
769 all of the per-function information.  Thus when processing of a nested
770 function began the old per-function data had to be pushed onto a
771 stack, and when the processing was finished, it had to be popped off the
772 stack.  GCC used to provide function pointers called
773 @code{save_machine_status} and @code{restore_machine_status} to handle
774 the saving and restoring of the target specific information.  Since the
775 single data area approach is no longer used, these pointers are no
776 longer supported.
777
778 The macro and function pointers are described below.
779
780 @table @code
781 @findex INIT_EXPANDERS
782 @item   INIT_EXPANDERS
783 Macro called to initialise any target specific information.  This macro
784 is called once per function, before generation of any RTL has begun.
785 The intention of this macro is to allow the initialisation of the
786 function pointers below.
787
788 @findex init_machine_status
789 @item   init_machine_status
790 This is a @code{void (*)(struct function *)} function pointer.  If this
791 pointer is non-NULL it will be called once per function, before function
792 compilation starts, in order to allow the target to perform any target
793 specific initialisation of the @code{struct function} structure.  It is
794 intended that this would be used to initialise the @code{machine} of
795 that structure.
796
797 @findex free_machine_status
798 @item   free_machine_status
799 This is a @code{void (*)(struct function *)} function pointer.  If this
800 pointer is non-NULL it will be called once per function, after the
801 function has been compiled, in order to allow any memory allocated
802 during the @code{init_machine_status} function call to be freed.
803
804 @findex mark_machine_status
805 @item   mark_machine_status
806 This is a @code{void (*)(struct function *)} function pointer.  If this
807 pointer is non-NULL it will be called once per function in order to mark
808 any data items in the @code{struct machine_function} structure which
809 need garbage collection.
810
811 @end table
812
813 @node Storage Layout
814 @section Storage Layout
815 @cindex storage layout
816
817 Note that the definitions of the macros in this table which are sizes or
818 alignments measured in bits do not need to be constant.  They can be C
819 expressions that refer to static variables, such as the @code{target_flags}.
820 @xref{Run-time Target}.
821
822 @table @code
823 @findex BITS_BIG_ENDIAN
824 @item BITS_BIG_ENDIAN
825 Define this macro to have the value 1 if the most significant bit in a
826 byte has the lowest number; otherwise define it to have the value zero.
827 This means that bit-field instructions count from the most significant
828 bit.  If the machine has no bit-field instructions, then this must still
829 be defined, but it doesn't matter which value it is defined to.  This
830 macro need not be a constant.
831
832 This macro does not affect the way structure fields are packed into
833 bytes or words; that is controlled by @code{BYTES_BIG_ENDIAN}.
834
835 @findex BYTES_BIG_ENDIAN
836 @item BYTES_BIG_ENDIAN
837 Define this macro to have the value 1 if the most significant byte in a
838 word has the lowest number.  This macro need not be a constant.
839
840 @findex WORDS_BIG_ENDIAN
841 @item WORDS_BIG_ENDIAN
842 Define this macro to have the value 1 if, in a multiword object, the
843 most significant word has the lowest number.  This applies to both
844 memory locations and registers; GCC fundamentally assumes that the
845 order of words in memory is the same as the order in registers.  This
846 macro need not be a constant.
847
848 @findex LIBGCC2_WORDS_BIG_ENDIAN
849 @item LIBGCC2_WORDS_BIG_ENDIAN
850 Define this macro if WORDS_BIG_ENDIAN is not constant.  This must be a
851 constant value with the same meaning as WORDS_BIG_ENDIAN, which will be
852 used only when compiling libgcc2.c.  Typically the value will be set
853 based on preprocessor defines.
854
855 @findex FLOAT_WORDS_BIG_ENDIAN
856 @item FLOAT_WORDS_BIG_ENDIAN
857 Define this macro to have the value 1 if @code{DFmode}, @code{XFmode} or
858 @code{TFmode} floating point numbers are stored in memory with the word
859 containing the sign bit at the lowest address; otherwise define it to
860 have the value 0.  This macro need not be a constant.
861
862 You need not define this macro if the ordering is the same as for
863 multi-word integers.
864
865 @findex BITS_PER_UNIT
866 @item BITS_PER_UNIT
867 Define this macro to be the number of bits in an addressable storage
868 unit (byte); normally 8.
869
870 @findex BITS_PER_WORD
871 @item BITS_PER_WORD
872 Number of bits in a word; normally 32.
873
874 @findex MAX_BITS_PER_WORD
875 @item MAX_BITS_PER_WORD
876 Maximum number of bits in a word.  If this is undefined, the default is
877 @code{BITS_PER_WORD}.  Otherwise, it is the constant value that is the
878 largest value that @code{BITS_PER_WORD} can have at run-time.
879
880 @findex UNITS_PER_WORD
881 @item UNITS_PER_WORD
882 Number of storage units in a word; normally 4.
883
884 @findex MIN_UNITS_PER_WORD
885 @item MIN_UNITS_PER_WORD
886 Minimum number of units in a word.  If this is undefined, the default is
887 @code{UNITS_PER_WORD}.  Otherwise, it is the constant value that is the
888 smallest value that @code{UNITS_PER_WORD} can have at run-time.
889
890 @findex POINTER_SIZE
891 @item POINTER_SIZE
892 Width of a pointer, in bits.  You must specify a value no wider than the
893 width of @code{Pmode}.  If it is not equal to the width of @code{Pmode},
894 you must define @code{POINTERS_EXTEND_UNSIGNED}.
895
896 @findex POINTERS_EXTEND_UNSIGNED
897 @item POINTERS_EXTEND_UNSIGNED
898 A C expression whose value is nonzero if pointers that need to be
899 extended from being @code{POINTER_SIZE} bits wide to @code{Pmode} are to
900 be zero-extended and zero if they are to be sign-extended.
901
902 You need not define this macro if the @code{POINTER_SIZE} is equal
903 to the width of @code{Pmode}.
904
905 @findex PROMOTE_MODE
906 @item PROMOTE_MODE (@var{m}, @var{unsignedp}, @var{type})
907 A macro to update @var{m} and @var{unsignedp} when an object whose type
908 is @var{type} and which has the specified mode and signedness is to be
909 stored in a register.  This macro is only called when @var{type} is a
910 scalar type.
911
912 On most RISC machines, which only have operations that operate on a full
913 register, define this macro to set @var{m} to @code{word_mode} if
914 @var{m} is an integer mode narrower than @code{BITS_PER_WORD}.  In most
915 cases, only integer modes should be widened because wider-precision
916 floating-point operations are usually more expensive than their narrower
917 counterparts.
918
919 For most machines, the macro definition does not change @var{unsignedp}.
920 However, some machines, have instructions that preferentially handle
921 either signed or unsigned quantities of certain modes.  For example, on
922 the DEC Alpha, 32-bit loads from memory and 32-bit add instructions
923 sign-extend the result to 64 bits.  On such machines, set
924 @var{unsignedp} according to which kind of extension is more efficient.
925
926 Do not define this macro if it would never modify @var{m}.
927
928 @findex PROMOTE_FUNCTION_ARGS
929 @item PROMOTE_FUNCTION_ARGS
930 Define this macro if the promotion described by @code{PROMOTE_MODE}
931 should also be done for outgoing function arguments.
932
933 @findex PROMOTE_FUNCTION_RETURN
934 @item PROMOTE_FUNCTION_RETURN
935 Define this macro if the promotion described by @code{PROMOTE_MODE}
936 should also be done for the return value of functions.
937
938 If this macro is defined, @code{FUNCTION_VALUE} must perform the same
939 promotions done by @code{PROMOTE_MODE}.
940
941 @findex PROMOTE_FOR_CALL_ONLY
942 @item PROMOTE_FOR_CALL_ONLY
943 Define this macro if the promotion described by @code{PROMOTE_MODE}
944 should @emph{only} be performed for outgoing function arguments or
945 function return values, as specified by @code{PROMOTE_FUNCTION_ARGS}
946 and @code{PROMOTE_FUNCTION_RETURN}, respectively.
947
948 @findex PARM_BOUNDARY
949 @item PARM_BOUNDARY
950 Normal alignment required for function parameters on the stack, in
951 bits.  All stack parameters receive at least this much alignment
952 regardless of data type.  On most machines, this is the same as the
953 size of an integer.
954
955 @findex STACK_BOUNDARY
956 @item STACK_BOUNDARY
957 Define this macro if there is a guaranteed alignment for the stack
958 pointer on this machine.  The definition is a C expression
959 for the desired alignment (measured in bits).  This value is used as a
960 default if PREFERRED_STACK_BOUNDARY is not defined.
961
962 @findex PREFERRED_STACK_BOUNDARY
963 @item PREFERRED_STACK_BOUNDARY
964 Define this macro if you wish to preserve a certain alignment for
965 the stack pointer.  The definition is a C expression
966 for the desired alignment (measured in bits).  If STACK_BOUNDARY is
967 also defined, this macro must evaluate to a value equal to or larger
968 than STACK_BOUNDARY.
969
970 @cindex @code{PUSH_ROUNDING}, interaction with @code{PREFERRED_STACK_BOUNDARY}
971 If @code{PUSH_ROUNDING} is not defined, the stack will always be aligned
972 to the specified boundary.  If @code{PUSH_ROUNDING} is defined and specifies
973 a less strict alignment than @code{PREFERRED_STACK_BOUNDARY}, the stack may
974 be momentarily unaligned while pushing arguments.
975
976 @findex FUNCTION_BOUNDARY
977 @item FUNCTION_BOUNDARY
978 Alignment required for a function entry point, in bits.
979
980 @findex BIGGEST_ALIGNMENT
981 @item BIGGEST_ALIGNMENT
982 Biggest alignment that any data type can require on this machine, in bits.
983
984 @findex MINIMUM_ATOMIC_ALIGNMENT
985 @item MINIMUM_ATOMIC_ALIGNMENT
986 If defined, the smallest alignment, in bits, that can be given to an
987 object that can be referenced in one operation, without disturbing any
988 nearby object.  Normally, this is @code{BITS_PER_UNIT}, but may be larger
989 on machines that don't have byte or half-word store operations.
990
991 @findex BIGGEST_FIELD_ALIGNMENT
992 @item BIGGEST_FIELD_ALIGNMENT
993 Biggest alignment that any structure or union field can require on this
994 machine, in bits.  If defined, this overrides @code{BIGGEST_ALIGNMENT} for
995 structure and union fields only, unless the field alignment has been set
996 by the @code{__attribute__ ((aligned (@var{n})))} construct.
997
998 @findex ADJUST_FIELD_ALIGN
999 @item ADJUST_FIELD_ALIGN (@var{field}, @var{computed})
1000 An expression for the alignment of a structure field @var{field} if the
1001 alignment computed in the usual way is @var{computed}.  GCC uses
1002 this value instead of the value in @code{BIGGEST_ALIGNMENT} or
1003 @code{BIGGEST_FIELD_ALIGNMENT}, if defined, for structure fields only.
1004
1005 @findex MAX_OFILE_ALIGNMENT
1006 @item MAX_OFILE_ALIGNMENT
1007 Biggest alignment supported by the object file format of this machine.
1008 Use this macro to limit the alignment which can be specified using the
1009 @code{__attribute__ ((aligned (@var{n})))} construct.  If not defined,
1010 the default value is @code{BIGGEST_ALIGNMENT}.
1011
1012 @findex DATA_ALIGNMENT
1013 @item DATA_ALIGNMENT (@var{type}, @var{basic-align})
1014 If defined, a C expression to compute the alignment for a variable in
1015 the static store.  @var{type} is the data type, and @var{basic-align} is
1016 the alignment that the object would ordinarily have.  The value of this
1017 macro is used instead of that alignment to align the object.
1018
1019 If this macro is not defined, then @var{basic-align} is used.
1020
1021 @findex strcpy
1022 One use of this macro is to increase alignment of medium-size data to
1023 make it all fit in fewer cache lines.  Another is to cause character
1024 arrays to be word-aligned so that @code{strcpy} calls that copy
1025 constants to character arrays can be done inline.
1026
1027 @findex CONSTANT_ALIGNMENT
1028 @item CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})
1029 If defined, a C expression to compute the alignment given to a constant
1030 that is being placed in memory.  @var{constant} is the constant and
1031 @var{basic-align} is the alignment that the object would ordinarily
1032 have.  The value of this macro is used instead of that alignment to
1033 align the object.
1034
1035 If this macro is not defined, then @var{basic-align} is used.
1036
1037 The typical use of this macro is to increase alignment for string
1038 constants to be word aligned so that @code{strcpy} calls that copy
1039 constants can be done inline.
1040
1041 @findex LOCAL_ALIGNMENT
1042 @item LOCAL_ALIGNMENT (@var{type}, @var{basic-align})
1043 If defined, a C expression to compute the alignment for a variable in
1044 the local store.  @var{type} is the data type, and @var{basic-align} is
1045 the alignment that the object would ordinarily have.  The value of this
1046 macro is used instead of that alignment to align the object.
1047
1048 If this macro is not defined, then @var{basic-align} is used.
1049
1050 One use of this macro is to increase alignment of medium-size data to
1051 make it all fit in fewer cache lines.
1052
1053 @findex EMPTY_FIELD_BOUNDARY
1054 @item EMPTY_FIELD_BOUNDARY
1055 Alignment in bits to be given to a structure bit-field that follows an
1056 empty field such as @code{int : 0;}.
1057
1058 Note that @code{PCC_BITFIELD_TYPE_MATTERS} also affects the alignment
1059 that results from an empty field.
1060
1061 @findex STRUCTURE_SIZE_BOUNDARY
1062 @item STRUCTURE_SIZE_BOUNDARY
1063 Number of bits which any structure or union's size must be a multiple of.
1064 Each structure or union's size is rounded up to a multiple of this.
1065
1066 If you do not define this macro, the default is the same as
1067 @code{BITS_PER_UNIT}.
1068
1069 @findex STRICT_ALIGNMENT
1070 @item STRICT_ALIGNMENT
1071 Define this macro to be the value 1 if instructions will fail to work
1072 if given data not on the nominal alignment.  If instructions will merely
1073 go slower in that case, define this macro as 0.
1074
1075 @findex PCC_BITFIELD_TYPE_MATTERS
1076 @item PCC_BITFIELD_TYPE_MATTERS
1077 Define this if you wish to imitate the way many other C compilers handle
1078 alignment of bit-fields and the structures that contain them.
1079
1080 The behavior is that the type written for a bit-field (@code{int},
1081 @code{short}, or other integer type) imposes an alignment for the
1082 entire structure, as if the structure really did contain an ordinary
1083 field of that type.  In addition, the bit-field is placed within the
1084 structure so that it would fit within such a field, not crossing a
1085 boundary for it.
1086
1087 Thus, on most machines, a bit-field whose type is written as @code{int}
1088 would not cross a four-byte boundary, and would force four-byte
1089 alignment for the whole structure.  (The alignment used may not be four
1090 bytes; it is controlled by the other alignment parameters.)
1091
1092 If the macro is defined, its definition should be a C expression;
1093 a nonzero value for the expression enables this behavior.
1094
1095 Note that if this macro is not defined, or its value is zero, some
1096 bit-fields may cross more than one alignment boundary.  The compiler can
1097 support such references if there are @samp{insv}, @samp{extv}, and
1098 @samp{extzv} insns that can directly reference memory.
1099
1100 The other known way of making bit-fields work is to define
1101 @code{STRUCTURE_SIZE_BOUNDARY} as large as @code{BIGGEST_ALIGNMENT}.
1102 Then every structure can be accessed with fullwords.
1103
1104 Unless the machine has bit-field instructions or you define
1105 @code{STRUCTURE_SIZE_BOUNDARY} that way, you must define
1106 @code{PCC_BITFIELD_TYPE_MATTERS} to have a nonzero value.
1107
1108 If your aim is to make GCC use the same conventions for laying out
1109 bit-fields as are used by another compiler, here is how to investigate
1110 what the other compiler does.  Compile and run this program:
1111
1112 @example
1113 struct foo1
1114 @{
1115   char x;
1116   char :0;
1117   char y;
1118 @};
1119
1120 struct foo2
1121 @{
1122   char x;
1123   int :0;
1124   char y;
1125 @};
1126
1127 main ()
1128 @{
1129   printf ("Size of foo1 is %d\n",
1130           sizeof (struct foo1));
1131   printf ("Size of foo2 is %d\n",
1132           sizeof (struct foo2));
1133   exit (0);
1134 @}
1135 @end example
1136
1137 If this prints 2 and 5, then the compiler's behavior is what you would
1138 get from @code{PCC_BITFIELD_TYPE_MATTERS}.
1139
1140 @findex BITFIELD_NBYTES_LIMITED
1141 @item BITFIELD_NBYTES_LIMITED
1142 Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
1143 aligning a bit-field within the structure.
1144
1145 @findex MEMBER_TYPE_FORCES_BLK
1146 @item MEMBER_TYPE_FORCES_BLK (@var{field})
1147 Return 1 if a structure or array containing @var{field} should be accessed using
1148 @code{BLKMODE}.
1149
1150 Normally, this is not needed.  See the file @file{c4x.h} for an example
1151 of how to use this macro to prevent a structure having a floating point
1152 field from being accessed in an integer mode.
1153
1154 @findex ROUND_TYPE_SIZE
1155 @item ROUND_TYPE_SIZE (@var{type}, @var{computed}, @var{specified})
1156 Define this macro as an expression for the overall size of a type
1157 (given by @var{type} as a tree node) when the size computed in the
1158 usual way is @var{computed} and the alignment is @var{specified}.
1159
1160 The default is to round @var{computed} up to a multiple of @var{specified}.
1161
1162 @findex ROUND_TYPE_SIZE_UNIT
1163 @item ROUND_TYPE_SIZE_UNIT (@var{type}, @var{computed}, @var{specified})
1164 Similar to @code{ROUND_TYPE_SIZE}, but sizes and alignments are
1165 specified in units (bytes).  If you define @code{ROUND_TYPE_SIZE},
1166 you must also define this macro and they must be defined consistently
1167 with each other.
1168
1169 @findex ROUND_TYPE_ALIGN
1170 @item ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
1171 Define this macro as an expression for the alignment of a type (given
1172 by @var{type} as a tree node) if the alignment computed in the usual
1173 way is @var{computed} and the alignment explicitly specified was
1174 @var{specified}.
1175
1176 The default is to use @var{specified} if it is larger; otherwise, use
1177 the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT}
1178
1179 @findex MAX_FIXED_MODE_SIZE
1180 @item MAX_FIXED_MODE_SIZE
1181 An integer expression for the size in bits of the largest integer
1182 machine mode that should actually be used.  All integer machine modes of
1183 this size or smaller can be used for structures and unions with the
1184 appropriate sizes.  If this macro is undefined, @code{GET_MODE_BITSIZE
1185 (DImode)} is assumed.
1186
1187 @findex VECTOR_MODE_SUPPORTED_P
1188 @item VECTOR_MODE_SUPPORTED_P(@var{mode})
1189 Define this macro to be nonzero if the port is prepared to handle insns
1190 involving vector mode @var{mode}.  At the very least, it must have move
1191 patterns for this mode.
1192
1193 @findex STACK_SAVEAREA_MODE
1194 @item STACK_SAVEAREA_MODE (@var{save_level})
1195 If defined, an expression of type @code{enum machine_mode} that
1196 specifies the mode of the save area operand of a
1197 @code{save_stack_@var{level}} named pattern (@pxref{Standard Names}).
1198 @var{save_level} is one of @code{SAVE_BLOCK}, @code{SAVE_FUNCTION}, or
1199 @code{SAVE_NONLOCAL} and selects which of the three named patterns is
1200 having its mode specified.
1201
1202 You need not define this macro if it always returns @code{Pmode}.  You
1203 would most commonly define this macro if the
1204 @code{save_stack_@var{level}} patterns need to support both a 32- and a
1205 64-bit mode.
1206
1207 @findex STACK_SIZE_MODE
1208 @item STACK_SIZE_MODE
1209 If defined, an expression of type @code{enum machine_mode} that
1210 specifies the mode of the size increment operand of an
1211 @code{allocate_stack} named pattern (@pxref{Standard Names}).
1212
1213 You need not define this macro if it always returns @code{word_mode}.
1214 You would most commonly define this macro if the @code{allocate_stack}
1215 pattern needs to support both a 32- and a 64-bit mode.
1216
1217 @findex CHECK_FLOAT_VALUE
1218 @item CHECK_FLOAT_VALUE (@var{mode}, @var{value}, @var{overflow})
1219 A C statement to validate the value @var{value} (of type
1220 @code{double}) for mode @var{mode}.  This means that you check whether
1221 @var{value} fits within the possible range of values for mode
1222 @var{mode} on this target machine.  The mode @var{mode} is always
1223 a mode of class @code{MODE_FLOAT}.  @var{overflow} is nonzero if
1224 the value is already known to be out of range.
1225
1226 If @var{value} is not valid or if @var{overflow} is nonzero, you should
1227 set @var{overflow} to 1 and then assign some valid value to @var{value}.
1228 Allowing an invalid value to go through the compiler can produce
1229 incorrect assembler code which may even cause Unix assemblers to crash.
1230
1231 This macro need not be defined if there is no work for it to do.
1232
1233 @findex TARGET_FLOAT_FORMAT
1234 @item TARGET_FLOAT_FORMAT
1235 A code distinguishing the floating point format of the target machine.
1236 There are three defined values:
1237
1238 @table @code
1239 @findex IEEE_FLOAT_FORMAT
1240 @item IEEE_FLOAT_FORMAT
1241 This code indicates IEEE floating point.  It is the default; there is no
1242 need to define this macro when the format is IEEE.
1243
1244 @findex VAX_FLOAT_FORMAT
1245 @item VAX_FLOAT_FORMAT
1246 This code indicates the peculiar format used on the Vax.
1247
1248 @findex UNKNOWN_FLOAT_FORMAT
1249 @item UNKNOWN_FLOAT_FORMAT
1250 This code indicates any other format.
1251 @end table
1252
1253 The value of this macro is compared with @code{HOST_FLOAT_FORMAT}
1254 (@pxref{Config}) to determine whether the target machine has the same
1255 format as the host machine.  If any other formats are actually in use on
1256 supported machines, new codes should be defined for them.
1257
1258 The ordering of the component words of floating point values stored in
1259 memory is controlled by @code{FLOAT_WORDS_BIG_ENDIAN} for the target
1260 machine and @code{HOST_FLOAT_WORDS_BIG_ENDIAN} for the host.
1261
1262 @findex DEFAULT_VTABLE_THUNKS
1263 @item DEFAULT_VTABLE_THUNKS
1264 GCC supports two ways of implementing C++ vtables:  traditional or with
1265 so-called ``thunks''.  The flag @option{-fvtable-thunk} chooses between them.
1266 Define this macro to be a C expression for the default value of that flag.
1267 If @code{DEFAULT_VTABLE_THUNKS} is 0, GCC uses the traditional
1268 implementation by default.  The ``thunk'' implementation is more efficient
1269 (especially if you have provided an implementation of
1270 @code{ASM_OUTPUT_MI_THUNK}, see @ref{Function Entry}), but is not binary
1271 compatible with code compiled using the traditional implementation.
1272 If you are writing a new port, define @code{DEFAULT_VTABLE_THUNKS} to 1.
1273
1274 If you do not define this macro, the default for @option{-fvtable-thunk} is 0.
1275 @end table
1276
1277 @node Type Layout
1278 @section Layout of Source Language Data Types
1279
1280 These macros define the sizes and other characteristics of the standard
1281 basic data types used in programs being compiled.  Unlike the macros in
1282 the previous section, these apply to specific features of C and related
1283 languages, rather than to fundamental aspects of storage layout.
1284
1285 @table @code
1286 @findex INT_TYPE_SIZE
1287 @item INT_TYPE_SIZE
1288 A C expression for the size in bits of the type @code{int} on the
1289 target machine.  If you don't define this, the default is one word.
1290
1291 @findex MAX_INT_TYPE_SIZE
1292 @item MAX_INT_TYPE_SIZE
1293 Maximum number for the size in bits of the type @code{int} on the target
1294 machine.  If this is undefined, the default is @code{INT_TYPE_SIZE}.
1295 Otherwise, it is the constant value that is the largest value that
1296 @code{INT_TYPE_SIZE} can have at run-time.  This is used in @code{cpp}.
1297
1298 @findex SHORT_TYPE_SIZE
1299 @item SHORT_TYPE_SIZE
1300 A C expression for the size in bits of the type @code{short} on the
1301 target machine.  If you don't define this, the default is half a word.
1302 (If this would be less than one storage unit, it is rounded up to one
1303 unit.)
1304
1305 @findex LONG_TYPE_SIZE
1306 @item LONG_TYPE_SIZE
1307 A C expression for the size in bits of the type @code{long} on the
1308 target machine.  If you don't define this, the default is one word.
1309
1310 @findex MAX_LONG_TYPE_SIZE
1311 @item MAX_LONG_TYPE_SIZE
1312 Maximum number for the size in bits of the type @code{long} on the
1313 target machine.  If this is undefined, the default is
1314 @code{LONG_TYPE_SIZE}.  Otherwise, it is the constant value that is the
1315 largest value that @code{LONG_TYPE_SIZE} can have at run-time.  This is
1316 used in @code{cpp}.
1317
1318 @findex LONG_LONG_TYPE_SIZE
1319 @item LONG_LONG_TYPE_SIZE
1320 A C expression for the size in bits of the type @code{long long} on the
1321 target machine.  If you don't define this, the default is two
1322 words.  If you want to support GNU Ada on your machine, the value of this
1323 macro must be at least 64.
1324
1325 @findex CHAR_TYPE_SIZE
1326 @item CHAR_TYPE_SIZE
1327 A C expression for the size in bits of the type @code{char} on the
1328 target machine.  If you don't define this, the default is
1329 @code{BITS_PER_UNIT}.
1330
1331 @findex MAX_CHAR_TYPE_SIZE
1332 @item MAX_CHAR_TYPE_SIZE
1333 Maximum number for the size in bits of the type @code{char} on the
1334 target machine.  If this is undefined, the default is
1335 @code{CHAR_TYPE_SIZE}.  Otherwise, it is the constant value that is the
1336 largest value that @code{CHAR_TYPE_SIZE} can have at run-time.  This is
1337 used in @code{cpp}.
1338
1339 @findex FLOAT_TYPE_SIZE
1340 @item FLOAT_TYPE_SIZE
1341 A C expression for the size in bits of the type @code{float} on the
1342 target machine.  If you don't define this, the default is one word.
1343
1344 @findex DOUBLE_TYPE_SIZE
1345 @item DOUBLE_TYPE_SIZE
1346 A C expression for the size in bits of the type @code{double} on the
1347 target machine.  If you don't define this, the default is two
1348 words.
1349
1350 @findex LONG_DOUBLE_TYPE_SIZE
1351 @item LONG_DOUBLE_TYPE_SIZE
1352 A C expression for the size in bits of the type @code{long double} on
1353 the target machine.  If you don't define this, the default is two
1354 words.
1355
1356 @findex WIDEST_HARDWARE_FP_SIZE
1357 @item WIDEST_HARDWARE_FP_SIZE
1358 A C expression for the size in bits of the widest floating-point format
1359 supported by the hardware.  If you define this macro, you must specify a
1360 value less than or equal to the value of @code{LONG_DOUBLE_TYPE_SIZE}.
1361 If you do not define this macro, the value of @code{LONG_DOUBLE_TYPE_SIZE}
1362 is the default.
1363
1364 @findex DEFAULT_SIGNED_CHAR
1365 @item DEFAULT_SIGNED_CHAR
1366 An expression whose value is 1 or 0, according to whether the type
1367 @code{char} should be signed or unsigned by default.  The user can
1368 always override this default with the options @option{-fsigned-char}
1369 and @option{-funsigned-char}.
1370
1371 @findex DEFAULT_SHORT_ENUMS
1372 @item DEFAULT_SHORT_ENUMS
1373 A C expression to determine whether to give an @code{enum} type
1374 only as many bytes as it takes to represent the range of possible values
1375 of that type.  A nonzero value means to do that; a zero value means all
1376 @code{enum} types should be allocated like @code{int}.
1377
1378 If you don't define the macro, the default is 0.
1379
1380 @findex SIZE_TYPE
1381 @item SIZE_TYPE
1382 A C expression for a string describing the name of the data type to use
1383 for size values.  The typedef name @code{size_t} is defined using the
1384 contents of the string.
1385
1386 The string can contain more than one keyword.  If so, separate them with
1387 spaces, and write first any length keyword, then @code{unsigned} if
1388 appropriate, and finally @code{int}.  The string must exactly match one
1389 of the data type names defined in the function
1390 @code{init_decl_processing} in the file @file{c-decl.c}.  You may not
1391 omit @code{int} or change the order---that would cause the compiler to
1392 crash on startup.
1393
1394 If you don't define this macro, the default is @code{"long unsigned
1395 int"}.
1396
1397 @findex PTRDIFF_TYPE
1398 @item PTRDIFF_TYPE
1399 A C expression for a string describing the name of the data type to use
1400 for the result of subtracting two pointers.  The typedef name
1401 @code{ptrdiff_t} is defined using the contents of the string.  See
1402 @code{SIZE_TYPE} above for more information.
1403
1404 If you don't define this macro, the default is @code{"long int"}.
1405
1406 @findex WCHAR_TYPE
1407 @item WCHAR_TYPE
1408 A C expression for a string describing the name of the data type to use
1409 for wide characters.  The typedef name @code{wchar_t} is defined using
1410 the contents of the string.  See @code{SIZE_TYPE} above for more
1411 information.
1412
1413 If you don't define this macro, the default is @code{"int"}.
1414
1415 @findex WCHAR_TYPE_SIZE
1416 @item WCHAR_TYPE_SIZE
1417 A C expression for the size in bits of the data type for wide
1418 characters.  This is used in @code{cpp}, which cannot make use of
1419 @code{WCHAR_TYPE}.
1420
1421 @findex MAX_WCHAR_TYPE_SIZE
1422 @item MAX_WCHAR_TYPE_SIZE
1423 Maximum number for the size in bits of the data type for wide
1424 characters.  If this is undefined, the default is
1425 @code{WCHAR_TYPE_SIZE}.  Otherwise, it is the constant value that is the
1426 largest value that @code{WCHAR_TYPE_SIZE} can have at run-time.  This is
1427 used in @code{cpp}.
1428
1429 @findex WINT_TYPE
1430 @item WINT_TYPE
1431 A C expression for a string describing the name of the data type to
1432 use for wide characters passed to @code{printf} and returned from
1433 @code{getwc}.  The typedef name @code{wint_t} is defined using the
1434 contents of the string.  See @code{SIZE_TYPE} above for more
1435 information.
1436
1437 If you don't define this macro, the default is @code{"unsigned int"}.
1438
1439 @findex INTMAX_TYPE
1440 @item INTMAX_TYPE
1441 A C expression for a string describing the name of the data type that
1442 can represent any value of any standard or extended signed integer type.
1443 The typedef name @code{intmax_t} is defined using the contents of the
1444 string.  See @code{SIZE_TYPE} above for more information.
1445
1446 If you don't define this macro, the default is the first of
1447 @code{"int"}, @code{"long int"}, or @code{"long long int"} that has as
1448 much precision as @code{long long int}.
1449
1450 @findex UINTMAX_TYPE
1451 @item UINTMAX_TYPE
1452 A C expression for a string describing the name of the data type that
1453 can represent any value of any standard or extended unsigned integer
1454 type.  The typedef name @code{uintmax_t} is defined using the contents
1455 of the string.  See @code{SIZE_TYPE} above for more information.
1456
1457 If you don't define this macro, the default is the first of
1458 @code{"unsigned int"}, @code{"long unsigned int"}, or @code{"long long
1459 unsigned int"} that has as much precision as @code{long long unsigned
1460 int}.
1461
1462 @findex OBJC_SELECTORS_WITHOUT_LABELS
1463 @item OBJC_SELECTORS_WITHOUT_LABELS
1464 Define this macro if the compiler can group all the selectors together
1465 into a vector and use just one label at the beginning of the vector.
1466 Otherwise, the compiler must give each selector its own assembler
1467 label.
1468
1469 On certain machines, it is important to have a separate label for each
1470 selector because this enables the linker to eliminate duplicate selectors.
1471
1472 @findex TARGET_PTRMEMFUNC_VBIT_LOCATION
1473 @item TARGET_PTRMEMFUNC_VBIT_LOCATION
1474 The C++ compiler represents a pointer-to-member-function with a struct
1475 that looks like:
1476
1477 @example
1478   struct @{
1479     union @{
1480       void (*fn)();
1481       ptrdiff_t vtable_index;
1482     @};
1483     ptrdiff_t delta;
1484   @};
1485 @end example
1486
1487 @noindent
1488 The C++ compiler must use one bit to indicate whether the function that
1489 will be called through a pointer-to-member-function is virtual.
1490 Normally, we assume that the low-order bit of a function pointer must
1491 always be zero.  Then, by ensuring that the vtable_index is odd, we can
1492 distinguish which variant of the union is in use.  But, on some
1493 platforms function pointers can be odd, and so this doesn't work.  In
1494 that case, we use the low-order bit of the @code{delta} field, and shift
1495 the remainder of the @code{delta} field to the left.
1496
1497 GCC will automatically make the right selection about where to store
1498 this bit using the @code{FUNCTION_BOUNDARY} setting for your platform.
1499 However, some platforms such as ARM/Thumb have @code{FUNCTION_BOUNDARY}
1500 set such that functions always start at even addresses, but the lowest
1501 bit of pointers to functions indicate whether the function at that
1502 address is in ARM or Thumb mode.  If this is the case of your
1503 architecture, you should define this macro to
1504 @code{ptrmemfunc_vbit_in_delta}.
1505
1506 In general, you should not have to define this macro.  On architectures
1507 in which function addresses are always even, according to
1508 @code{FUNCTION_BOUNDARY}, GCC will automatically define this macro to
1509 @code{ptrmemfunc_vbit_in_pfn}.
1510
1511 @findex TARGET_BELL
1512 @item TARGET_BELL
1513 A C constant expression for the integer value for escape sequence
1514 @samp{\a}.
1515
1516 @findex TARGET_TAB
1517 @findex TARGET_BS
1518 @findex TARGET_NEWLINE
1519 @item TARGET_BS
1520 @itemx TARGET_TAB
1521 @itemx TARGET_NEWLINE
1522 C constant expressions for the integer values for escape sequences
1523 @samp{\b}, @samp{\t} and @samp{\n}.
1524
1525 @findex TARGET_VT
1526 @findex TARGET_FF
1527 @findex TARGET_CR
1528 @item TARGET_VT
1529 @itemx TARGET_FF
1530 @itemx TARGET_CR
1531 C constant expressions for the integer values for escape sequences
1532 @samp{\v}, @samp{\f} and @samp{\r}.
1533 @end table
1534
1535 @node Registers
1536 @section Register Usage
1537 @cindex register usage
1538
1539 This section explains how to describe what registers the target machine
1540 has, and how (in general) they can be used.
1541
1542 The description of which registers a specific instruction can use is
1543 done with register classes; see @ref{Register Classes}.  For information
1544 on using registers to access a stack frame, see @ref{Frame Registers}.
1545 For passing values in registers, see @ref{Register Arguments}.
1546 For returning values in registers, see @ref{Scalar Return}.
1547
1548 @menu
1549 * Register Basics::             Number and kinds of registers.
1550 * Allocation Order::            Order in which registers are allocated.
1551 * Values in Registers::         What kinds of values each reg can hold.
1552 * Leaf Functions::              Renumbering registers for leaf functions.
1553 * Stack Registers::             Handling a register stack such as 80387.
1554 @end menu
1555
1556 @node Register Basics
1557 @subsection Basic Characteristics of Registers
1558
1559 @c prevent bad page break with this line
1560 Registers have various characteristics.
1561
1562 @table @code
1563 @findex FIRST_PSEUDO_REGISTER
1564 @item FIRST_PSEUDO_REGISTER
1565 Number of hardware registers known to the compiler.  They receive
1566 numbers 0 through @code{FIRST_PSEUDO_REGISTER-1}; thus, the first
1567 pseudo register's number really is assigned the number
1568 @code{FIRST_PSEUDO_REGISTER}.
1569
1570 @item FIXED_REGISTERS
1571 @findex FIXED_REGISTERS
1572 @cindex fixed register
1573 An initializer that says which registers are used for fixed purposes
1574 all throughout the compiled code and are therefore not available for
1575 general allocation.  These would include the stack pointer, the frame
1576 pointer (except on machines where that can be used as a general
1577 register when no frame pointer is needed), the program counter on
1578 machines where that is considered one of the addressable registers,
1579 and any other numbered register with a standard use.
1580
1581 This information is expressed as a sequence of numbers, separated by
1582 commas and surrounded by braces.  The @var{n}th number is 1 if
1583 register @var{n} is fixed, 0 otherwise.
1584
1585 The table initialized from this macro, and the table initialized by
1586 the following one, may be overridden at run time either automatically,
1587 by the actions of the macro @code{CONDITIONAL_REGISTER_USAGE}, or by
1588 the user with the command options @option{-ffixed-@var{reg}},
1589 @option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}}.
1590
1591 @findex CALL_USED_REGISTERS
1592 @item CALL_USED_REGISTERS
1593 @cindex call-used register
1594 @cindex call-clobbered register
1595 @cindex call-saved register
1596 Like @code{FIXED_REGISTERS} but has 1 for each register that is
1597 clobbered (in general) by function calls as well as for fixed
1598 registers.  This macro therefore identifies the registers that are not
1599 available for general allocation of values that must live across
1600 function calls.
1601
1602 If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
1603 automatically saves it on function entry and restores it on function
1604 exit, if the register is used within the function.
1605
1606 @findex HARD_REGNO_CALL_PART_CLOBBERED
1607 @item HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
1608 @cindex call-used register
1609 @cindex call-clobbered register
1610 @cindex call-saved register
1611 A C expression that is non-zero if it is not permissible to store a
1612 value of mode @var{mode} in hard register number @var{regno} across a
1613 call without some part of it being clobbered.  For most machines this
1614 macro need not be defined.  It is only required for machines that do not
1615 preserve the entire contents of a register across a call.
1616
1617 @findex CONDITIONAL_REGISTER_USAGE
1618 @findex fixed_regs
1619 @findex call_used_regs
1620 @item CONDITIONAL_REGISTER_USAGE
1621 Zero or more C statements that may conditionally modify five variables
1622 @code{fixed_regs}, @code{call_used_regs}, @code{global_regs},
1623 (these three are of type @code{char []}), @code{reg_names} (of type
1624 @code{const char * []}) and @code{reg_class_contents} (of type
1625 @code{HARD_REG_SET}).
1626 Before the macro is called @code{fixed_regs}, @code{call_used_regs}
1627 @code{reg_class_contents} and @code{reg_names} have been initialized
1628 from @code{FIXED_REGISTERS}, @code{CALL_USED_REGISTERS},
1629 @code{REG_CLASS_CONTENTS} and @code{REGISTER_NAMES}, respectively,
1630 @code{global_regs} has been cleared, and any @option{-ffixed-@var{reg}},
1631 @option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}} command
1632 options have been applied.
1633
1634 This is necessary in case the fixed or call-clobbered registers depend
1635 on target flags.
1636
1637 You need not define this macro if it has no work to do.
1638
1639 @cindex disabling certain registers
1640 @cindex controlling register usage
1641 If the usage of an entire class of registers depends on the target
1642 flags, you may indicate this to GCC by using this macro to modify
1643 @code{fixed_regs} and @code{call_used_regs} to 1 for each of the
1644 registers in the classes which should not be used by GCC.  Also define
1645 the macro @code{REG_CLASS_FROM_LETTER} to return @code{NO_REGS} if it
1646 is called with a letter for a class that shouldn't be used.
1647
1648 (However, if this class is not included in @code{GENERAL_REGS} and all
1649 of the insn patterns whose constraints permit this class are
1650 controlled by target switches, then GCC will automatically avoid using
1651 these registers when the target switches are opposed to them.)
1652
1653 @findex NON_SAVING_SETJMP
1654 @item NON_SAVING_SETJMP
1655 If this macro is defined and has a nonzero value, it means that
1656 @code{setjmp} and related functions fail to save the registers, or that
1657 @code{longjmp} fails to restore them.  To compensate, the compiler
1658 avoids putting variables in registers in functions that use
1659 @code{setjmp}.
1660
1661 @findex INCOMING_REGNO
1662 @item INCOMING_REGNO (@var{out})
1663 Define this macro if the target machine has register windows.  This C
1664 expression returns the register number as seen by the called function
1665 corresponding to the register number @var{out} as seen by the calling
1666 function.  Return @var{out} if register number @var{out} is not an
1667 outbound register.
1668
1669 @findex OUTGOING_REGNO
1670 @item OUTGOING_REGNO (@var{in})
1671 Define this macro if the target machine has register windows.  This C
1672 expression returns the register number as seen by the calling function
1673 corresponding to the register number @var{in} as seen by the called
1674 function.  Return @var{in} if register number @var{in} is not an inbound
1675 register.
1676
1677 @findex LOCAL_REGNO
1678 @item LOCAL_REGNO (@var{regno})
1679 Define this macro if the target machine has register windows.  This C
1680 expression returns true if the register is call-saved but is in the
1681 register window.  Unlike most call-saved registers, such registers
1682 need not be explicitly restored on function exit or during non-local
1683 gotos.
1684
1685 @ignore
1686 @findex PC_REGNUM
1687 @item PC_REGNUM
1688 If the program counter has a register number, define this as that
1689 register number.  Otherwise, do not define it.
1690 @end ignore
1691 @end table
1692
1693 @node Allocation Order
1694 @subsection Order of Allocation of Registers
1695 @cindex order of register allocation
1696 @cindex register allocation order
1697
1698 @c prevent bad page break with this line
1699 Registers are allocated in order.
1700
1701 @table @code
1702 @findex REG_ALLOC_ORDER
1703 @item REG_ALLOC_ORDER
1704 If defined, an initializer for a vector of integers, containing the
1705 numbers of hard registers in the order in which GCC should prefer
1706 to use them (from most preferred to least).
1707
1708 If this macro is not defined, registers are used lowest numbered first
1709 (all else being equal).
1710
1711 One use of this macro is on machines where the highest numbered
1712 registers must always be saved and the save-multiple-registers
1713 instruction supports only sequences of consecutive registers.  On such
1714 machines, define @code{REG_ALLOC_ORDER} to be an initializer that lists
1715 the highest numbered allocable register first.
1716
1717 @findex ORDER_REGS_FOR_LOCAL_ALLOC
1718 @item ORDER_REGS_FOR_LOCAL_ALLOC
1719 A C statement (sans semicolon) to choose the order in which to allocate
1720 hard registers for pseudo-registers local to a basic block.
1721
1722 Store the desired register order in the array @code{reg_alloc_order}.
1723 Element 0 should be the register to allocate first; element 1, the next
1724 register; and so on.
1725
1726 The macro body should not assume anything about the contents of
1727 @code{reg_alloc_order} before execution of the macro.
1728
1729 On most machines, it is not necessary to define this macro.
1730 @end table
1731
1732 @node Values in Registers
1733 @subsection How Values Fit in Registers
1734
1735 This section discusses the macros that describe which kinds of values
1736 (specifically, which machine modes) each register can hold, and how many
1737 consecutive registers are needed for a given mode.
1738
1739 @table @code
1740 @findex HARD_REGNO_NREGS
1741 @item HARD_REGNO_NREGS (@var{regno}, @var{mode})
1742 A C expression for the number of consecutive hard registers, starting
1743 at register number @var{regno}, required to hold a value of mode
1744 @var{mode}.
1745
1746 On a machine where all registers are exactly one word, a suitable
1747 definition of this macro is
1748
1749 @smallexample
1750 #define HARD_REGNO_NREGS(REGNO, MODE)            \
1751    ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
1752     / UNITS_PER_WORD)
1753 @end smallexample
1754
1755 @findex HARD_REGNO_MODE_OK
1756 @item HARD_REGNO_MODE_OK (@var{regno}, @var{mode})
1757 A C expression that is nonzero if it is permissible to store a value
1758 of mode @var{mode} in hard register number @var{regno} (or in several
1759 registers starting with that one).  For a machine where all registers
1760 are equivalent, a suitable definition is
1761
1762 @smallexample
1763 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
1764 @end smallexample
1765
1766 You need not include code to check for the numbers of fixed registers,
1767 because the allocation mechanism considers them to be always occupied.
1768
1769 @cindex register pairs
1770 On some machines, double-precision values must be kept in even/odd
1771 register pairs.  You can implement that by defining this macro to reject
1772 odd register numbers for such modes.
1773
1774 The minimum requirement for a mode to be OK in a register is that the
1775 @samp{mov@var{mode}} instruction pattern support moves between the
1776 register and other hard register in the same class and that moving a
1777 value into the register and back out not alter it.
1778
1779 Since the same instruction used to move @code{word_mode} will work for
1780 all narrower integer modes, it is not necessary on any machine for
1781 @code{HARD_REGNO_MODE_OK} to distinguish between these modes, provided
1782 you define patterns @samp{movhi}, etc., to take advantage of this.  This
1783 is useful because of the interaction between @code{HARD_REGNO_MODE_OK}
1784 and @code{MODES_TIEABLE_P}; it is very desirable for all integer modes
1785 to be tieable.
1786
1787 Many machines have special registers for floating point arithmetic.
1788 Often people assume that floating point machine modes are allowed only
1789 in floating point registers.  This is not true.  Any registers that
1790 can hold integers can safely @emph{hold} a floating point machine
1791 mode, whether or not floating arithmetic can be done on it in those
1792 registers.  Integer move instructions can be used to move the values.
1793
1794 On some machines, though, the converse is true: fixed-point machine
1795 modes may not go in floating registers.  This is true if the floating
1796 registers normalize any value stored in them, because storing a
1797 non-floating value there would garble it.  In this case,
1798 @code{HARD_REGNO_MODE_OK} should reject fixed-point machine modes in
1799 floating registers.  But if the floating registers do not automatically
1800 normalize, if you can store any bit pattern in one and retrieve it
1801 unchanged without a trap, then any machine mode may go in a floating
1802 register, so you can define this macro to say so.
1803
1804 The primary significance of special floating registers is rather that
1805 they are the registers acceptable in floating point arithmetic
1806 instructions.  However, this is of no concern to
1807 @code{HARD_REGNO_MODE_OK}.  You handle it by writing the proper
1808 constraints for those instructions.
1809
1810 On some machines, the floating registers are especially slow to access,
1811 so that it is better to store a value in a stack frame than in such a
1812 register if floating point arithmetic is not being done.  As long as the
1813 floating registers are not in class @code{GENERAL_REGS}, they will not
1814 be used unless some pattern's constraint asks for one.
1815
1816 @findex MODES_TIEABLE_P
1817 @item MODES_TIEABLE_P (@var{mode1}, @var{mode2})
1818 A C expression that is nonzero if a value of mode
1819 @var{mode1} is accessible in mode @var{mode2} without copying.
1820
1821 If @code{HARD_REGNO_MODE_OK (@var{r}, @var{mode1})} and
1822 @code{HARD_REGNO_MODE_OK (@var{r}, @var{mode2})} are always the same for
1823 any @var{r}, then @code{MODES_TIEABLE_P (@var{mode1}, @var{mode2})}
1824 should be nonzero.  If they differ for any @var{r}, you should define
1825 this macro to return zero unless some other mechanism ensures the
1826 accessibility of the value in a narrower mode.
1827
1828 You should define this macro to return nonzero in as many cases as
1829 possible since doing so will allow GCC to perform better register
1830 allocation.
1831
1832 @findex AVOID_CCMODE_COPIES
1833 @item AVOID_CCMODE_COPIES
1834 Define this macro if the compiler should avoid copies to/from @code{CCmode}
1835 registers.  You should only define this macro if support for copying to/from
1836 @code{CCmode} is incomplete.
1837
1838 @findex SUBREG_REGNO_OFFSET
1839 @item SUBREG_REGNO_OFFSET
1840 Define this macro if the compiler needs to handle subregs in a non-standard
1841 way.  The macro returns the correct regno offset for mode @code{YMODE} given
1842 a subreg of type @code{XMODE}.
1843 This macro takes 4 parameters:
1844 @table @code
1845 @item XREGNO
1846 A regno of an inner hard subreg_reg (or what will become one).
1847 @item XMODE
1848 The mode of xregno.
1849 @item OFFSET
1850 The byte offset.
1851 @item YMODE
1852 The mode of a top level SUBREG (or what may become one).
1853 @end table
1854 The default function can be found in rtlanal.c, function
1855 @code{subreg_regno_offset}. Normally this does not need to be defined.
1856 @end table
1857
1858 @node Leaf Functions
1859 @subsection Handling Leaf Functions
1860
1861 @cindex leaf functions
1862 @cindex functions, leaf
1863 On some machines, a leaf function (i.e., one which makes no calls) can run
1864 more efficiently if it does not make its own register window.  Often this
1865 means it is required to receive its arguments in the registers where they
1866 are passed by the caller, instead of the registers where they would
1867 normally arrive.
1868
1869 The special treatment for leaf functions generally applies only when
1870 other conditions are met; for example, often they may use only those
1871 registers for its own variables and temporaries.  We use the term ``leaf
1872 function'' to mean a function that is suitable for this special
1873 handling, so that functions with no calls are not necessarily ``leaf
1874 functions''.
1875
1876 GCC assigns register numbers before it knows whether the function is
1877 suitable for leaf function treatment.  So it needs to renumber the
1878 registers in order to output a leaf function.  The following macros
1879 accomplish this.
1880
1881 @table @code
1882 @findex LEAF_REGISTERS
1883 @item LEAF_REGISTERS
1884 Name of a char vector, indexed by hard register number, which
1885 contains 1 for a register that is allowable in a candidate for leaf
1886 function treatment.
1887
1888 If leaf function treatment involves renumbering the registers, then the
1889 registers marked here should be the ones before renumbering---those that
1890 GCC would ordinarily allocate.  The registers which will actually be
1891 used in the assembler code, after renumbering, should not be marked with 1
1892 in this vector.
1893
1894 Define this macro only if the target machine offers a way to optimize
1895 the treatment of leaf functions.
1896
1897 @findex LEAF_REG_REMAP
1898 @item LEAF_REG_REMAP (@var{regno})
1899 A C expression whose value is the register number to which @var{regno}
1900 should be renumbered, when a function is treated as a leaf function.
1901
1902 If @var{regno} is a register number which should not appear in a leaf
1903 function before renumbering, then the expression should yield @minus{}1, which
1904 will cause the compiler to abort.
1905
1906 Define this macro only if the target machine offers a way to optimize the
1907 treatment of leaf functions, and registers need to be renumbered to do
1908 this.
1909 @end table
1910
1911 @findex current_function_is_leaf
1912 @findex current_function_uses_only_leaf_regs
1913 Normally, @code{FUNCTION_PROLOGUE} and @code{FUNCTION_EPILOGUE} must
1914 treat leaf functions specially.  They can test the C variable
1915 @code{current_function_is_leaf} which is nonzero for leaf functions.
1916 @code{current_function_is_leaf} is set prior to local register allocation
1917 and is valid for the remaining compiler passes.  They can also test the C
1918 variable @code{current_function_uses_only_leaf_regs} which is nonzero for
1919 leaf functions which only use leaf registers.
1920 @code{current_function_uses_only_leaf_regs} is valid after reload and is
1921 only useful if @code{LEAF_REGISTERS} is defined.
1922 @c changed this to fix overfull.  ALSO:  why the "it" at the beginning
1923 @c of the next paragraph?!  --mew 2feb93
1924
1925 @node Stack Registers
1926 @subsection Registers That Form a Stack
1927
1928 There are special features to handle computers where some of the
1929 ``registers'' form a stack, as in the 80387 coprocessor for the 80386.
1930 Stack registers are normally written by pushing onto the stack, and are
1931 numbered relative to the top of the stack.
1932
1933 Currently, GCC can only handle one group of stack-like registers, and
1934 they must be consecutively numbered.
1935
1936 @table @code
1937 @findex STACK_REGS
1938 @item STACK_REGS
1939 Define this if the machine has any stack-like registers.
1940
1941 @findex FIRST_STACK_REG
1942 @item FIRST_STACK_REG
1943 The number of the first stack-like register.  This one is the top
1944 of the stack.
1945
1946 @findex LAST_STACK_REG
1947 @item LAST_STACK_REG
1948 The number of the last stack-like register.  This one is the bottom of
1949 the stack.
1950 @end table
1951
1952 @node Register Classes
1953 @section Register Classes
1954 @cindex register class definitions
1955 @cindex class definitions, register
1956
1957 On many machines, the numbered registers are not all equivalent.
1958 For example, certain registers may not be allowed for indexed addressing;
1959 certain registers may not be allowed in some instructions.  These machine
1960 restrictions are described to the compiler using @dfn{register classes}.
1961
1962 You define a number of register classes, giving each one a name and saying
1963 which of the registers belong to it.  Then you can specify register classes
1964 that are allowed as operands to particular instruction patterns.
1965
1966 @findex ALL_REGS
1967 @findex NO_REGS
1968 In general, each register will belong to several classes.  In fact, one
1969 class must be named @code{ALL_REGS} and contain all the registers.  Another
1970 class must be named @code{NO_REGS} and contain no registers.  Often the
1971 union of two classes will be another class; however, this is not required.
1972
1973 @findex GENERAL_REGS
1974 One of the classes must be named @code{GENERAL_REGS}.  There is nothing
1975 terribly special about the name, but the operand constraint letters
1976 @samp{r} and @samp{g} specify this class.  If @code{GENERAL_REGS} is
1977 the same as @code{ALL_REGS}, just define it as a macro which expands
1978 to @code{ALL_REGS}.
1979
1980 Order the classes so that if class @var{x} is contained in class @var{y}
1981 then @var{x} has a lower class number than @var{y}.
1982
1983 The way classes other than @code{GENERAL_REGS} are specified in operand
1984 constraints is through machine-dependent operand constraint letters.
1985 You can define such letters to correspond to various classes, then use
1986 them in operand constraints.
1987
1988 You should define a class for the union of two classes whenever some
1989 instruction allows both classes.  For example, if an instruction allows
1990 either a floating point (coprocessor) register or a general register for a
1991 certain operand, you should define a class @code{FLOAT_OR_GENERAL_REGS}
1992 which includes both of them.  Otherwise you will get suboptimal code.
1993
1994 You must also specify certain redundant information about the register
1995 classes: for each class, which classes contain it and which ones are
1996 contained in it; for each pair of classes, the largest class contained
1997 in their union.
1998
1999 When a value occupying several consecutive registers is expected in a
2000 certain class, all the registers used must belong to that class.
2001 Therefore, register classes cannot be used to enforce a requirement for
2002 a register pair to start with an even-numbered register.  The way to
2003 specify this requirement is with @code{HARD_REGNO_MODE_OK}.
2004
2005 Register classes used for input-operands of bitwise-and or shift
2006 instructions have a special requirement: each such class must have, for
2007 each fixed-point machine mode, a subclass whose registers can transfer that
2008 mode to or from memory.  For example, on some machines, the operations for
2009 single-byte values (@code{QImode}) are limited to certain registers.  When
2010 this is so, each register class that is used in a bitwise-and or shift
2011 instruction must have a subclass consisting of registers from which
2012 single-byte values can be loaded or stored.  This is so that
2013 @code{PREFERRED_RELOAD_CLASS} can always have a possible value to return.
2014
2015 @table @code
2016 @findex enum reg_class
2017 @item enum reg_class
2018 An enumeral type that must be defined with all the register class names
2019 as enumeral values.  @code{NO_REGS} must be first.  @code{ALL_REGS}
2020 must be the last register class, followed by one more enumeral value,
2021 @code{LIM_REG_CLASSES}, which is not a register class but rather
2022 tells how many classes there are.
2023
2024 Each register class has a number, which is the value of casting
2025 the class name to type @code{int}.  The number serves as an index
2026 in many of the tables described below.
2027
2028 @findex N_REG_CLASSES
2029 @item N_REG_CLASSES
2030 The number of distinct register classes, defined as follows:
2031
2032 @example
2033 #define N_REG_CLASSES (int) LIM_REG_CLASSES
2034 @end example
2035
2036 @findex REG_CLASS_NAMES
2037 @item REG_CLASS_NAMES
2038 An initializer containing the names of the register classes as C string
2039 constants.  These names are used in writing some of the debugging dumps.
2040
2041 @findex REG_CLASS_CONTENTS
2042 @item REG_CLASS_CONTENTS
2043 An initializer containing the contents of the register classes, as integers
2044 which are bit masks.  The @var{n}th integer specifies the contents of class
2045 @var{n}.  The way the integer @var{mask} is interpreted is that
2046 register @var{r} is in the class if @code{@var{mask} & (1 << @var{r})} is 1.
2047
2048 When the machine has more than 32 registers, an integer does not suffice.
2049 Then the integers are replaced by sub-initializers, braced groupings containing
2050 several integers.  Each sub-initializer must be suitable as an initializer
2051 for the type @code{HARD_REG_SET} which is defined in @file{hard-reg-set.h}.
2052 In this situation, the first integer in each sub-initializer corresponds to
2053 registers 0 through 31, the second integer to registers 32 through 63, and
2054 so on.
2055
2056 @findex REGNO_REG_CLASS
2057 @item REGNO_REG_CLASS (@var{regno})
2058 A C expression whose value is a register class containing hard register
2059 @var{regno}.  In general there is more than one such class; choose a class
2060 which is @dfn{minimal}, meaning that no smaller class also contains the
2061 register.
2062
2063 @findex BASE_REG_CLASS
2064 @item BASE_REG_CLASS
2065 A macro whose definition is the name of the class to which a valid
2066 base register must belong.  A base register is one used in an address
2067 which is the register value plus a displacement.
2068
2069 @findex INDEX_REG_CLASS
2070 @item INDEX_REG_CLASS
2071 A macro whose definition is the name of the class to which a valid
2072 index register must belong.  An index register is one used in an
2073 address where its value is either multiplied by a scale factor or
2074 added to another register (as well as added to a displacement).
2075
2076 @findex REG_CLASS_FROM_LETTER
2077 @item REG_CLASS_FROM_LETTER (@var{char})
2078 A C expression which defines the machine-dependent operand constraint
2079 letters for register classes.  If @var{char} is such a letter, the
2080 value should be the register class corresponding to it.  Otherwise,
2081 the value should be @code{NO_REGS}.  The register letter @samp{r},
2082 corresponding to class @code{GENERAL_REGS}, will not be passed
2083 to this macro; you do not need to handle it.
2084
2085 @findex REGNO_OK_FOR_BASE_P
2086 @item REGNO_OK_FOR_BASE_P (@var{num})
2087 A C expression which is nonzero if register number @var{num} is
2088 suitable for use as a base register in operand addresses.  It may be
2089 either a suitable hard register or a pseudo register that has been
2090 allocated such a hard register.
2091
2092 @findex REGNO_MODE_OK_FOR_BASE_P
2093 @item REGNO_MODE_OK_FOR_BASE_P (@var{num}, @var{mode})
2094 A C expression that is just like @code{REGNO_OK_FOR_BASE_P}, except that
2095 that expression may examine the mode of the memory reference in
2096 @var{mode}.  You should define this macro if the mode of the memory
2097 reference affects whether a register may be used as a base register.  If
2098 you define this macro, the compiler will use it instead of
2099 @code{REGNO_OK_FOR_BASE_P}.
2100
2101 @findex REGNO_OK_FOR_INDEX_P
2102 @item REGNO_OK_FOR_INDEX_P (@var{num})
2103 A C expression which is nonzero if register number @var{num} is
2104 suitable for use as an index register in operand addresses.  It may be
2105 either a suitable hard register or a pseudo register that has been
2106 allocated such a hard register.
2107
2108 The difference between an index register and a base register is that
2109 the index register may be scaled.  If an address involves the sum of
2110 two registers, neither one of them scaled, then either one may be
2111 labeled the ``base'' and the other the ``index''; but whichever
2112 labeling is used must fit the machine's constraints of which registers
2113 may serve in each capacity.  The compiler will try both labelings,
2114 looking for one that is valid, and will reload one or both registers
2115 only if neither labeling works.
2116
2117 @findex PREFERRED_RELOAD_CLASS
2118 @item PREFERRED_RELOAD_CLASS (@var{x}, @var{class})
2119 A C expression that places additional restrictions on the register class
2120 to use when it is necessary to copy value @var{x} into a register in class
2121 @var{class}.  The value is a register class; perhaps @var{class}, or perhaps
2122 another, smaller class.  On many machines, the following definition is
2123 safe:
2124
2125 @example
2126 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
2127 @end example
2128
2129 Sometimes returning a more restrictive class makes better code.  For
2130 example, on the 68000, when @var{x} is an integer constant that is in range
2131 for a @samp{moveq} instruction, the value of this macro is always
2132 @code{DATA_REGS} as long as @var{class} includes the data registers.
2133 Requiring a data register guarantees that a @samp{moveq} will be used.
2134
2135 If @var{x} is a @code{const_double}, by returning @code{NO_REGS}
2136 you can force @var{x} into a memory constant.  This is useful on
2137 certain machines where immediate floating values cannot be loaded into
2138 certain kinds of registers.
2139
2140 @findex PREFERRED_OUTPUT_RELOAD_CLASS
2141 @item PREFERRED_OUTPUT_RELOAD_CLASS (@var{x}, @var{class})
2142 Like @code{PREFERRED_RELOAD_CLASS}, but for output reloads instead of
2143 input reloads.  If you don't define this macro, the default is to use
2144 @var{class}, unchanged.
2145
2146 @findex LIMIT_RELOAD_CLASS
2147 @item LIMIT_RELOAD_CLASS (@var{mode}, @var{class})
2148 A C expression that places additional restrictions on the register class
2149 to use when it is necessary to be able to hold a value of mode
2150 @var{mode} in a reload register for which class @var{class} would
2151 ordinarily be used.
2152
2153 Unlike @code{PREFERRED_RELOAD_CLASS}, this macro should be used when
2154 there are certain modes that simply can't go in certain reload classes.
2155
2156 The value is a register class; perhaps @var{class}, or perhaps another,
2157 smaller class.
2158
2159 Don't define this macro unless the target machine has limitations which
2160 require the macro to do something nontrivial.
2161
2162 @findex SECONDARY_RELOAD_CLASS
2163 @findex SECONDARY_INPUT_RELOAD_CLASS
2164 @findex SECONDARY_OUTPUT_RELOAD_CLASS
2165 @item SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
2166 @itemx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
2167 @itemx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
2168 Many machines have some registers that cannot be copied directly to or
2169 from memory or even from other types of registers.  An example is the
2170 @samp{MQ} register, which on most machines, can only be copied to or
2171 from general registers, but not memory.  Some machines allow copying all
2172 registers to and from memory, but require a scratch register for stores
2173 to some memory locations (e.g., those with symbolic address on the RT,
2174 and those with certain symbolic address on the Sparc when compiling
2175 PIC).  In some cases, both an intermediate and a scratch register are
2176 required.
2177
2178 You should define these macros to indicate to the reload phase that it may
2179 need to allocate at least one register for a reload in addition to the
2180 register to contain the data.  Specifically, if copying @var{x} to a
2181 register @var{class} in @var{mode} requires an intermediate register,
2182 you should define @code{SECONDARY_INPUT_RELOAD_CLASS} to return the
2183 largest register class all of whose registers can be used as
2184 intermediate registers or scratch registers.
2185
2186 If copying a register @var{class} in @var{mode} to @var{x} requires an
2187 intermediate or scratch register, @code{SECONDARY_OUTPUT_RELOAD_CLASS}
2188 should be defined to return the largest register class required.  If the
2189 requirements for input and output reloads are the same, the macro
2190 @code{SECONDARY_RELOAD_CLASS} should be used instead of defining both
2191 macros identically.
2192
2193 The values returned by these macros are often @code{GENERAL_REGS}.
2194 Return @code{NO_REGS} if no spare register is needed; i.e., if @var{x}
2195 can be directly copied to or from a register of @var{class} in
2196 @var{mode} without requiring a scratch register.  Do not define this
2197 macro if it would always return @code{NO_REGS}.
2198
2199 If a scratch register is required (either with or without an
2200 intermediate register), you should define patterns for
2201 @samp{reload_in@var{m}} or @samp{reload_out@var{m}}, as required
2202 (@pxref{Standard Names}.  These patterns, which will normally be
2203 implemented with a @code{define_expand}, should be similar to the
2204 @samp{mov@var{m}} patterns, except that operand 2 is the scratch
2205 register.
2206
2207 Define constraints for the reload register and scratch register that
2208 contain a single register class.  If the original reload register (whose
2209 class is @var{class}) can meet the constraint given in the pattern, the
2210 value returned by these macros is used for the class of the scratch
2211 register.  Otherwise, two additional reload registers are required.
2212 Their classes are obtained from the constraints in the insn pattern.
2213
2214 @var{x} might be a pseudo-register or a @code{subreg} of a
2215 pseudo-register, which could either be in a hard register or in memory.
2216 Use @code{true_regnum} to find out; it will return @minus{}1 if the pseudo is
2217 in memory and the hard register number if it is in a register.
2218
2219 These macros should not be used in the case where a particular class of
2220 registers can only be copied to memory and not to another class of
2221 registers.  In that case, secondary reload registers are not needed and
2222 would not be helpful.  Instead, a stack location must be used to perform
2223 the copy and the @code{mov@var{m}} pattern should use memory as a
2224 intermediate storage.  This case often occurs between floating-point and
2225 general registers.
2226
2227 @findex SECONDARY_MEMORY_NEEDED
2228 @item SECONDARY_MEMORY_NEEDED (@var{class1}, @var{class2}, @var{m})
2229 Certain machines have the property that some registers cannot be copied
2230 to some other registers without using memory.  Define this macro on
2231 those machines to be a C expression that is non-zero if objects of mode
2232 @var{m} in registers of @var{class1} can only be copied to registers of
2233 class @var{class2} by storing a register of @var{class1} into memory
2234 and loading that memory location into a register of @var{class2}.
2235
2236 Do not define this macro if its value would always be zero.
2237
2238 @findex SECONDARY_MEMORY_NEEDED_RTX
2239 @item SECONDARY_MEMORY_NEEDED_RTX (@var{mode})
2240 Normally when @code{SECONDARY_MEMORY_NEEDED} is defined, the compiler
2241 allocates a stack slot for a memory location needed for register copies.
2242 If this macro is defined, the compiler instead uses the memory location
2243 defined by this macro.
2244
2245 Do not define this macro if you do not define
2246 @code{SECONDARY_MEMORY_NEEDED}.
2247
2248 @findex SECONDARY_MEMORY_NEEDED_MODE
2249 @item SECONDARY_MEMORY_NEEDED_MODE (@var{mode})
2250 When the compiler needs a secondary memory location to copy between two
2251 registers of mode @var{mode}, it normally allocates sufficient memory to
2252 hold a quantity of @code{BITS_PER_WORD} bits and performs the store and
2253 load operations in a mode that many bits wide and whose class is the
2254 same as that of @var{mode}.
2255
2256 This is right thing to do on most machines because it ensures that all
2257 bits of the register are copied and prevents accesses to the registers
2258 in a narrower mode, which some machines prohibit for floating-point
2259 registers.
2260
2261 However, this default behavior is not correct on some machines, such as
2262 the DEC Alpha, that store short integers in floating-point registers
2263 differently than in integer registers.  On those machines, the default
2264 widening will not work correctly and you must define this macro to
2265 suppress that widening in some cases.  See the file @file{alpha.h} for
2266 details.
2267
2268 Do not define this macro if you do not define
2269 @code{SECONDARY_MEMORY_NEEDED} or if widening @var{mode} to a mode that
2270 is @code{BITS_PER_WORD} bits wide is correct for your machine.
2271
2272 @findex SMALL_REGISTER_CLASSES
2273 @item SMALL_REGISTER_CLASSES
2274 On some machines, it is risky to let hard registers live across arbitrary
2275 insns.  Typically, these machines have instructions that require values
2276 to be in specific registers (like an accumulator), and reload will fail
2277 if the required hard register is used for another purpose across such an
2278 insn.
2279
2280 Define @code{SMALL_REGISTER_CLASSES} to be an expression with a non-zero
2281 value on these machines.  When this macro has a non-zero value, the
2282 compiler will try to minimize the lifetime of hard registers.
2283
2284 It is always safe to define this macro with a non-zero value, but if you
2285 unnecessarily define it, you will reduce the amount of optimizations
2286 that can be performed in some cases.  If you do not define this macro
2287 with a non-zero value when it is required, the compiler will run out of
2288 spill registers and print a fatal error message.  For most machines, you
2289 should not define this macro at all.
2290
2291 @findex CLASS_LIKELY_SPILLED_P
2292 @item CLASS_LIKELY_SPILLED_P (@var{class})
2293 A C expression whose value is nonzero if pseudos that have been assigned
2294 to registers of class @var{class} would likely be spilled because
2295 registers of @var{class} are needed for spill registers.
2296
2297 The default value of this macro returns 1 if @var{class} has exactly one
2298 register and zero otherwise.  On most machines, this default should be
2299 used.  Only define this macro to some other expression if pseudos
2300 allocated by @file{local-alloc.c} end up in memory because their hard
2301 registers were needed for spill registers.  If this macro returns nonzero
2302 for those classes, those pseudos will only be allocated by
2303 @file{global.c}, which knows how to reallocate the pseudo to another
2304 register.  If there would not be another register available for
2305 reallocation, you should not change the definition of this macro since
2306 the only effect of such a definition would be to slow down register
2307 allocation.
2308
2309 @findex CLASS_MAX_NREGS
2310 @item CLASS_MAX_NREGS (@var{class}, @var{mode})
2311 A C expression for the maximum number of consecutive registers
2312 of class @var{class} needed to hold a value of mode @var{mode}.
2313
2314 This is closely related to the macro @code{HARD_REGNO_NREGS}.  In fact,
2315 the value of the macro @code{CLASS_MAX_NREGS (@var{class}, @var{mode})}
2316 should be the maximum value of @code{HARD_REGNO_NREGS (@var{regno},
2317 @var{mode})} for all @var{regno} values in the class @var{class}.
2318
2319 This macro helps control the handling of multiple-word values
2320 in the reload pass.
2321
2322 @item CLASS_CANNOT_CHANGE_MODE
2323 If defined, a C expression for a class that contains registers for
2324 which the compiler may not change modes arbitrarily.
2325
2326 @item CLASS_CANNOT_CHANGE_MODE_P(@var{from}, @var{to})
2327 A C expression that is true if, for a register in
2328 @code{CLASS_CANNOT_CHANGE_MODE}, the requested mode punning is illegal.
2329
2330 For the example, loading 32-bit integer or floating-point objects into
2331 floating-point registers on the Alpha extends them to 64-bits.
2332 Therefore loading a 64-bit object and then storing it as a 32-bit object
2333 does not store the low-order 32-bits, as would be the case for a normal
2334 register.  Therefore, @file{alpha.h} defines @code{CLASS_CANNOT_CHANGE_MODE}
2335 as @code{FLOAT_REGS} and @code{CLASS_CANNOT_CHANGE_MODE_P} restricts
2336 mode changes to same-size modes.
2337
2338 Compare this to IA-64, which extends floating-point values to 82-bits,
2339 and stores 64-bit integers in a different format than 64-bit doubles.
2340 Therefore @code{CLASS_CANNOT_CHANGE_MODE_P} is always true.
2341 @end table
2342
2343 Three other special macros describe which operands fit which constraint
2344 letters.
2345
2346 @table @code
2347 @findex CONST_OK_FOR_LETTER_P
2348 @item CONST_OK_FOR_LETTER_P (@var{value}, @var{c})
2349 A C expression that defines the machine-dependent operand constraint
2350 letters (@samp{I}, @samp{J}, @samp{K}, @dots{} @samp{P}) that specify
2351 particular ranges of integer values.  If @var{c} is one of those
2352 letters, the expression should check that @var{value}, an integer, is in
2353 the appropriate range and return 1 if so, 0 otherwise.  If @var{c} is
2354 not one of those letters, the value should be 0 regardless of
2355 @var{value}.
2356
2357 @findex CONST_DOUBLE_OK_FOR_LETTER_P
2358 @item CONST_DOUBLE_OK_FOR_LETTER_P (@var{value}, @var{c})
2359 A C expression that defines the machine-dependent operand constraint
2360 letters that specify particular ranges of @code{const_double} values
2361 (@samp{G} or @samp{H}).
2362
2363 If @var{c} is one of those letters, the expression should check that
2364 @var{value}, an RTX of code @code{const_double}, is in the appropriate
2365 range and return 1 if so, 0 otherwise.  If @var{c} is not one of those
2366 letters, the value should be 0 regardless of @var{value}.
2367
2368 @code{const_double} is used for all floating-point constants and for
2369 @code{DImode} fixed-point constants.  A given letter can accept either
2370 or both kinds of values.  It can use @code{GET_MODE} to distinguish
2371 between these kinds.
2372
2373 @findex EXTRA_CONSTRAINT
2374 @item EXTRA_CONSTRAINT (@var{value}, @var{c})
2375 A C expression that defines the optional machine-dependent constraint
2376 letters that can be used to segregate specific types of operands, usually
2377 memory references, for the target machine.  Any letter that is not
2378 elsewhere defined and not matched by @code{REG_CLASS_FROM_LETTER}
2379 may be used.  Normally this macro will not be defined.
2380
2381 If it is required for a particular target machine, it should return 1
2382 if @var{value} corresponds to the operand type represented by the
2383 constraint letter @var{c}.  If @var{c} is not defined as an extra
2384 constraint, the value returned should be 0 regardless of @var{value}.
2385
2386 For example, on the ROMP, load instructions cannot have their output
2387 in r0 if the memory reference contains a symbolic address.  Constraint
2388 letter @samp{Q} is defined as representing a memory address that does
2389 @emph{not} contain a symbolic address.  An alternative is specified with
2390 a @samp{Q} constraint on the input and @samp{r} on the output.  The next
2391 alternative specifies @samp{m} on the input and a register class that
2392 does not include r0 on the output.
2393 @end table
2394
2395 @node Stack and Calling
2396 @section Stack Layout and Calling Conventions
2397 @cindex calling conventions
2398
2399 @c prevent bad page break with this line
2400 This describes the stack layout and calling conventions.
2401
2402 @menu
2403 * Frame Layout::
2404 * Stack Checking::
2405 * Frame Registers::
2406 * Elimination::
2407 * Stack Arguments::
2408 * Register Arguments::
2409 * Scalar Return::
2410 * Aggregate Return::
2411 * Caller Saves::
2412 * Function Entry::
2413 * Profiling::
2414 * Inlining::
2415 * Tail Calling::
2416 @end menu
2417
2418 @node Frame Layout
2419 @subsection Basic Stack Layout
2420 @cindex stack frame layout
2421 @cindex frame layout
2422
2423 @c prevent bad page break with this line
2424 Here is the basic stack layout.
2425
2426 @table @code
2427 @findex STACK_GROWS_DOWNWARD
2428 @item STACK_GROWS_DOWNWARD
2429 Define this macro if pushing a word onto the stack moves the stack
2430 pointer to a smaller address.
2431
2432 When we say, ``define this macro if @dots{},'' it means that the
2433 compiler checks this macro only with @code{#ifdef} so the precise
2434 definition used does not matter.
2435
2436 @findex FRAME_GROWS_DOWNWARD
2437 @item FRAME_GROWS_DOWNWARD
2438 Define this macro if the addresses of local variable slots are at negative
2439 offsets from the frame pointer.
2440
2441 @findex ARGS_GROW_DOWNWARD
2442 @item ARGS_GROW_DOWNWARD
2443 Define this macro if successive arguments to a function occupy decreasing
2444 addresses on the stack.
2445
2446 @findex STARTING_FRAME_OFFSET
2447 @item STARTING_FRAME_OFFSET
2448 Offset from the frame pointer to the first local variable slot to be allocated.
2449
2450 If @code{FRAME_GROWS_DOWNWARD}, find the next slot's offset by
2451 subtracting the first slot's length from @code{STARTING_FRAME_OFFSET}.
2452 Otherwise, it is found by adding the length of the first slot to the
2453 value @code{STARTING_FRAME_OFFSET}.
2454 @c i'm not sure if the above is still correct.. had to change it to get
2455 @c rid of an overfull.  --mew 2feb93
2456
2457 @findex STACK_POINTER_OFFSET
2458 @item STACK_POINTER_OFFSET
2459 Offset from the stack pointer register to the first location at which
2460 outgoing arguments are placed.  If not specified, the default value of
2461 zero is used.  This is the proper value for most machines.
2462
2463 If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
2464 the first location at which outgoing arguments are placed.
2465
2466 @findex FIRST_PARM_OFFSET
2467 @item FIRST_PARM_OFFSET (@var{fundecl})
2468 Offset from the argument pointer register to the first argument's
2469 address.  On some machines it may depend on the data type of the
2470 function.
2471
2472 If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
2473 the first argument's address.
2474
2475 @findex STACK_DYNAMIC_OFFSET
2476 @item STACK_DYNAMIC_OFFSET (@var{fundecl})
2477 Offset from the stack pointer register to an item dynamically allocated
2478 on the stack, e.g., by @code{alloca}.
2479
2480 The default value for this macro is @code{STACK_POINTER_OFFSET} plus the
2481 length of the outgoing arguments.  The default is correct for most
2482 machines.  See @file{function.c} for details.
2483
2484 @findex DYNAMIC_CHAIN_ADDRESS
2485 @item DYNAMIC_CHAIN_ADDRESS (@var{frameaddr})
2486 A C expression whose value is RTL representing the address in a stack
2487 frame where the pointer to the caller's frame is stored.  Assume that
2488 @var{frameaddr} is an RTL expression for the address of the stack frame
2489 itself.
2490
2491 If you don't define this macro, the default is to return the value
2492 of @var{frameaddr}---that is, the stack frame address is also the
2493 address of the stack word that points to the previous frame.
2494
2495 @findex SETUP_FRAME_ADDRESSES
2496 @item SETUP_FRAME_ADDRESSES
2497 If defined, a C expression that produces the machine-specific code to
2498 setup the stack so that arbitrary frames can be accessed.  For example,
2499 on the Sparc, we must flush all of the register windows to the stack
2500 before we can access arbitrary stack frames.  You will seldom need to
2501 define this macro.
2502
2503 @findex BUILTIN_SETJMP_FRAME_VALUE
2504 @item BUILTIN_SETJMP_FRAME_VALUE
2505 If defined, a C expression that contains an rtx that is used to store
2506 the address of the current frame into the built in @code{setjmp} buffer.
2507 The default value, @code{virtual_stack_vars_rtx}, is correct for most
2508 machines.  One reason you may need to define this macro is if
2509 @code{hard_frame_pointer_rtx} is the appropriate value on your machine.
2510
2511 @findex RETURN_ADDR_RTX
2512 @item RETURN_ADDR_RTX (@var{count}, @var{frameaddr})
2513 A C expression whose value is RTL representing the value of the return
2514 address for the frame @var{count} steps up from the current frame, after
2515 the prologue.  @var{frameaddr} is the frame pointer of the @var{count}
2516 frame, or the frame pointer of the @var{count} @minus{} 1 frame if
2517 @code{RETURN_ADDR_IN_PREVIOUS_FRAME} is defined.
2518
2519 The value of the expression must always be the correct address when
2520 @var{count} is zero, but may be @code{NULL_RTX} if there is not way to
2521 determine the return address of other frames.
2522
2523 @findex RETURN_ADDR_IN_PREVIOUS_FRAME
2524 @item RETURN_ADDR_IN_PREVIOUS_FRAME
2525 Define this if the return address of a particular stack frame is accessed
2526 from the frame pointer of the previous stack frame.
2527
2528 @findex INCOMING_RETURN_ADDR_RTX
2529 @item INCOMING_RETURN_ADDR_RTX
2530 A C expression whose value is RTL representing the location of the
2531 incoming return address at the beginning of any function, before the
2532 prologue.  This RTL is either a @code{REG}, indicating that the return
2533 value is saved in @samp{REG}, or a @code{MEM} representing a location in
2534 the stack.
2535
2536 You only need to define this macro if you want to support call frame
2537 debugging information like that provided by DWARF 2.
2538
2539 If this RTL is a @code{REG}, you should also define
2540 DWARF_FRAME_RETURN_COLUMN to @code{DWARF_FRAME_REGNUM (REGNO)}.
2541
2542 @findex INCOMING_FRAME_SP_OFFSET
2543 @item INCOMING_FRAME_SP_OFFSET
2544 A C expression whose value is an integer giving the offset, in bytes,
2545 from the value of the stack pointer register to the top of the stack
2546 frame at the beginning of any function, before the prologue.  The top of
2547 the frame is defined to be the value of the stack pointer in the
2548 previous frame, just before the call instruction.
2549
2550 You only need to define this macro if you want to support call frame
2551 debugging information like that provided by DWARF 2.
2552
2553 @findex ARG_POINTER_CFA_OFFSET
2554 @item ARG_POINTER_CFA_OFFSET (@var{fundecl})
2555 A C expression whose value is an integer giving the offset, in bytes,
2556 from the argument pointer to the canonical frame address (cfa).  The
2557 final value should coincide with that calculated by
2558 @code{INCOMING_FRAME_SP_OFFSET}.  Which is unfortunately not usable
2559 during virtual register instantiation.
2560
2561 The default value for this macro is @code{FIRST_PARM_OFFSET (fundecl)},
2562 which is correct for most machines; in general, the arguments are found
2563 immediately before the stack frame.  Note that this is not the case on
2564 some targets that save registers into the caller's frame, such as SPARC
2565 and rs6000, and so such targets need to define this macro.
2566
2567 You only need to define this macro if the default is incorrect, and you
2568 want to support call frame debugging information like that provided by
2569 DWARF 2.
2570
2571 @findex EH_RETURN_DATA_REGNO
2572 @item EH_RETURN_DATA_REGNO (@var{N})
2573 A C expression whose value is the @var{N}th register number used for
2574 data by exception handlers, or @code{INVALID_REGNUM} if fewer than
2575 @var{N} registers are usable.
2576
2577 The exception handling library routines communicate with the exception
2578 handlers via a set of agreed upon registers.  Ideally these registers
2579 should be call-clobbered; it is possible to use call-saved registers,
2580 but may negatively impact code size.  The target must support at least
2581 2 data registers, but should define 4 if there are enough free registers.
2582
2583 You must define this macro if you want to support call frame exception
2584 handling like that provided by DWARF 2.
2585
2586 @findex EH_RETURN_STACKADJ_RTX
2587 @item EH_RETURN_STACKADJ_RTX
2588 A C expression whose value is RTL representing a location in which
2589 to store a stack adjustment to be applied before function return.
2590 This is used to unwind the stack to an exception handler's call frame.
2591 It will be assigned zero on code paths that return normally.
2592
2593 Typically this is a call-clobbered hard register that is otherwise
2594 untouched by the epilogue, but could also be a stack slot.
2595
2596 You must define this macro if you want to support call frame exception
2597 handling like that provided by DWARF 2.
2598
2599 @findex EH_RETURN_HANDLER_RTX
2600 @item EH_RETURN_HANDLER_RTX
2601 A C expression whose value is RTL representing a location in which
2602 to store the address of an exception handler to which we should
2603 return.  It will not be assigned on code paths that return normally.
2604
2605 Typically this is the location in the call frame at which the normal
2606 return address is stored.  For targets that return by popping an
2607 address off the stack, this might be a memory address just below
2608 the @emph{target} call frame rather than inside the current call
2609 frame.  @code{EH_RETURN_STACKADJ_RTX} will have already been assigned,
2610 so it may be used to calculate the location of the target call frame.
2611
2612 Some targets have more complex requirements than storing to an
2613 address calculable during initial code generation.  In that case
2614 the @code{eh_return} instruction pattern should be used instead.
2615
2616 If you want to support call frame exception handling, you must
2617 define either this macro or the @code{eh_return} instruction pattern.
2618
2619 @findex ASM_PREFERRED_EH_DATA_FORMAT
2620 @item ASM_PREFERRED_EH_DATA_FORMAT(@var{CODE}, @var{GLOBAL})
2621 This macro chooses the encoding of pointers embedded in the exception
2622 handling sections.  If at all possible, this should be defined such
2623 that the exception handling section will not require dynamic relocations,
2624 and so may be read-only.
2625
2626 @var{CODE} is 0 for data, 1 for code labels, 2 for function pointers.
2627 @var{GLOBAL} is true if the symbol may be affected by dynamic relocations.
2628 The macro should return a combination of the @code{DW_EH_PE_*} defines
2629 as found in @file{dwarf2.h}.
2630
2631 If this macro is not defined, pointers will not be encoded but
2632 represented directly.
2633
2634 @findex ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
2635 @item ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(@var{FILE}, @var{ENCODING}, @var{SIZE}, @var{ADDR}, @var{DONE})
2636 This macro allows the target to emit whatever special magic is required
2637 to represent the encoding chosen by @code{ASM_PREFERRED_EH_DATA_FORMAT}.
2638 Generic code takes care of pc-relative and indirect encodings; this must
2639 be defined if the target uses text-relative or data-relative encodings.
2640
2641 This is a C statement that branches to @var{DONE} if the format was
2642 handled.  @var{ENCODING} is the format chosen, @var{SIZE} is the number
2643 of bytes that the format occupies, @var{ADDR} is the @code{SYMBOL_REF}
2644 to be emitted.
2645
2646 @findex SMALL_STACK
2647 @item SMALL_STACK
2648 Define this macro if the stack size for the target is very small.  This
2649 has the effect of disabling gcc's built-in @samp{alloca}, though
2650 @samp{__builtin_alloca} is not affected.
2651 @end table
2652
2653 @node Stack Checking
2654 @subsection Specifying How Stack Checking is Done
2655
2656 GCC will check that stack references are within the boundaries of
2657 the stack, if the @option{-fstack-check} is specified, in one of three ways:
2658
2659 @enumerate
2660 @item
2661 If the value of the @code{STACK_CHECK_BUILTIN} macro is nonzero, GCC
2662 will assume that you have arranged for stack checking to be done at
2663 appropriate places in the configuration files, e.g., in
2664 @code{FUNCTION_PROLOGUE}.  GCC will do not other special processing.
2665
2666 @item
2667 If @code{STACK_CHECK_BUILTIN} is zero and you defined a named pattern
2668 called @code{check_stack} in your @file{md} file, GCC will call that
2669 pattern with one argument which is the address to compare the stack
2670 value against.  You must arrange for this pattern to report an error if
2671 the stack pointer is out of range.
2672
2673 @item
2674 If neither of the above are true, GCC will generate code to periodically
2675 ``probe'' the stack pointer using the values of the macros defined below.
2676 @end enumerate
2677
2678 Normally, you will use the default values of these macros, so GCC
2679 will use the third approach.
2680
2681 @table @code
2682 @findex STACK_CHECK_BUILTIN
2683 @item STACK_CHECK_BUILTIN
2684 A nonzero value if stack checking is done by the configuration files in a
2685 machine-dependent manner.  You should define this macro if stack checking
2686 is require by the ABI of your machine or if you would like to have to stack
2687 checking in some more efficient way than GCC's portable approach.
2688 The default value of this macro is zero.
2689
2690 @findex STACK_CHECK_PROBE_INTERVAL
2691 @item STACK_CHECK_PROBE_INTERVAL
2692 An integer representing the interval at which GCC must generate stack
2693 probe instructions.  You will normally define this macro to be no larger
2694 than the size of the ``guard pages'' at the end of a stack area.  The
2695 default value of 4096 is suitable for most systems.
2696
2697 @findex STACK_CHECK_PROBE_LOAD
2698 @item STACK_CHECK_PROBE_LOAD
2699 A integer which is nonzero if GCC should perform the stack probe
2700 as a load instruction and zero if GCC should use a store instruction.
2701 The default is zero, which is the most efficient choice on most systems.
2702
2703 @findex STACK_CHECK_PROTECT
2704 @item STACK_CHECK_PROTECT
2705 The number of bytes of stack needed to recover from a stack overflow,
2706 for languages where such a recovery is supported.  The default value of
2707 75 words should be adequate for most machines.
2708
2709 @findex STACK_CHECK_MAX_FRAME_SIZE
2710 @item STACK_CHECK_MAX_FRAME_SIZE
2711 The maximum size of a stack frame, in bytes.  GCC will generate probe
2712 instructions in non-leaf functions to ensure at least this many bytes of
2713 stack are available.  If a stack frame is larger than this size, stack
2714 checking will not be reliable and GCC will issue a warning.  The
2715 default is chosen so that GCC only generates one instruction on most
2716 systems.  You should normally not change the default value of this macro.
2717
2718 @findex STACK_CHECK_FIXED_FRAME_SIZE
2719 @item STACK_CHECK_FIXED_FRAME_SIZE
2720 GCC uses this value to generate the above warning message.  It
2721 represents the amount of fixed frame used by a function, not including
2722 space for any callee-saved registers, temporaries and user variables.
2723 You need only specify an upper bound for this amount and will normally
2724 use the default of four words.
2725
2726 @findex STACK_CHECK_MAX_VAR_SIZE
2727 @item STACK_CHECK_MAX_VAR_SIZE
2728 The maximum size, in bytes, of an object that GCC will place in the
2729 fixed area of the stack frame when the user specifies
2730 @option{-fstack-check}.
2731 GCC computed the default from the values of the above macros and you will
2732 normally not need to override that default.
2733 @end table
2734
2735 @need 2000
2736 @node Frame Registers
2737 @subsection Registers That Address the Stack Frame
2738
2739 @c prevent bad page break with this line
2740 This discusses registers that address the stack frame.
2741
2742 @table @code
2743 @findex STACK_POINTER_REGNUM
2744 @item STACK_POINTER_REGNUM
2745 The register number of the stack pointer register, which must also be a
2746 fixed register according to @code{FIXED_REGISTERS}.  On most machines,
2747 the hardware determines which register this is.
2748
2749 @findex FRAME_POINTER_REGNUM
2750 @item FRAME_POINTER_REGNUM
2751 The register number of the frame pointer register, which is used to
2752 access automatic variables in the stack frame.  On some machines, the
2753 hardware determines which register this is.  On other machines, you can
2754 choose any register you wish for this purpose.
2755
2756 @findex HARD_FRAME_POINTER_REGNUM
2757 @item HARD_FRAME_POINTER_REGNUM
2758 On some machines the offset between the frame pointer and starting
2759 offset of the automatic variables is not known until after register
2760 allocation has been done (for example, because the saved registers are
2761 between these two locations).  On those machines, define
2762 @code{FRAME_POINTER_REGNUM} the number of a special, fixed register to
2763 be used internally until the offset is known, and define
2764 @code{HARD_FRAME_POINTER_REGNUM} to be the actual hard register number
2765 used for the frame pointer.
2766
2767 You should define this macro only in the very rare circumstances when it
2768 is not possible to calculate the offset between the frame pointer and
2769 the automatic variables until after register allocation has been
2770 completed.  When this macro is defined, you must also indicate in your
2771 definition of @code{ELIMINABLE_REGS} how to eliminate
2772 @code{FRAME_POINTER_REGNUM} into either @code{HARD_FRAME_POINTER_REGNUM}
2773 or @code{STACK_POINTER_REGNUM}.
2774
2775 Do not define this macro if it would be the same as
2776 @code{FRAME_POINTER_REGNUM}.
2777
2778 @findex ARG_POINTER_REGNUM
2779 @item ARG_POINTER_REGNUM
2780 The register number of the arg pointer register, which is used to access
2781 the function's argument list.  On some machines, this is the same as the
2782 frame pointer register.  On some machines, the hardware determines which
2783 register this is.  On other machines, you can choose any register you
2784 wish for this purpose.  If this is not the same register as the frame
2785 pointer register, then you must mark it as a fixed register according to
2786 @code{FIXED_REGISTERS}, or arrange to be able to eliminate it
2787 (@pxref{Elimination}).
2788
2789 @findex RETURN_ADDRESS_POINTER_REGNUM
2790 @item RETURN_ADDRESS_POINTER_REGNUM
2791 The register number of the return address pointer register, which is used to
2792 access the current function's return address from the stack.  On some
2793 machines, the return address is not at a fixed offset from the frame
2794 pointer or stack pointer or argument pointer.  This register can be defined
2795 to point to the return address on the stack, and then be converted by
2796 @code{ELIMINABLE_REGS} into either the frame pointer or stack pointer.
2797
2798 Do not define this macro unless there is no other way to get the return
2799 address from the stack.
2800
2801 @findex STATIC_CHAIN_REGNUM
2802 @findex STATIC_CHAIN_INCOMING_REGNUM
2803 @item STATIC_CHAIN_REGNUM
2804 @itemx STATIC_CHAIN_INCOMING_REGNUM
2805 Register numbers used for passing a function's static chain pointer.  If
2806 register windows are used, the register number as seen by the called
2807 function is @code{STATIC_CHAIN_INCOMING_REGNUM}, while the register
2808 number as seen by the calling function is @code{STATIC_CHAIN_REGNUM}.  If
2809 these registers are the same, @code{STATIC_CHAIN_INCOMING_REGNUM} need
2810 not be defined.@refill
2811
2812 The static chain register need not be a fixed register.
2813
2814 If the static chain is passed in memory, these macros should not be
2815 defined; instead, the next two macros should be defined.
2816
2817 @findex STATIC_CHAIN
2818 @findex STATIC_CHAIN_INCOMING
2819 @item STATIC_CHAIN
2820 @itemx STATIC_CHAIN_INCOMING
2821 If the static chain is passed in memory, these macros provide rtx giving
2822 @code{mem} expressions that denote where they are stored.
2823 @code{STATIC_CHAIN} and @code{STATIC_CHAIN_INCOMING} give the locations
2824 as seen by the calling and called functions, respectively.  Often the former
2825 will be at an offset from the stack pointer and the latter at an offset from
2826 the frame pointer.@refill
2827
2828 @findex stack_pointer_rtx
2829 @findex frame_pointer_rtx
2830 @findex arg_pointer_rtx
2831 The variables @code{stack_pointer_rtx}, @code{frame_pointer_rtx}, and
2832 @code{arg_pointer_rtx} will have been initialized prior to the use of these
2833 macros and should be used to refer to those items.
2834
2835 If the static chain is passed in a register, the two previous macros should
2836 be defined instead.
2837 @end table
2838
2839 @node Elimination
2840 @subsection Eliminating Frame Pointer and Arg Pointer
2841
2842 @c prevent bad page break with this line
2843 This is about eliminating the frame pointer and arg pointer.
2844
2845 @table @code
2846 @findex FRAME_POINTER_REQUIRED
2847 @item FRAME_POINTER_REQUIRED
2848 A C expression which is nonzero if a function must have and use a frame
2849 pointer.  This expression is evaluated  in the reload pass.  If its value is
2850 nonzero the function will have a frame pointer.
2851
2852 The expression can in principle examine the current function and decide
2853 according to the facts, but on most machines the constant 0 or the
2854 constant 1 suffices.  Use 0 when the machine allows code to be generated
2855 with no frame pointer, and doing so saves some time or space.  Use 1
2856 when there is no possible advantage to avoiding a frame pointer.
2857
2858 In certain cases, the compiler does not know how to produce valid code
2859 without a frame pointer.  The compiler recognizes those cases and
2860 automatically gives the function a frame pointer regardless of what
2861 @code{FRAME_POINTER_REQUIRED} says.  You don't need to worry about
2862 them.@refill
2863
2864 In a function that does not require a frame pointer, the frame pointer
2865 register can be allocated for ordinary usage, unless you mark it as a
2866 fixed register.  See @code{FIXED_REGISTERS} for more information.
2867
2868 @findex INITIAL_FRAME_POINTER_OFFSET
2869 @findex get_frame_size
2870 @item INITIAL_FRAME_POINTER_OFFSET (@var{depth-var})
2871 A C statement to store in the variable @var{depth-var} the difference
2872 between the frame pointer and the stack pointer values immediately after
2873 the function prologue.  The value would be computed from information
2874 such as the result of @code{get_frame_size ()} and the tables of
2875 registers @code{regs_ever_live} and @code{call_used_regs}.
2876
2877 If @code{ELIMINABLE_REGS} is defined, this macro will be not be used and
2878 need not be defined.  Otherwise, it must be defined even if
2879 @code{FRAME_POINTER_REQUIRED} is defined to always be true; in that
2880 case, you may set @var{depth-var} to anything.
2881
2882 @findex ELIMINABLE_REGS
2883 @item ELIMINABLE_REGS
2884 If defined, this macro specifies a table of register pairs used to
2885 eliminate unneeded registers that point into the stack frame.  If it is not
2886 defined, the only elimination attempted by the compiler is to replace
2887 references to the frame pointer with references to the stack pointer.
2888
2889 The definition of this macro is a list of structure initializations, each
2890 of which specifies an original and replacement register.
2891
2892 On some machines, the position of the argument pointer is not known until
2893 the compilation is completed.  In such a case, a separate hard register
2894 must be used for the argument pointer.  This register can be eliminated by
2895 replacing it with either the frame pointer or the argument pointer,
2896 depending on whether or not the frame pointer has been eliminated.
2897
2898 In this case, you might specify:
2899 @example
2900 #define ELIMINABLE_REGS  \
2901 @{@{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM@}, \
2902  @{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM@}, \
2903  @{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM@}@}
2904 @end example
2905
2906 Note that the elimination of the argument pointer with the stack pointer is
2907 specified first since that is the preferred elimination.
2908
2909 @findex CAN_ELIMINATE
2910 @item CAN_ELIMINATE (@var{from-reg}, @var{to-reg})
2911 A C expression that returns non-zero if the compiler is allowed to try
2912 to replace register number @var{from-reg} with register number
2913 @var{to-reg}.  This macro need only be defined if @code{ELIMINABLE_REGS}
2914 is defined, and will usually be the constant 1, since most of the cases
2915 preventing register elimination are things that the compiler already
2916 knows about.
2917
2918 @findex INITIAL_ELIMINATION_OFFSET
2919 @item INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var})
2920 This macro is similar to @code{INITIAL_FRAME_POINTER_OFFSET}.  It
2921 specifies the initial difference between the specified pair of
2922 registers.  This macro must be defined if @code{ELIMINABLE_REGS} is
2923 defined.
2924
2925 @findex LONGJMP_RESTORE_FROM_STACK
2926 @item LONGJMP_RESTORE_FROM_STACK
2927 Define this macro if the @code{longjmp} function restores registers from
2928 the stack frames, rather than from those saved specifically by
2929 @code{setjmp}.  Certain quantities must not be kept in registers across
2930 a call to @code{setjmp} on such machines.
2931 @end table
2932
2933 @node Stack Arguments
2934 @subsection Passing Function Arguments on the Stack
2935 @cindex arguments on stack
2936 @cindex stack arguments
2937
2938 The macros in this section control how arguments are passed
2939 on the stack.  See the following section for other macros that
2940 control passing certain arguments in registers.
2941
2942 @table @code
2943 @findex PROMOTE_PROTOTYPES
2944 @item PROMOTE_PROTOTYPES
2945 A C expression whose value is nonzero if an argument declared in
2946 a prototype as an integral type smaller than @code{int} should
2947 actually be passed as an @code{int}.  In addition to avoiding
2948 errors in certain cases of mismatch, it also makes for better
2949 code on certain machines.  If the macro is not defined in target
2950 header files, it defaults to 0.
2951
2952 @findex PUSH_ARGS
2953 @item PUSH_ARGS
2954 A C expression. If nonzero, push insns will be used to pass
2955 outgoing arguments.
2956 If the target machine does not have a push instruction, set it to zero.
2957 That directs GCC to use an alternate strategy: to
2958 allocate the entire argument block and then store the arguments into
2959 it.  When PUSH_ARGS is nonzero, PUSH_ROUNDING must be defined too.
2960 On some machines, the definition
2961
2962 @findex PUSH_ROUNDING
2963 @item PUSH_ROUNDING (@var{npushed})
2964 A C expression that is the number of bytes actually pushed onto the
2965 stack when an instruction attempts to push @var{npushed} bytes.
2966
2967 On some machines, the definition
2968
2969 @example
2970 #define PUSH_ROUNDING(BYTES) (BYTES)
2971 @end example
2972
2973 @noindent
2974 will suffice.  But on other machines, instructions that appear
2975 to push one byte actually push two bytes in an attempt to maintain
2976 alignment.  Then the definition should be
2977
2978 @example
2979 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
2980 @end example
2981
2982 @findex ACCUMULATE_OUTGOING_ARGS
2983 @findex current_function_outgoing_args_size
2984 @item ACCUMULATE_OUTGOING_ARGS
2985 A C expression. If nonzero, the maximum amount of space required for outgoing arguments
2986 will be computed and placed into the variable
2987 @code{current_function_outgoing_args_size}.  No space will be pushed
2988 onto the stack for each call; instead, the function prologue should
2989 increase the stack frame size by this amount.
2990
2991 Setting both @code{PUSH_ARGS} and @code{ACCUMULATE_OUTGOING_ARGS}
2992 is not proper.
2993
2994 @findex REG_PARM_STACK_SPACE
2995 @item REG_PARM_STACK_SPACE (@var{fndecl})
2996 Define this macro if functions should assume that stack space has been
2997 allocated for arguments even when their values are passed in
2998 registers.
2999
3000 The value of this macro is the size, in bytes, of the area reserved for
3001 arguments passed in registers for the function represented by @var{fndecl},
3002 which can be zero if GCC is calling a library function.
3003
3004 This space can be allocated by the caller, or be a part of the
3005 machine-dependent stack frame: @code{OUTGOING_REG_PARM_STACK_SPACE} says
3006 which.
3007 @c above is overfull.  not sure what to do.  --mew 5feb93  did
3008 @c something, not sure if it looks good.  --mew 10feb93
3009
3010 @findex MAYBE_REG_PARM_STACK_SPACE
3011 @findex FINAL_REG_PARM_STACK_SPACE
3012 @item MAYBE_REG_PARM_STACK_SPACE
3013 @itemx FINAL_REG_PARM_STACK_SPACE (@var{const_size}, @var{var_size})
3014 Define these macros in addition to the one above if functions might
3015 allocate stack space for arguments even when their values are passed
3016 in registers.  These should be used when the stack space allocated
3017 for arguments in registers is not a simple constant independent of the
3018 function declaration.
3019
3020 The value of the first macro is the size, in bytes, of the area that
3021 we should initially assume would be reserved for arguments passed in registers.
3022
3023 The value of the second macro is the actual size, in bytes, of the area
3024 that will be reserved for arguments passed in registers.  This takes two
3025 arguments: an integer representing the number of bytes of fixed sized
3026 arguments on the stack, and a tree representing the number of bytes of
3027 variable sized arguments on the stack.
3028
3029 When these macros are defined, @code{REG_PARM_STACK_SPACE} will only be
3030 called for libcall functions, the current function, or for a function
3031 being called when it is known that such stack space must be allocated.
3032 In each case this value can be easily computed.
3033
3034 When deciding whether a called function needs such stack space, and how
3035 much space to reserve, GCC uses these two macros instead of
3036 @code{REG_PARM_STACK_SPACE}.
3037
3038 @findex OUTGOING_REG_PARM_STACK_SPACE
3039 @item OUTGOING_REG_PARM_STACK_SPACE
3040 Define this if it is the responsibility of the caller to allocate the area
3041 reserved for arguments passed in registers.
3042
3043 If @code{ACCUMULATE_OUTGOING_ARGS} is defined, this macro controls
3044 whether the space for these arguments counts in the value of
3045 @code{current_function_outgoing_args_size}.
3046
3047 @findex STACK_PARMS_IN_REG_PARM_AREA
3048 @item STACK_PARMS_IN_REG_PARM_AREA
3049 Define this macro if @code{REG_PARM_STACK_SPACE} is defined, but the
3050 stack parameters don't skip the area specified by it.
3051 @c i changed this, makes more sens and it should have taken care of the
3052 @c overfull.. not as specific, tho.  --mew 5feb93
3053
3054 Normally, when a parameter is not passed in registers, it is placed on the
3055 stack beyond the @code{REG_PARM_STACK_SPACE} area.  Defining this macro
3056 suppresses this behavior and causes the parameter to be passed on the
3057 stack in its natural location.
3058
3059 @findex RETURN_POPS_ARGS
3060 @item RETURN_POPS_ARGS (@var{fundecl}, @var{funtype}, @var{stack-size})
3061 A C expression that should indicate the number of bytes of its own
3062 arguments that a function pops on returning, or 0 if the
3063 function pops no arguments and the caller must therefore pop them all
3064 after the function returns.
3065
3066 @var{fundecl} is a C variable whose value is a tree node that describes
3067 the function in question.  Normally it is a node of type
3068 @code{FUNCTION_DECL} that describes the declaration of the function.
3069 From this you can obtain the DECL_MACHINE_ATTRIBUTES of the function.
3070
3071 @var{funtype} is a C variable whose value is a tree node that
3072 describes the function in question.  Normally it is a node of type
3073 @code{FUNCTION_TYPE} that describes the data type of the function.
3074 From this it is possible to obtain the data types of the value and
3075 arguments (if known).
3076
3077 When a call to a library function is being considered, @var{fundecl}
3078 will contain an identifier node for the library function.  Thus, if
3079 you need to distinguish among various library functions, you can do so
3080 by their names.  Note that ``library function'' in this context means
3081 a function used to perform arithmetic, whose name is known specially
3082 in the compiler and was not mentioned in the C code being compiled.
3083
3084 @var{stack-size} is the number of bytes of arguments passed on the
3085 stack.  If a variable number of bytes is passed, it is zero, and
3086 argument popping will always be the responsibility of the calling function.
3087
3088 On the Vax, all functions always pop their arguments, so the definition
3089 of this macro is @var{stack-size}.  On the 68000, using the standard
3090 calling convention, no functions pop their arguments, so the value of
3091 the macro is always 0 in this case.  But an alternative calling
3092 convention is available in which functions that take a fixed number of
3093 arguments pop them but other functions (such as @code{printf}) pop
3094 nothing (the caller pops all).  When this convention is in use,
3095 @var{funtype} is examined to determine whether a function takes a fixed
3096 number of arguments.
3097 @end table
3098
3099 @node Register Arguments
3100 @subsection Passing Arguments in Registers
3101 @cindex arguments in registers
3102 @cindex registers arguments
3103
3104 This section describes the macros which let you control how various
3105 types of arguments are passed in registers or how they are arranged in
3106 the stack.
3107
3108 @table @code
3109 @findex FUNCTION_ARG
3110 @item FUNCTION_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
3111 A C expression that controls whether a function argument is passed
3112 in a register, and which register.
3113
3114 The arguments are @var{cum}, which summarizes all the previous
3115 arguments; @var{mode}, the machine mode of the argument; @var{type},
3116 the data type of the argument as a tree node or 0 if that is not known
3117 (which happens for C support library functions); and @var{named},
3118 which is 1 for an ordinary argument and 0 for nameless arguments that
3119 correspond to @samp{@dots{}} in the called function's prototype.
3120 @var{type} can be an incomplete type if a syntax error has previously
3121 occurred.
3122
3123 The value of the expression is usually either a @code{reg} RTX for the
3124 hard register in which to pass the argument, or zero to pass the
3125 argument on the stack.
3126
3127 For machines like the Vax and 68000, where normally all arguments are
3128 pushed, zero suffices as a definition.
3129
3130 The value of the expression can also be a @code{parallel} RTX.  This is
3131 used when an argument is passed in multiple locations.  The mode of the
3132 of the @code{parallel} should be the mode of the entire argument.  The
3133 @code{parallel} holds any number of @code{expr_list} pairs; each one
3134 describes where part of the argument is passed.  In each
3135 @code{expr_list} the first operand must be a @code{reg} RTX for the hard
3136 register in which to pass this part of the argument, and the mode of the
3137 register RTX indicates how large this part of the argument is.  The
3138 second operand of the @code{expr_list} is a @code{const_int} which gives
3139 the offset in bytes into the entire argument of where this part starts.
3140 As a special exception the first @code{expr_list} in the @code{parallel}
3141 RTX may have a first operand of zero.  This indicates that the entire
3142 argument is also stored on the stack.
3143
3144 @cindex @file{stdarg.h} and register arguments
3145 The usual way to make the ISO library @file{stdarg.h} work on a machine
3146 where some arguments are usually passed in registers, is to cause
3147 nameless arguments to be passed on the stack instead.  This is done
3148 by making @code{FUNCTION_ARG} return 0 whenever @var{named} is 0.
3149
3150 @cindex @code{MUST_PASS_IN_STACK}, and @code{FUNCTION_ARG}
3151 @cindex @code{REG_PARM_STACK_SPACE}, and @code{FUNCTION_ARG}
3152 You may use the macro @code{MUST_PASS_IN_STACK (@var{mode}, @var{type})}
3153 in the definition of this macro to determine if this argument is of a
3154 type that must be passed in the stack.  If @code{REG_PARM_STACK_SPACE}
3155 is not defined and @code{FUNCTION_ARG} returns non-zero for such an
3156 argument, the compiler will abort.  If @code{REG_PARM_STACK_SPACE} is
3157 defined, the argument will be computed in the stack and then loaded into
3158 a register.
3159
3160 @findex MUST_PASS_IN_STACK
3161 @item MUST_PASS_IN_STACK (@var{mode}, @var{type})
3162 Define as a C expression that evaluates to nonzero if we do not know how
3163 to pass TYPE solely in registers.  The file @file{expr.h} defines a
3164 definition that is usually appropriate, refer to @file{expr.h} for additional
3165 documentation.
3166
3167 @findex FUNCTION_INCOMING_ARG
3168 @item FUNCTION_INCOMING_ARG (@var{cum}, @var{mode}, @var{type}, @var{named})
3169 Define this macro if the target machine has ``register windows'', so
3170 that the register in which a function sees an arguments is not
3171 necessarily the same as the one in which the caller passed the
3172 argument.
3173
3174 For such machines, @code{FUNCTION_ARG} computes the register in which
3175 the caller passes the value, and @code{FUNCTION_INCOMING_ARG} should
3176 be defined in a similar fashion to tell the function being called
3177 where the arguments will arrive.
3178
3179 If @code{FUNCTION_INCOMING_ARG} is not defined, @code{FUNCTION_ARG}
3180 serves both purposes.@refill
3181
3182 @findex FUNCTION_ARG_PARTIAL_NREGS
3183 @item FUNCTION_ARG_PARTIAL_NREGS (@var{cum}, @var{mode}, @var{type}, @var{named})
3184 A C expression for the number of words, at the beginning of an
3185 argument, that must be put in registers.  The value must be zero for
3186 arguments that are passed entirely in registers or that are entirely
3187 pushed on the stack.
3188
3189 On some machines, certain arguments must be passed partially in
3190 registers and partially in memory.  On these machines, typically the
3191 first @var{n} words of arguments are passed in registers, and the rest
3192 on the stack.  If a multi-word argument (a @code{double} or a
3193 structure) crosses that boundary, its first few words must be passed
3194 in registers and the rest must be pushed.  This macro tells the
3195 compiler when this occurs, and how many of the words should go in
3196 registers.
3197
3198 @code{FUNCTION_ARG} for these arguments should return the first
3199 register to be used by the caller for this argument; likewise
3200 @code{FUNCTION_INCOMING_ARG}, for the called function.
3201
3202 @findex FUNCTION_ARG_PASS_BY_REFERENCE
3203 @item FUNCTION_ARG_PASS_BY_REFERENCE (@var{cum}, @var{mode}, @var{type}, @var{named})
3204 A C expression that indicates when an argument must be passed by reference.
3205 If nonzero for an argument, a copy of that argument is made in memory and a
3206 pointer to the argument is passed instead of the argument itself.
3207 The pointer is passed in whatever way is appropriate for passing a pointer
3208 to that type.
3209
3210 On machines where @code{REG_PARM_STACK_SPACE} is not defined, a suitable
3211 definition of this macro might be
3212 @smallexample
3213 #define FUNCTION_ARG_PASS_BY_REFERENCE\
3214 (CUM, MODE, TYPE, NAMED)  \
3215   MUST_PASS_IN_STACK (MODE, TYPE)
3216 @end smallexample
3217 @c this is *still* too long.  --mew 5feb93
3218
3219 @findex FUNCTION_ARG_CALLEE_COPIES
3220 @item FUNCTION_ARG_CALLEE_COPIES (@var{cum}, @var{mode}, @var{type}, @var{named})
3221 If defined, a C expression that indicates when it is the called function's
3222 responsibility to make a copy of arguments passed by invisible reference.
3223 Normally, the caller makes a copy and passes the address of the copy to the
3224 routine being called.  When FUNCTION_ARG_CALLEE_COPIES is defined and is
3225 nonzero, the caller does not make a copy.  Instead, it passes a pointer to the
3226 ``live'' value.  The called function must not modify this value.  If it can be
3227 determined that the value won't be modified, it need not make a copy;
3228 otherwise a copy must be made.
3229
3230 @findex CUMULATIVE_ARGS
3231 @item CUMULATIVE_ARGS
3232 A C type for declaring a variable that is used as the first argument of
3233 @code{FUNCTION_ARG} and other related values.  For some target machines,
3234 the type @code{int} suffices and can hold the number of bytes of
3235 argument so far.
3236
3237 There is no need to record in @code{CUMULATIVE_ARGS} anything about the
3238 arguments that have been passed on the stack.  The compiler has other
3239 variables to keep track of that.  For target machines on which all
3240 arguments are passed on the stack, there is no need to store anything in
3241 @code{CUMULATIVE_ARGS}; however, the data structure must exist and
3242 should not be empty, so use @code{int}.
3243
3244 @findex INIT_CUMULATIVE_ARGS
3245 @item INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{indirect})
3246 A C statement (sans semicolon) for initializing the variable @var{cum}
3247 for the state at the beginning of the argument list.  The variable has
3248 type @code{CUMULATIVE_ARGS}.  The value of @var{fntype} is the tree node
3249 for the data type of the function which will receive the args, or 0
3250 if the args are to a compiler support library function.  The value of
3251 @var{indirect} is nonzero when processing an indirect call, for example
3252 a call through a function pointer.  The value of @var{indirect} is zero
3253 for a call to an explicitly named function, a library function call, or when
3254 @code{INIT_CUMULATIVE_ARGS} is used to find arguments for the function
3255 being compiled.
3256
3257 When processing a call to a compiler support library function,
3258 @var{libname} identifies which one.  It is a @code{symbol_ref} rtx which
3259 contains the name of the function, as a string.  @var{libname} is 0 when
3260 an ordinary C function call is being processed.  Thus, each time this
3261 macro is called, either @var{libname} or @var{fntype} is nonzero, but
3262 never both of them at once.
3263
3264 @findex INIT_CUMULATIVE_LIBCALL_ARGS
3265 @item INIT_CUMULATIVE_LIBCALL_ARGS (@var{cum}, @var{mode}, @var{libname})
3266 Like @code{INIT_CUMULATIVE_ARGS} but only used for outgoing libcalls,
3267 it gets a @code{MODE} argument instead of @var{fntype}, that would be
3268 @code{NULL}.  @var{indirect} would always be zero, too.  If this macro
3269 is not defined, @code{INIT_CUMULATIVE_ARGS (cum, NULL_RTX, libname,
3270 0)} is used instead.
3271
3272 @findex INIT_CUMULATIVE_INCOMING_ARGS
3273 @item INIT_CUMULATIVE_INCOMING_ARGS (@var{cum}, @var{fntype}, @var{libname})
3274 Like @code{INIT_CUMULATIVE_ARGS} but overrides it for the purposes of
3275 finding the arguments for the function being compiled.  If this macro is
3276 undefined, @code{INIT_CUMULATIVE_ARGS} is used instead.
3277
3278 The value passed for @var{libname} is always 0, since library routines
3279 with special calling conventions are never compiled with GCC.  The
3280 argument @var{libname} exists for symmetry with
3281 @code{INIT_CUMULATIVE_ARGS}.
3282 @c could use "this macro" in place of @code{INIT_CUMULATIVE_ARGS}, maybe.
3283 @c --mew 5feb93   i switched the order of the sentences.  --mew 10feb93
3284
3285 @findex FUNCTION_ARG_ADVANCE
3286 @item FUNCTION_ARG_ADVANCE (@var{cum}, @var{mode}, @var{type}, @var{named})
3287 A C statement (sans semicolon) to update the summarizer variable
3288 @var{cum} to advance past an argument in the argument list.  The
3289 values @var{mode}, @var{type} and @var{named} describe that argument.
3290 Once this is done, the variable @var{cum} is suitable for analyzing
3291 the @emph{following} argument with @code{FUNCTION_ARG}, etc.@refill
3292
3293 This macro need not do anything if the argument in question was passed
3294 on the stack.  The compiler knows how to track the amount of stack space
3295 used for arguments without any special help.
3296
3297 @findex FUNCTION_ARG_PADDING
3298 @item FUNCTION_ARG_PADDING (@var{mode}, @var{type})
3299 If defined, a C expression which determines whether, and in which direction,
3300 to pad out an argument with extra space.  The value should be of type
3301 @code{enum direction}: either @code{upward} to pad above the argument,
3302 @code{downward} to pad below, or @code{none} to inhibit padding.
3303
3304 The @emph{amount} of padding is always just enough to reach the next
3305 multiple of @code{FUNCTION_ARG_BOUNDARY}; this macro does not control
3306 it.
3307
3308 This macro has a default definition which is right for most systems.
3309 For little-endian machines, the default is to pad upward.  For
3310 big-endian machines, the default is to pad downward for an argument of
3311 constant size shorter than an @code{int}, and upward otherwise.
3312
3313 @findex PAD_VARARGS_DOWN
3314 @item PAD_VARARGS_DOWN
3315 If defined, a C expression which determines whether the default
3316 implementation of va_arg will attempt to pad down before reading the
3317 next argument, if that argument is smaller than its aligned space as
3318 controlled by @code{PARM_BOUNDARY}.  If this macro is not defined, all such
3319 arguments are padded down if @code{BYTES_BIG_ENDIAN} is true.
3320
3321 @findex FUNCTION_ARG_BOUNDARY
3322 @item FUNCTION_ARG_BOUNDARY (@var{mode}, @var{type})
3323 If defined, a C expression that gives the alignment boundary, in bits,
3324 of an argument with the specified mode and type.  If it is not defined,
3325 @code{PARM_BOUNDARY} is used for all arguments.
3326
3327 @findex FUNCTION_ARG_REGNO_P
3328 @item FUNCTION_ARG_REGNO_P (@var{regno})
3329 A C expression that is nonzero if @var{regno} is the number of a hard
3330 register in which function arguments are sometimes passed.  This does
3331 @emph{not} include implicit arguments such as the static chain and
3332 the structure-value address.  On many machines, no registers can be
3333 used for this purpose since all function arguments are pushed on the
3334 stack.
3335
3336 @findex LOAD_ARGS_REVERSED
3337 @item LOAD_ARGS_REVERSED
3338 If defined, the order in which arguments are loaded into their
3339 respective argument registers is reversed so that the last
3340 argument is loaded first.  This macro only affects arguments
3341 passed in registers.
3342
3343 @end table
3344
3345 @node Scalar Return
3346 @subsection How Scalar Function Values Are Returned
3347 @cindex return values in registers
3348 @cindex values, returned by functions
3349 @cindex scalars, returned as values
3350
3351 This section discusses the macros that control returning scalars as
3352 values---values that can fit in registers.
3353
3354 @table @code
3355 @findex TRADITIONAL_RETURN_FLOAT
3356 @item TRADITIONAL_RETURN_FLOAT
3357 Define this macro if @option{-traditional} should not cause functions
3358 declared to return @code{float} to convert the value to @code{double}.
3359
3360 @findex FUNCTION_VALUE
3361 @item FUNCTION_VALUE (@var{valtype}, @var{func})
3362 A C expression to create an RTX representing the place where a
3363 function returns a value of data type @var{valtype}.  @var{valtype} is
3364 a tree node representing a data type.  Write @code{TYPE_MODE
3365 (@var{valtype})} to get the machine mode used to represent that type.
3366 On many machines, only the mode is relevant.  (Actually, on most
3367 machines, scalar values are returned in the same place regardless of
3368 mode).@refill
3369
3370 The value of the expression is usually a @code{reg} RTX for the hard
3371 register where the return value is stored.  The value can also be a
3372 @code{parallel} RTX, if the return value is in multiple places.  See
3373 @code{FUNCTION_ARG} for an explanation of the @code{parallel} form.
3374
3375 If @code{PROMOTE_FUNCTION_RETURN} is defined, you must apply the same
3376 promotion rules specified in @code{PROMOTE_MODE} if @var{valtype} is a
3377 scalar type.
3378
3379 If the precise function being called is known, @var{func} is a tree
3380 node (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null
3381 pointer.  This makes it possible to use a different value-returning
3382 convention for specific functions when all their calls are
3383 known.@refill
3384
3385 @code{FUNCTION_VALUE} is not used for return vales with aggregate data
3386 types, because these are returned in another way.  See
3387 @code{STRUCT_VALUE_REGNUM} and related macros, below.
3388
3389 @findex FUNCTION_OUTGOING_VALUE
3390 @item FUNCTION_OUTGOING_VALUE (@var{valtype}, @var{func})
3391 Define this macro if the target machine has ``register windows''
3392 so that the register in which a function returns its value is not
3393 the same as the one in which the caller sees the value.
3394
3395 For such machines, @code{FUNCTION_VALUE} computes the register in which
3396 the caller will see the value.  @code{FUNCTION_OUTGOING_VALUE} should be
3397 defined in a similar fashion to tell the function where to put the
3398 value.@refill
3399
3400 If @code{FUNCTION_OUTGOING_VALUE} is not defined,
3401 @code{FUNCTION_VALUE} serves both purposes.@refill
3402
3403 @code{FUNCTION_OUTGOING_VALUE} is not used for return vales with
3404 aggregate data types, because these are returned in another way.  See
3405 @code{STRUCT_VALUE_REGNUM} and related macros, below.
3406
3407 @findex LIBCALL_VALUE
3408 @item LIBCALL_VALUE (@var{mode})
3409 A C expression to create an RTX representing the place where a library
3410 function returns a value of mode @var{mode}.  If the precise function
3411 being called is known, @var{func} is a tree node
3412 (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null
3413 pointer.  This makes it possible to use a different value-returning
3414 convention for specific functions when all their calls are
3415 known.@refill
3416
3417 Note that ``library function'' in this context means a compiler
3418 support routine, used to perform arithmetic, whose name is known
3419 specially by the compiler and was not mentioned in the C code being
3420 compiled.
3421
3422 The definition of @code{LIBRARY_VALUE} need not be concerned aggregate
3423 data types, because none of the library functions returns such types.
3424
3425 @findex FUNCTION_VALUE_REGNO_P
3426 @item FUNCTION_VALUE_REGNO_P (@var{regno})
3427 A C expression that is nonzero if @var{regno} is the number of a hard
3428 register in which the values of called function may come back.
3429
3430 A register whose use for returning values is limited to serving as the
3431 second of a pair (for a value of type @code{double}, say) need not be
3432 recognized by this macro.  So for most machines, this definition
3433 suffices:
3434
3435 @example
3436 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
3437 @end example
3438
3439 If the machine has register windows, so that the caller and the called
3440 function use different registers for the return value, this macro
3441 should recognize only the caller's register numbers.
3442
3443 @findex APPLY_RESULT_SIZE
3444 @item APPLY_RESULT_SIZE
3445 Define this macro if @samp{untyped_call} and @samp{untyped_return}
3446 need more space than is implied by @code{FUNCTION_VALUE_REGNO_P} for
3447 saving and restoring an arbitrary return value.
3448 @end table
3449
3450 @node Aggregate Return
3451 @subsection How Large Values Are Returned
3452 @cindex aggregates as return values
3453 @cindex large return values
3454 @cindex returning aggregate values
3455 @cindex structure value address
3456
3457 When a function value's mode is @code{BLKmode} (and in some other
3458 cases), the value is not returned according to @code{FUNCTION_VALUE}
3459 (@pxref{Scalar Return}).  Instead, the caller passes the address of a
3460 block of memory in which the value should be stored.  This address
3461 is called the @dfn{structure value address}.
3462
3463 This section describes how to control returning structure values in
3464 memory.
3465
3466 @table @code
3467 @findex RETURN_IN_MEMORY
3468 @item RETURN_IN_MEMORY (@var{type})
3469 A C expression which can inhibit the returning of certain function
3470 values in registers, based on the type of value.  A nonzero value says
3471 to return the function value in memory, just as large structures are
3472 always returned.  Here @var{type} will be a C expression of type
3473 @code{tree}, representing the data type of the value.
3474
3475 Note that values of mode @code{BLKmode} must be explicitly handled
3476 by this macro.  Also, the option @option{-fpcc-struct-return}
3477 takes effect regardless of this macro.  On most systems, it is
3478 possible to leave the macro undefined; this causes a default
3479 definition to be used, whose value is the constant 1 for @code{BLKmode}
3480 values, and 0 otherwise.
3481
3482 Do not use this macro to indicate that structures and unions should always
3483 be returned in memory.  You should instead use @code{DEFAULT_PCC_STRUCT_RETURN}
3484 to indicate this.
3485
3486 @findex DEFAULT_PCC_STRUCT_RETURN
3487 @item DEFAULT_PCC_STRUCT_RETURN
3488 Define this macro to be 1 if all structure and union return values must be
3489 in memory.  Since this results in slower code, this should be defined
3490 only if needed for compatibility with other compilers or with an ABI.
3491 If you define this macro to be 0, then the conventions used for structure
3492 and union return values are decided by the @code{RETURN_IN_MEMORY} macro.
3493
3494 If not defined, this defaults to the value 1.
3495
3496 @findex STRUCT_VALUE_REGNUM
3497 @item STRUCT_VALUE_REGNUM
3498 If the structure value address is passed in a register, then
3499 @code{STRUCT_VALUE_REGNUM} should be the number of that register.
3500
3501 @findex STRUCT_VALUE
3502 @item STRUCT_VALUE
3503 If the structure value address is not passed in a register, define
3504 @code{STRUCT_VALUE} as an expression returning an RTX for the place
3505 where the address is passed.  If it returns 0, the address is passed as
3506 an ``invisible'' first argument.
3507
3508 @findex STRUCT_VALUE_INCOMING_REGNUM
3509 @item STRUCT_VALUE_INCOMING_REGNUM
3510 On some architectures the place where the structure value address
3511 is found by the called function is not the same place that the
3512 caller put it.  This can be due to register windows, or it could
3513 be because the function prologue moves it to a different place.
3514
3515 If the incoming location of the structure value address is in a
3516 register, define this macro as the register number.
3517
3518 @findex STRUCT_VALUE_INCOMING
3519 @item STRUCT_VALUE_INCOMING
3520 If the incoming location is not a register, then you should define
3521 @code{STRUCT_VALUE_INCOMING} as an expression for an RTX for where the
3522 called function should find the value.  If it should find the value on
3523 the stack, define this to create a @code{mem} which refers to the frame
3524 pointer.  A definition of 0 means that the address is passed as an
3525 ``invisible'' first argument.
3526
3527 @findex PCC_STATIC_STRUCT_RETURN
3528 @item PCC_STATIC_STRUCT_RETURN
3529 Define this macro if the usual system convention on the target machine
3530 for returning structures and unions is for the called function to return
3531 the address of a static variable containing the value.
3532
3533 Do not define this if the usual system convention is for the caller to
3534 pass an address to the subroutine.
3535
3536 This macro has effect in @option{-fpcc-struct-return} mode, but it does
3537 nothing when you use @option{-freg-struct-return} mode.
3538 @end table
3539
3540 @node Caller Saves
3541 @subsection Caller-Saves Register Allocation
3542
3543 If you enable it, GCC can save registers around function calls.  This
3544 makes it possible to use call-clobbered registers to hold variables that
3545 must live across calls.
3546
3547 @table @code
3548 @findex DEFAULT_CALLER_SAVES
3549 @item DEFAULT_CALLER_SAVES
3550 Define this macro if function calls on the target machine do not preserve
3551 any registers; in other words, if @code{CALL_USED_REGISTERS} has 1
3552 for all registers.  When defined, this macro enables @option{-fcaller-saves}
3553 by default for all optimization levels.  It has no effect for optimization
3554 levels 2 and higher, where @option{-fcaller-saves} is the default.
3555
3556 @findex CALLER_SAVE_PROFITABLE
3557 @item CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
3558 A C expression to determine whether it is worthwhile to consider placing
3559 a pseudo-register in a call-clobbered hard register and saving and
3560 restoring it around each function call.  The expression should be 1 when
3561 this is worth doing, and 0 otherwise.
3562
3563 If you don't define this macro, a default is used which is good on most
3564 machines: @code{4 * @var{calls} < @var{refs}}.
3565
3566 @findex HARD_REGNO_CALLER_SAVE_MODE
3567 @item HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
3568 A C expression specifying which mode is required for saving @var{nregs}
3569 of a pseudo-register in call-clobbered hard register @var{regno}.  If
3570 @var{regno} is unsuitable for caller save, @code{VOIDmode} should be
3571 returned.  For most machines this macro need not be defined since GCC
3572 will select the smallest suitable mode.
3573 @end table
3574
3575 @node Function Entry
3576 @subsection Function Entry and Exit
3577 @cindex function entry and exit
3578 @cindex prologue
3579 @cindex epilogue
3580
3581 This section describes the macros that output function entry
3582 (@dfn{prologue}) and exit (@dfn{epilogue}) code.
3583
3584 @table @code
3585 @findex FUNCTION_PROLOGUE
3586 @item FUNCTION_PROLOGUE (@var{file}, @var{size})
3587 A C compound statement that outputs the assembler code for entry to a
3588 function.  The prologue is responsible for setting up the stack frame,
3589 initializing the frame pointer register, saving registers that must be
3590 saved, and allocating @var{size} additional bytes of storage for the
3591 local variables.  @var{size} is an integer.  @var{file} is a stdio
3592 stream to which the assembler code should be output.
3593
3594 The label for the beginning of the function need not be output by this
3595 macro.  That has already been done when the macro is run.
3596
3597 @findex regs_ever_live
3598 To determine which registers to save, the macro can refer to the array
3599 @code{regs_ever_live}: element @var{r} is nonzero if hard register
3600 @var{r} is used anywhere within the function.  This implies the function
3601 prologue should save register @var{r}, provided it is not one of the
3602 call-used registers.  (@code{FUNCTION_EPILOGUE} must likewise use
3603 @code{regs_ever_live}.)
3604
3605 On machines that have ``register windows'', the function entry code does
3606 not save on the stack the registers that are in the windows, even if
3607 they are supposed to be preserved by function calls; instead it takes
3608 appropriate steps to ``push'' the register stack, if any non-call-used
3609 registers are used in the function.
3610
3611 @findex frame_pointer_needed
3612 On machines where functions may or may not have frame-pointers, the
3613 function entry code must vary accordingly; it must set up the frame
3614 pointer if one is wanted, and not otherwise.  To determine whether a
3615 frame pointer is in wanted, the macro can refer to the variable
3616 @code{frame_pointer_needed}.  The variable's value will be 1 at run
3617 time in a function that needs a frame pointer.  @xref{Elimination}.
3618
3619 The function entry code is responsible for allocating any stack space
3620 required for the function.  This stack space consists of the regions
3621 listed below.  In most cases, these regions are allocated in the
3622 order listed, with the last listed region closest to the top of the
3623 stack (the lowest address if @code{STACK_GROWS_DOWNWARD} is defined, and
3624 the highest address if it is not defined).  You can use a different order
3625 for a machine if doing so is more convenient or required for
3626 compatibility reasons.  Except in cases where required by standard
3627 or by a debugger, there is no reason why the stack layout used by GCC
3628 need agree with that used by other compilers for a machine.
3629
3630 @itemize @bullet
3631 @item
3632 @findex current_function_pretend_args_size
3633 A region of @code{current_function_pretend_args_size} bytes of
3634 uninitialized space just underneath the first argument arriving on the
3635 stack.  (This may not be at the very start of the allocated stack region
3636 if the calling sequence has pushed anything else since pushing the stack
3637 arguments.  But usually, on such machines, nothing else has been pushed
3638 yet, because the function prologue itself does all the pushing.)  This
3639 region is used on machines where an argument may be passed partly in
3640 registers and partly in memory, and, in some cases to support the
3641 features in @file{varargs.h} and @file{stdarg.h}.
3642
3643 @item
3644 An area of memory used to save certain registers used by the function.
3645 The size of this area, which may also include space for such things as
3646 the return address and pointers to previous stack frames, is
3647 machine-specific and usually depends on which registers have been used
3648 in the function.  Machines with register windows often do not require
3649 a save area.
3650
3651 @item
3652 A region of at least @var{size} bytes, possibly rounded up to an allocation
3653 boundary, to contain the local variables of the function.  On some machines,
3654 this region and the save area may occur in the opposite order, with the
3655 save area closer to the top of the stack.
3656
3657 @item
3658 @cindex @code{ACCUMULATE_OUTGOING_ARGS} and stack frames
3659 Optionally, when @code{ACCUMULATE_OUTGOING_ARGS} is defined, a region of
3660 @code{current_function_outgoing_args_size} bytes to be used for outgoing
3661 argument lists of the function.  @xref{Stack Arguments}.
3662 @end itemize
3663
3664 Normally, it is necessary for the macros @code{FUNCTION_PROLOGUE} and
3665 @code{FUNCTION_EPILOGUE} to treat leaf functions specially.  The C
3666 variable @code{current_function_is_leaf} is nonzero for such a function.
3667
3668 @findex EXIT_IGNORE_STACK
3669 @item EXIT_IGNORE_STACK
3670 Define this macro as a C expression that is nonzero if the return
3671 instruction or the function epilogue ignores the value of the stack
3672 pointer; in other words, if it is safe to delete an instruction to
3673 adjust the stack pointer before a return from the function.
3674
3675 Note that this macro's value is relevant only for functions for which
3676 frame pointers are maintained.  It is never safe to delete a final
3677 stack adjustment in a function that has no frame pointer, and the
3678 compiler knows this regardless of @code{EXIT_IGNORE_STACK}.
3679
3680 @findex EPILOGUE_USES
3681 @item EPILOGUE_USES (@var{regno})
3682 Define this macro as a C expression that is nonzero for registers that are
3683 used by the epilogue or the @samp{return} pattern.  The stack and frame
3684 pointer registers are already be assumed to be used as needed.
3685
3686 @findex FUNCTION_EPILOGUE
3687 @item FUNCTION_EPILOGUE (@var{file}, @var{size})
3688 A C compound statement that outputs the assembler code for exit from a
3689 function.  The epilogue is responsible for restoring the saved
3690 registers and stack pointer to their values when the function was
3691 called, and returning control to the caller.  This macro takes the
3692 same arguments as the macro @code{FUNCTION_PROLOGUE}, and the
3693 registers to restore are determined from @code{regs_ever_live} and
3694 @code{CALL_USED_REGISTERS} in the same way.
3695
3696 On some machines, there is a single instruction that does all the work
3697 of returning from the function.  On these machines, give that
3698 instruction the name @samp{return} and do not define the macro
3699 @code{FUNCTION_EPILOGUE} at all.
3700
3701 Do not define a pattern named @samp{return} if you want the
3702 @code{FUNCTION_EPILOGUE} to be used.  If you want the target switches
3703 to control whether return instructions or epilogues are used, define a
3704 @samp{return} pattern with a validity condition that tests the target
3705 switches appropriately.  If the @samp{return} pattern's validity
3706 condition is false, epilogues will be used.
3707
3708 On machines where functions may or may not have frame-pointers, the
3709 function exit code must vary accordingly.  Sometimes the code for these
3710 two cases is completely different.  To determine whether a frame pointer
3711 is wanted, the macro can refer to the variable
3712 @code{frame_pointer_needed}.  The variable's value will be 1 when compiling
3713 a function that needs a frame pointer.
3714
3715 Normally, @code{FUNCTION_PROLOGUE} and @code{FUNCTION_EPILOGUE} must
3716 treat leaf functions specially.  The C variable @code{current_function_is_leaf}
3717 is nonzero for such a function.  @xref{Leaf Functions}.
3718
3719 On some machines, some functions pop their arguments on exit while
3720 others leave that for the caller to do.  For example, the 68020 when
3721 given @option{-mrtd} pops arguments in functions that take a fixed
3722 number of arguments.
3723
3724 @findex current_function_pops_args
3725 Your definition of the macro @code{RETURN_POPS_ARGS} decides which
3726 functions pop their own arguments.  @code{FUNCTION_EPILOGUE} needs to
3727 know what was decided.  The variable that is called
3728 @code{current_function_pops_args} is the number of bytes of its
3729 arguments that a function should pop.  @xref{Scalar Return}.
3730 @c what is the "its arguments" in the above sentence referring to, pray
3731 @c tell?  --mew 5feb93
3732
3733 @findex DELAY_SLOTS_FOR_EPILOGUE
3734 @item DELAY_SLOTS_FOR_EPILOGUE
3735 Define this macro if the function epilogue contains delay slots to which
3736 instructions from the rest of the function can be ``moved''.  The
3737 definition should be a C expression whose value is an integer
3738 representing the number of delay slots there.
3739
3740 @findex ELIGIBLE_FOR_EPILOGUE_DELAY
3741 @item ELIGIBLE_FOR_EPILOGUE_DELAY (@var{insn}, @var{n})
3742 A C expression that returns 1 if @var{insn} can be placed in delay
3743 slot number @var{n} of the epilogue.
3744
3745 The argument @var{n} is an integer which identifies the delay slot now
3746 being considered (since different slots may have different rules of
3747 eligibility).  It is never negative and is always less than the number
3748 of epilogue delay slots (what @code{DELAY_SLOTS_FOR_EPILOGUE} returns).
3749 If you reject a particular insn for a given delay slot, in principle, it
3750 may be reconsidered for a subsequent delay slot.  Also, other insns may
3751 (at least in principle) be considered for the so far unfilled delay
3752 slot.
3753
3754 @findex current_function_epilogue_delay_list
3755 @findex final_scan_insn
3756 The insns accepted to fill the epilogue delay slots are put in an RTL
3757 list made with @code{insn_list} objects, stored in the variable
3758 @code{current_function_epilogue_delay_list}.  The insn for the first
3759 delay slot comes first in the list.  Your definition of the macro
3760 @code{FUNCTION_EPILOGUE} should fill the delay slots by outputting the
3761 insns in this list, usually by calling @code{final_scan_insn}.
3762
3763 You need not define this macro if you did not define
3764 @code{DELAY_SLOTS_FOR_EPILOGUE}.
3765
3766 @findex ASM_OUTPUT_MI_THUNK
3767 @item ASM_OUTPUT_MI_THUNK (@var{file}, @var{thunk_fndecl}, @var{delta}, @var{function})
3768 A C compound statement that outputs the assembler code for a thunk
3769 function, used to implement C++ virtual function calls with multiple
3770 inheritance.  The thunk acts as a wrapper around a virtual function,
3771 adjusting the implicit object parameter before handing control off to
3772 the real function.
3773
3774 First, emit code to add the integer @var{delta} to the location that
3775 contains the incoming first argument.  Assume that this argument
3776 contains a pointer, and is the one used to pass the @code{this} pointer
3777 in C++.  This is the incoming argument @emph{before} the function prologue,
3778 e.g. @samp{%o0} on a sparc.  The addition must preserve the values of
3779 all other incoming arguments.
3780
3781 After the addition, emit code to jump to @var{function}, which is a
3782 @code{FUNCTION_DECL}.  This is a direct pure jump, not a call, and does
3783 not touch the return address.  Hence returning from @var{FUNCTION} will
3784 return to whoever called the current @samp{thunk}.
3785
3786 The effect must be as if @var{function} had been called directly with
3787 the adjusted first argument.  This macro is responsible for emitting all
3788 of the code for a thunk function; @code{FUNCTION_PROLOGUE} and
3789 @code{FUNCTION_EPILOGUE} are not invoked.
3790
3791 The @var{thunk_fndecl} is redundant.  (@var{delta} and @var{function}
3792 have already been extracted from it.)  It might possibly be useful on
3793 some targets, but probably not.
3794
3795 If you do not define this macro, the target-independent code in the C++
3796 front end will generate a less efficient heavyweight thunk that calls
3797 @var{function} instead of jumping to it.  The generic approach does
3798 not support varargs.
3799 @end table
3800
3801 @node Profiling
3802 @subsection Generating Code for Profiling
3803 @cindex profiling, code generation
3804
3805 These macros will help you generate code for profiling.
3806
3807 @table @code
3808 @findex FUNCTION_PROFILER
3809 @item FUNCTION_PROFILER (@var{file}, @var{labelno})
3810 A C statement or compound statement to output to @var{file} some
3811 assembler code to call the profiling subroutine @code{mcount}.
3812
3813 @findex mcount
3814 The details of how @code{mcount} expects to be called are determined by
3815 your operating system environment, not by GCC.  To figure them out,
3816 compile a small program for profiling using the system's installed C
3817 compiler and look at the assembler code that results.
3818
3819 Older implementations of @code{mcount} expect the address of a counter
3820 variable to be loaded into some register.  The name of this variable is
3821 @samp{LP} followed by the number @var{labelno}, so you would generate
3822 the name using @samp{LP%d} in a @code{fprintf}.
3823
3824 @findex PROFILE_HOOK
3825 @item PROFILE_HOOK
3826 A C statement or compound statement to output to @var{file} some assembly
3827 code to call the profiling subroutine @code{mcount} even the target does
3828 not support profiling.
3829
3830 @findex NO_PROFILE_COUNTERS
3831 @item NO_PROFILE_COUNTERS
3832 Define this macro if the @code{mcount} subroutine on your system does
3833 not need a counter variable allocated for each function.  This is true
3834 for almost all modern implementations.  If you define this macro, you
3835 must not use the @var{labelno} argument to @code{FUNCTION_PROFILER}.
3836
3837 @findex PROFILE_BEFORE_PROLOGUE
3838 @item PROFILE_BEFORE_PROLOGUE
3839 Define this macro if the code for function profiling should come before
3840 the function prologue.  Normally, the profiling code comes after.
3841
3842 @findex FUNCTION_BLOCK_PROFILER
3843 @vindex profile_block_flag
3844 @item FUNCTION_BLOCK_PROFILER (@var{file}, @var{labelno})
3845 A C statement or compound statement to output to @var{file} some
3846 assembler code to initialize basic-block profiling for the current
3847 object module.  The global compile flag @code{profile_block_flag}
3848 distinguishes two profile modes.
3849
3850 @table @code
3851 @findex __bb_init_func
3852 @item profile_block_flag != 2
3853 Output code to call the subroutine @code{__bb_init_func} once per
3854 object module, passing it as its sole argument the address of a block
3855 allocated in the object module.
3856
3857 The name of the block is a local symbol made with this statement:
3858
3859 @smallexample
3860 ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 0);
3861 @end smallexample
3862
3863 Of course, since you are writing the definition of
3864 @code{ASM_GENERATE_INTERNAL_LABEL} as well as that of this macro, you
3865 can take a short cut in the definition of this macro and use the name
3866 that you know will result.
3867
3868 The first word of this block is a flag which will be nonzero if the
3869 object module has already been initialized.  So test this word first,
3870 and do not call @code{__bb_init_func} if the flag is
3871 nonzero.  BLOCK_OR_LABEL contains a unique number which may be used to
3872 generate a label as a branch destination when @code{__bb_init_func}
3873 will not be called.
3874
3875 Described in assembler language, the code to be output looks like:
3876
3877 @example
3878   cmp (LPBX0),0
3879   bne local_label
3880   parameter1 <- LPBX0
3881   call __bb_init_func
3882 local_label:
3883 @end example
3884
3885 @findex __bb_init_trace_func
3886 @item profile_block_flag == 2
3887 Output code to call the subroutine @code{__bb_init_trace_func}
3888 and pass two parameters to it.  The first parameter is the same as
3889 for @code{__bb_init_func}.  The second parameter is the number of the
3890 first basic block of the function as given by BLOCK_OR_LABEL.  Note
3891 that @code{__bb_init_trace_func} has to be called, even if the object
3892 module has been initialized already.
3893
3894 Described in assembler language, the code to be output looks like:
3895 @example
3896 parameter1 <- LPBX0
3897 parameter2 <- BLOCK_OR_LABEL
3898 call __bb_init_trace_func
3899 @end example
3900 @end table
3901
3902 @findex BLOCK_PROFILER
3903 @vindex profile_block_flag
3904 @item BLOCK_PROFILER (@var{file}, @var{blockno})
3905 A C statement or compound statement to output to @var{file} some
3906 assembler code to increment the count associated with the basic
3907 block number @var{blockno}.  The global compile flag
3908 @code{profile_block_flag} distinguishes two profile modes.
3909
3910 @table @code
3911 @item profile_block_flag != 2
3912 Output code to increment the counter directly.  Basic blocks are
3913 numbered separately from zero within each compilation.  The count
3914 associated with block number @var{blockno} is at index
3915 @var{blockno} in a vector of words; the name of this array is a local
3916 symbol made with this statement:
3917
3918 @smallexample
3919 ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 2);
3920 @end smallexample
3921
3922 @c This paragraph is the same as one a few paragraphs up.
3923 @c That is not an error.
3924 Of course, since you are writing the definition of
3925 @code{ASM_GENERATE_INTERNAL_LABEL} as well as that of this macro, you
3926 can take a short cut in the definition of this macro and use the name
3927 that you know will result.
3928
3929 Described in assembler language, the code to be output looks like:
3930
3931 @smallexample
3932 inc (LPBX2+4*BLOCKNO)
3933 @end smallexample
3934
3935 @vindex __bb
3936 @findex __bb_trace_func
3937 @item profile_block_flag == 2
3938 Output code to initialize the global structure @code{__bb} and
3939 call the function @code{__bb_trace_func}, which will increment the
3940 counter.
3941
3942 @code{__bb} consists of two words.  In the first word, the current
3943 basic block number, as given by BLOCKNO, has to be stored.  In
3944 the second word, the address of a block allocated in the object
3945 module has to be stored.  The address is given by the label created
3946 with this statement:
3947
3948 @smallexample
3949 ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 0);
3950 @end smallexample
3951
3952 Described in assembler language, the code to be output looks like:
3953 @example
3954 move BLOCKNO -> (__bb)
3955 move LPBX0 -> (__bb+4)
3956 call __bb_trace_func
3957 @end example
3958 @end table
3959
3960 @findex FUNCTION_BLOCK_PROFILER_EXIT
3961 @findex __bb_trace_ret
3962 @vindex profile_block_flag
3963 @item FUNCTION_BLOCK_PROFILER_EXIT (@var{file})
3964 A C statement or compound statement to output to @var{file}
3965 assembler code to call function @code{__bb_trace_ret}.  The
3966 assembler code should only be output
3967 if the global compile flag @code{profile_block_flag} == 2.  This
3968 macro has to be used at every place where code for returning from
3969 a function is generated (e.g. @code{FUNCTION_EPILOGUE}).  Although
3970 you have to write the definition of @code{FUNCTION_EPILOGUE}
3971 as well, you have to define this macro to tell the compiler, that
3972 the proper call to @code{__bb_trace_ret} is produced.
3973
3974 @findex MACHINE_STATE_SAVE
3975 @findex __bb_init_trace_func
3976 @findex __bb_trace_func
3977 @findex __bb_trace_ret
3978 @item MACHINE_STATE_SAVE (@var{id})
3979 A C statement or compound statement to save all registers, which may
3980 be clobbered by a function call, including condition codes.  The
3981 @code{asm} statement will be mostly likely needed to handle this
3982 task.  Local labels in the assembler code can be concatenated with the
3983 string @var{id}, to obtain a unique label name.
3984
3985 Registers or condition codes clobbered by @code{FUNCTION_PROLOGUE} or
3986 @code{FUNCTION_EPILOGUE} must be saved in the macros
3987 @code{FUNCTION_BLOCK_PROFILER}, @code{FUNCTION_BLOCK_PROFILER_EXIT} and
3988 @code{BLOCK_PROFILER} prior calling @code{__bb_init_trace_func},
3989 @code{__bb_trace_ret} and @code{__bb_trace_func} respectively.
3990
3991 @findex MACHINE_STATE_RESTORE
3992 @findex __bb_init_trace_func
3993 @findex __bb_trace_func
3994 @findex __bb_trace_ret
3995 @item MACHINE_STATE_RESTORE (@var{id})
3996 A C statement or compound statement to restore all registers, including
3997 condition codes, saved by @code{MACHINE_STATE_SAVE}.
3998
3999 Registers or condition codes clobbered by @code{FUNCTION_PROLOGUE} or
4000 @code{FUNCTION_EPILOGUE} must be restored in the macros
4001 @code{FUNCTION_BLOCK_PROFILER}, @code{FUNCTION_BLOCK_PROFILER_EXIT} and
4002 @code{BLOCK_PROFILER} after calling @code{__bb_init_trace_func},
4003 @code{__bb_trace_ret} and @code{__bb_trace_func} respectively.
4004
4005 @findex BLOCK_PROFILER_CODE
4006 @item BLOCK_PROFILER_CODE
4007 A C function or functions which are needed in the library to
4008 support block profiling.
4009
4010 @findex TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER
4011 @item TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER
4012 On some targets, it is impossible to use profiling when the frame
4013 pointer has been omitted.  For example, on x86 GNU/Linux systems,
4014 the @code{mcount} routine provided by the GNU C Library finds the
4015 address of the routine that called the routine that called @code{mcount}
4016 by looking in the immediate caller's stack frame.  If the immediate
4017 caller has no frame pointer, this lookup will fail.
4018
4019 By default, GCC assumes that the target does allow profiling when the
4020 frame pointer is omitted.  This macro should be defined to a C
4021 expression that evaluates to @code{false} if the target does not allow
4022 profiling when the frame pointer is omitted.
4023
4024 @end table
4025
4026 @node Inlining
4027 @subsection Permitting inlining of functions with attributes
4028 @cindex inlining
4029
4030 By default if a function has a target specific attribute attached to it,
4031 it will not be inlined.  This behaviour can be overridden if the target
4032 defines the @samp{FUNCTION_ATTRIBUTE_INLINABLE_P} macro.  This macro
4033 takes one argument, a @samp{DECL} describing the function.  It should
4034 return non-zero if the function can be inlined, otherwise it should
4035 return 0.
4036
4037 @node Tail Calling
4038 @subsection Permitting tail calls to functions
4039 @cindex tail calls
4040 @cindex sibling calls
4041
4042 @table @code
4043 @findex FUNCTION_OK_FOR_SIBCALL
4044 @item FUNCTION_OK_FOR_SIBCALL (@var{decl})
4045 A C expression that evaluates to true if it is ok to perform a sibling
4046 call to @var{decl}.
4047
4048 It is not uncommon for limitations of calling conventions to prevent
4049 tail calls to functions outside the current unit of translation, or
4050 during PIC compilation.  Use this macro to enforce these restrictions,
4051 as the @code{sibcall} md pattern can not fail, or fall over to a
4052 ``normal'' call.
4053 @end table
4054
4055 @node Varargs
4056 @section Implementing the Varargs Macros
4057 @cindex varargs implementation
4058
4059 GCC comes with an implementation of @file{varargs.h} and
4060 @file{stdarg.h} that work without change on machines that pass arguments
4061 on the stack.  Other machines require their own implementations of
4062 varargs, and the two machine independent header files must have
4063 conditionals to include it.
4064
4065 ISO @file{stdarg.h} differs from traditional @file{varargs.h} mainly in
4066 the calling convention for @code{va_start}.  The traditional
4067 implementation takes just one argument, which is the variable in which
4068 to store the argument pointer.  The ISO implementation of
4069 @code{va_start} takes an additional second argument.  The user is
4070 supposed to write the last named argument of the function here.
4071
4072 However, @code{va_start} should not use this argument.  The way to find
4073 the end of the named arguments is with the built-in functions described
4074 below.
4075
4076 @table @code
4077 @findex __builtin_saveregs
4078 @item __builtin_saveregs ()
4079 Use this built-in function to save the argument registers in memory so
4080 that the varargs mechanism can access them.  Both ISO and traditional
4081 versions of @code{va_start} must use @code{__builtin_saveregs}, unless
4082 you use @code{SETUP_INCOMING_VARARGS} (see below) instead.
4083
4084 On some machines, @code{__builtin_saveregs} is open-coded under the
4085 control of the macro @code{EXPAND_BUILTIN_SAVEREGS}.  On other machines,
4086 it calls a routine written in assembler language, found in
4087 @file{libgcc2.c}.
4088
4089 Code generated for the call to @code{__builtin_saveregs} appears at the
4090 beginning of the function, as opposed to where the call to
4091 @code{__builtin_saveregs} is written, regardless of what the code is.
4092 This is because the registers must be saved before the function starts
4093 to use them for its own purposes.
4094 @c i rewrote the first sentence above to fix an overfull hbox. --mew
4095 @c 10feb93
4096
4097 @findex __builtin_args_info
4098 @item __builtin_args_info (@var{category})
4099 Use this built-in function to find the first anonymous arguments in
4100 registers.
4101
4102 In general, a machine may have several categories of registers used for
4103 arguments, each for a particular category of data types.  (For example,
4104 on some machines, floating-point registers are used for floating-point
4105 arguments while other arguments are passed in the general registers.)
4106 To make non-varargs functions use the proper calling convention, you
4107 have defined the @code{CUMULATIVE_ARGS} data type to record how many
4108 registers in each category have been used so far
4109
4110 @code{__builtin_args_info} accesses the same data structure of type
4111 @code{CUMULATIVE_ARGS} after the ordinary argument layout is finished
4112 with it, with @var{category} specifying which word to access.  Thus, the
4113 value indicates the first unused register in a given category.
4114
4115 Normally, you would use @code{__builtin_args_info} in the implementation
4116 of @code{va_start}, accessing each category just once and storing the
4117 value in the @code{va_list} object.  This is because @code{va_list} will
4118 have to update the values, and there is no way to alter the
4119 values accessed by @code{__builtin_args_info}.
4120
4121 @findex __builtin_next_arg
4122 @item __builtin_next_arg (@var{lastarg})
4123 This is the equivalent of @code{__builtin_args_info}, for stack
4124 arguments.  It returns the address of the first anonymous stack
4125 argument, as type @code{void *}. If @code{ARGS_GROW_DOWNWARD}, it
4126 returns the address of the location above the first anonymous stack
4127 argument.  Use it in @code{va_start} to initialize the pointer for
4128 fetching arguments from the stack.  Also use it in @code{va_start} to
4129 verify that the second parameter @var{lastarg} is the last named argument
4130 of the current function.
4131
4132 @findex __builtin_classify_type
4133 @item __builtin_classify_type (@var{object})
4134 Since each machine has its own conventions for which data types are
4135 passed in which kind of register, your implementation of @code{va_arg}
4136 has to embody these conventions.  The easiest way to categorize the
4137 specified data type is to use @code{__builtin_classify_type} together
4138 with @code{sizeof} and @code{__alignof__}.
4139
4140 @code{__builtin_classify_type} ignores the value of @var{object},
4141 considering only its data type.  It returns an integer describing what
4142 kind of type that is---integer, floating, pointer, structure, and so on.
4143
4144 The file @file{typeclass.h} defines an enumeration that you can use to
4145 interpret the values of @code{__builtin_classify_type}.
4146 @end table
4147
4148 These machine description macros help implement varargs:
4149
4150 @table @code
4151 @findex EXPAND_BUILTIN_SAVEREGS
4152 @item EXPAND_BUILTIN_SAVEREGS ()
4153 If defined, is a C expression that produces the machine-specific code
4154 for a call to @code{__builtin_saveregs}.  This code will be moved to the
4155 very beginning of the function, before any parameter access are made.
4156 The return value of this function should be an RTX that contains the
4157 value to use as the return of @code{__builtin_saveregs}.
4158
4159 @findex SETUP_INCOMING_VARARGS
4160 @item SETUP_INCOMING_VARARGS (@var{args_so_far}, @var{mode}, @var{type}, @var{pretend_args_size}, @var{second_time})
4161 This macro offers an alternative to using @code{__builtin_saveregs} and
4162 defining the macro @code{EXPAND_BUILTIN_SAVEREGS}.  Use it to store the
4163 anonymous register arguments into the stack so that all the arguments
4164 appear to have been passed consecutively on the stack.  Once this is
4165 done, you can use the standard implementation of varargs that works for
4166 machines that pass all their arguments on the stack.
4167
4168 The argument @var{args_so_far} is the @code{CUMULATIVE_ARGS} data
4169 structure, containing the values that are obtained after processing the
4170 named arguments.  The arguments @var{mode} and @var{type} describe the
4171 last named argument---its machine mode and its data type as a tree node.
4172
4173 The macro implementation should do two things: first, push onto the
4174 stack all the argument registers @emph{not} used for the named
4175 arguments, and second, store the size of the data thus pushed into the
4176 @code{int}-valued variable whose name is supplied as the argument
4177 @var{pretend_args_size}.  The value that you store here will serve as
4178 additional offset for setting up the stack frame.
4179
4180 Because you must generate code to push the anonymous arguments at
4181 compile time without knowing their data types,
4182 @code{SETUP_INCOMING_VARARGS} is only useful on machines that have just
4183 a single category of argument register and use it uniformly for all data
4184 types.
4185
4186 If the argument @var{second_time} is nonzero, it means that the
4187 arguments of the function are being analyzed for the second time.  This
4188 happens for an inline function, which is not actually compiled until the
4189 end of the source file.  The macro @code{SETUP_INCOMING_VARARGS} should
4190 not generate any instructions in this case.
4191
4192 @findex STRICT_ARGUMENT_NAMING
4193 @item STRICT_ARGUMENT_NAMING
4194 Define this macro to be a nonzero value if the location where a function
4195 argument is passed depends on whether or not it is a named argument.
4196
4197 This macro controls how the @var{named} argument to @code{FUNCTION_ARG}
4198 is set for varargs and stdarg functions.  If this macro returns a
4199 nonzero value, the @var{named} argument is always true for named
4200 arguments, and false for unnamed arguments.  If it returns a value of
4201 zero, but @code{SETUP_INCOMING_VARARGS} is defined, then all arguments
4202 are treated as named.  Otherwise, all named arguments except the last
4203 are treated as named.
4204
4205 You need not define this macro if it always returns zero.
4206
4207 @findex PRETEND_OUTGOING_VARARGS_NAMED
4208 @item PRETEND_OUTGOING_VARARGS_NAMED
4209 If you need to conditionally change ABIs so that one works with
4210 @code{SETUP_INCOMING_VARARGS}, but the other works like neither
4211 @code{SETUP_INCOMING_VARARGS} nor @code{STRICT_ARGUMENT_NAMING} was
4212 defined, then define this macro to return nonzero if
4213 @code{SETUP_INCOMING_VARARGS} is used, zero otherwise.
4214 Otherwise, you should not define this macro.
4215 @end table
4216
4217 @node Trampolines
4218 @section Trampolines for Nested Functions
4219 @cindex trampolines for nested functions
4220 @cindex nested functions, trampolines for
4221
4222 A @dfn{trampoline} is a small piece of code that is created at run time
4223 when the address of a nested function is taken.  It normally resides on
4224 the stack, in the stack frame of the containing function.  These macros
4225 tell GCC how to generate code to allocate and initialize a
4226 trampoline.
4227
4228 The instructions in the trampoline must do two things: load a constant
4229 address into the static chain register, and jump to the real address of
4230 the nested function.  On CISC machines such as the m68k, this requires
4231 two instructions, a move immediate and a jump.  Then the two addresses
4232 exist in the trampoline as word-long immediate operands.  On RISC
4233 machines, it is often necessary to load each address into a register in
4234 two parts.  Then pieces of each address form separate immediate
4235 operands.
4236
4237 The code generated to initialize the trampoline must store the variable
4238 parts---the static chain value and the function address---into the
4239 immediate operands of the instructions.  On a CISC machine, this is
4240 simply a matter of copying each address to a memory reference at the
4241 proper offset from the start of the trampoline.  On a RISC machine, it
4242 may be necessary to take out pieces of the address and store them
4243 separately.
4244
4245 @table @code
4246 @findex TRAMPOLINE_TEMPLATE
4247 @item TRAMPOLINE_TEMPLATE (@var{file})
4248 A C statement to output, on the stream @var{file}, assembler code for a
4249 block of data that contains the constant parts of a trampoline.  This
4250 code should not include a label---the label is taken care of
4251 automatically.
4252
4253 If you do not define this macro, it means no template is needed
4254 for the target.  Do not define this macro on systems where the block move
4255 code to copy the trampoline into place would be larger than the code
4256 to generate it on the spot.
4257
4258 @findex TRAMPOLINE_SECTION
4259 @item TRAMPOLINE_SECTION
4260 The name of a subroutine to switch to the section in which the
4261 trampoline template is to be placed (@pxref{Sections}).  The default is
4262 a value of @samp{readonly_data_section}, which places the trampoline in
4263 the section containing read-only data.
4264
4265 @findex TRAMPOLINE_SIZE
4266 @item TRAMPOLINE_SIZE
4267 A C expression for the size in bytes of the trampoline, as an integer.
4268
4269 @findex TRAMPOLINE_ALIGNMENT
4270 @item TRAMPOLINE_ALIGNMENT
4271 Alignment required for trampolines, in bits.
4272
4273 If you don't define this macro, the value of @code{BIGGEST_ALIGNMENT}
4274 is used for aligning trampolines.
4275
4276 @findex INITIALIZE_TRAMPOLINE
4277 @item INITIALIZE_TRAMPOLINE (@var{addr}, @var{fnaddr}, @var{static_chain})
4278 A C statement to initialize the variable parts of a trampoline.
4279 @var{addr} is an RTX for the address of the trampoline; @var{fnaddr} is
4280 an RTX for the address of the nested function; @var{static_chain} is an
4281 RTX for the static chain value that should be passed to the function
4282 when it is called.
4283
4284 @findex TRAMPOLINE_ADJUST_ADDRESS
4285 @item TRAMPOLINE_ADJUST_ADDRESS (@var{addr})
4286 A C statement that should perform any machine-specific adjustment in
4287 the address of the trampoline.  Its argument contains the address that
4288 was passed to @code{INITIALIZE_TRAMPOLINE}.  In case the address to be
4289 used for a function call should be different from the address in which
4290 the template was stored, the different address should be assigned to
4291 @var{addr}.  If this macro is not defined, @var{addr} will be used for
4292 function calls.
4293
4294 @findex ALLOCATE_TRAMPOLINE
4295 @item ALLOCATE_TRAMPOLINE (@var{fp})
4296 A C expression to allocate run-time space for a trampoline.  The
4297 expression value should be an RTX representing a memory reference to the
4298 space for the trampoline.
4299
4300 @cindex @code{FUNCTION_EPILOGUE} and trampolines
4301 @cindex @code{FUNCTION_PROLOGUE} and trampolines
4302 If this macro is not defined, by default the trampoline is allocated as
4303 a stack slot.  This default is right for most machines.  The exceptions
4304 are machines where it is impossible to execute instructions in the stack
4305 area.  On such machines, you may have to implement a separate stack,
4306 using this macro in conjunction with @code{FUNCTION_PROLOGUE} and
4307 @code{FUNCTION_EPILOGUE}.
4308
4309 @var{fp} points to a data structure, a @code{struct function}, which
4310 describes the compilation status of the immediate containing function of
4311 the function which the trampoline is for.  Normally (when
4312 @code{ALLOCATE_TRAMPOLINE} is not defined), the stack slot for the
4313 trampoline is in the stack frame of this containing function.  Other
4314 allocation strategies probably must do something analogous with this
4315 information.
4316 @end table
4317
4318 Implementing trampolines is difficult on many machines because they have
4319 separate instruction and data caches.  Writing into a stack location
4320 fails to clear the memory in the instruction cache, so when the program
4321 jumps to that location, it executes the old contents.
4322
4323 Here are two possible solutions.  One is to clear the relevant parts of
4324 the instruction cache whenever a trampoline is set up.  The other is to
4325 make all trampolines identical, by having them jump to a standard
4326 subroutine.  The former technique makes trampoline execution faster; the
4327 latter makes initialization faster.
4328
4329 To clear the instruction cache when a trampoline is initialized, define
4330 the following macros which describe the shape of the cache.
4331
4332 @table @code
4333 @findex INSN_CACHE_SIZE
4334 @item INSN_CACHE_SIZE
4335 The total size in bytes of the cache.
4336
4337 @findex INSN_CACHE_LINE_WIDTH
4338 @item INSN_CACHE_LINE_WIDTH
4339 The length in bytes of each cache line.  The cache is divided into cache
4340 lines which are disjoint slots, each holding a contiguous chunk of data
4341 fetched from memory.  Each time data is brought into the cache, an
4342 entire line is read at once.  The data loaded into a cache line is
4343 always aligned on a boundary equal to the line size.
4344
4345 @findex INSN_CACHE_DEPTH
4346 @item INSN_CACHE_DEPTH
4347 The number of alternative cache lines that can hold any particular memory
4348 location.
4349 @end table
4350
4351 Alternatively, if the machine has system calls or instructions to clear
4352 the instruction cache directly, you can define the following macro.
4353
4354 @table @code
4355 @findex CLEAR_INSN_CACHE
4356 @item CLEAR_INSN_CACHE (@var{BEG}, @var{END})
4357 If defined, expands to a C expression clearing the @emph{instruction
4358 cache} in the specified interval.  If it is not defined, and the macro
4359 INSN_CACHE_SIZE is defined, some generic code is generated to clear the
4360 cache.  The definition of this macro would typically be a series of
4361 @code{asm} statements.  Both @var{BEG} and @var{END} are both pointer
4362 expressions.
4363 @end table
4364
4365 To use a standard subroutine, define the following macro.  In addition,
4366 you must make sure that the instructions in a trampoline fill an entire
4367 cache line with identical instructions, or else ensure that the
4368 beginning of the trampoline code is always aligned at the same point in
4369 its cache line.  Look in @file{m68k.h} as a guide.
4370
4371 @table @code
4372 @findex TRANSFER_FROM_TRAMPOLINE
4373 @item TRANSFER_FROM_TRAMPOLINE
4374 Define this macro if trampolines need a special subroutine to do their
4375 work.  The macro should expand to a series of @code{asm} statements
4376 which will be compiled with GCC.  They go in a library function named
4377 @code{__transfer_from_trampoline}.
4378
4379 If you need to avoid executing the ordinary prologue code of a compiled
4380 C function when you jump to the subroutine, you can do so by placing a
4381 special label of your own in the assembler code.  Use one @code{asm}
4382 statement to generate an assembler label, and another to make the label
4383 global.  Then trampolines can use that label to jump directly to your
4384 special assembler code.
4385 @end table
4386
4387 @node Library Calls
4388 @section Implicit Calls to Library Routines
4389 @cindex library subroutine names
4390 @cindex @file{libgcc.a}
4391
4392 @c prevent bad page break with this line
4393 Here is an explanation of implicit calls to library routines.
4394
4395 @table @code
4396 @findex MULSI3_LIBCALL
4397 @item MULSI3_LIBCALL
4398 A C string constant giving the name of the function to call for
4399 multiplication of one signed full-word by another.  If you do not
4400 define this macro, the default name is used, which is @code{__mulsi3},
4401 a function defined in @file{libgcc.a}.
4402
4403 @findex DIVSI3_LIBCALL
4404 @item DIVSI3_LIBCALL
4405 A C string constant giving the name of the function to call for
4406 division of one signed full-word by another.  If you do not define
4407 this macro, the default name is used, which is @code{__divsi3}, a
4408 function defined in @file{libgcc.a}.
4409
4410 @findex UDIVSI3_LIBCALL
4411 @item UDIVSI3_LIBCALL
4412 A C string constant giving the name of the function to call for
4413 division of one unsigned full-word by another.  If you do not define
4414 this macro, the default name is used, which is @code{__udivsi3}, a
4415 function defined in @file{libgcc.a}.
4416
4417 @findex MODSI3_LIBCALL
4418 @item MODSI3_LIBCALL
4419 A C string constant giving the name of the function to call for the
4420 remainder in division of one signed full-word by another.  If you do
4421 not define this macro, the default name is used, which is
4422 @code{__modsi3}, a function defined in @file{libgcc.a}.
4423
4424 @findex UMODSI3_LIBCALL
4425 @item UMODSI3_LIBCALL
4426 A C string constant giving the name of the function to call for the
4427 remainder in division of one unsigned full-word by another.  If you do
4428 not define this macro, the default name is used, which is
4429 @code{__umodsi3}, a function defined in @file{libgcc.a}.
4430
4431 @findex MULDI3_LIBCALL
4432 @item MULDI3_LIBCALL
4433 A C string constant giving the name of the function to call for
4434 multiplication of one signed double-word by another.  If you do not
4435 define this macro, the default name is used, which is @code{__muldi3},
4436 a function defined in @file{libgcc.a}.
4437
4438 @findex DIVDI3_LIBCALL
4439 @item DIVDI3_LIBCALL
4440 A C string constant giving the name of the function to call for
4441 division of one signed double-word by another.  If you do not define
4442 this macro, the default name is used, which is @code{__divdi3}, a
4443 function defined in @file{libgcc.a}.
4444
4445 @findex UDIVDI3_LIBCALL
4446 @item UDIVDI3_LIBCALL
4447 A C string constant giving the name of the function to call for
4448 division of one unsigned full-word by another.  If you do not define
4449 this macro, the default name is used, which is @code{__udivdi3}, a
4450 function defined in @file{libgcc.a}.
4451
4452 @findex MODDI3_LIBCALL
4453 @item MODDI3_LIBCALL
4454 A C string constant giving the name of the function to call for the
4455 remainder in division of one signed double-word by another.  If you do
4456 not define this macro, the default name is used, which is
4457 @code{__moddi3}, a function defined in @file{libgcc.a}.
4458
4459 @findex UMODDI3_LIBCALL
4460 @item UMODDI3_LIBCALL
4461 A C string constant giving the name of the function to call for the
4462 remainder in division of one unsigned full-word by another.  If you do
4463 not define this macro, the default name is used, which is
4464 @code{__umoddi3}, a function defined in @file{libgcc.a}.
4465
4466 @findex INIT_TARGET_OPTABS
4467 @item INIT_TARGET_OPTABS
4468 Define this macro as a C statement that declares additional library
4469 routines renames existing ones. @code{init_optabs} calls this macro after
4470 initializing all the normal library routines.
4471
4472 @findex FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
4473 @item FLOAT_LIB_COMPARE_RETURNS_BOOL
4474 Define this macro as a C statement that returns nonzero if a call to
4475 the floating point comparison library function will return a boolean
4476 value that indicates the result of the comparison.  It should return
4477 zero if one of gcc's own libgcc functions is called.
4478
4479 Most ports don't need to define this macro.
4480
4481 @findex TARGET_EDOM
4482 @cindex @code{EDOM}, implicit usage
4483 @item TARGET_EDOM
4484 The value of @code{EDOM} on the target machine, as a C integer constant
4485 expression.  If you don't define this macro, GCC does not attempt to
4486 deposit the value of @code{EDOM} into @code{errno} directly.  Look in
4487 @file{/usr/include/errno.h} to find the value of @code{EDOM} on your
4488 system.
4489
4490 If you do not define @code{TARGET_EDOM}, then compiled code reports
4491 domain errors by calling the library function and letting it report the
4492 error.  If mathematical functions on your system use @code{matherr} when
4493 there is an error, then you should leave @code{TARGET_EDOM} undefined so
4494 that @code{matherr} is used normally.
4495
4496 @findex GEN_ERRNO_RTX
4497 @cindex @code{errno}, implicit usage
4498 @item GEN_ERRNO_RTX
4499 Define this macro as a C expression to create an rtl expression that
4500 refers to the global ``variable'' @code{errno}.  (On certain systems,
4501 @code{errno} may not actually be a variable.)  If you don't define this
4502 macro, a reasonable default is used.
4503
4504 @findex TARGET_MEM_FUNCTIONS
4505 @cindex @code{bcopy}, implicit usage
4506 @cindex @code{memcpy}, implicit usage
4507 @cindex @code{memmove}, implicit usage
4508 @cindex @code{bzero}, implicit usage
4509 @cindex @code{memset}, implicit usage
4510 @item TARGET_MEM_FUNCTIONS
4511 Define this macro if GCC should generate calls to the ISO C
4512 (and System V) library functions @code{memcpy}, @code{memmove} and
4513 @code{memset} rather than the BSD functions @code{bcopy} and @code{bzero}.
4514
4515 @findex LIBGCC_NEEDS_DOUBLE
4516 @item LIBGCC_NEEDS_DOUBLE
4517 Define this macro if @code{float} arguments cannot be passed to library
4518 routines (so they must be converted to @code{double}).  This macro
4519 affects both how library calls are generated and how the library
4520 routines in @file{libgcc.a} accept their arguments.  It is useful on
4521 machines where floating and fixed point arguments are passed
4522 differently, such as the i860.
4523
4524 @findex NEXT_OBJC_RUNTIME
4525 @item NEXT_OBJC_RUNTIME
4526 Define this macro to generate code for Objective C message sending using
4527 the calling convention of the NeXT system.  This calling convention
4528 involves passing the object, the selector and the method arguments all
4529 at once to the method-lookup library function.
4530
4531 The default calling convention passes just the object and the selector
4532 to the lookup function, which returns a pointer to the method.
4533 @end table
4534
4535 @node Addressing Modes
4536 @section Addressing Modes
4537 @cindex addressing modes
4538
4539 @c prevent bad page break with this line
4540 This is about addressing modes.
4541
4542 @table @code
4543 @findex HAVE_PRE_INCREMENT
4544 @findex HAVE_PRE_DECREMENT
4545 @findex HAVE_POST_INCREMENT
4546 @findex HAVE_POST_DECREMENT
4547 @item HAVE_PRE_INCREMENT
4548 @itemx HAVE_PRE_DECREMENT
4549 @itemx HAVE_POST_INCREMENT
4550 @itemx HAVE_POST_DECREMENT
4551 A C expression that is non-zero if the machine supports pre-increment,
4552 pre-decrement, post-increment, or post-decrement addressing respectively.
4553
4554 @findex HAVE_POST_MODIFY_DISP
4555 @findex HAVE_PRE_MODIFY_DISP
4556 @item HAVE_PRE_MODIFY_DISP
4557 @itemx HAVE_POST_MODIFY_DISP
4558 A C expression that is non-zero if the machine supports pre- or
4559 post-address side-effect generation involving constants other than
4560 the size of the memory operand.
4561
4562 @findex HAVE_POST_MODIFY_REG
4563 @findex HAVE_PRE_MODIFY_REG
4564 @item HAVE_PRE_MODIFY_REG
4565 @itemx HAVE_POST_MODIFY_REG
4566 A C expression that is non-zero if the machine supports pre- or
4567 post-address side-effect generation involving a register displacement.
4568
4569 @findex CONSTANT_ADDRESS_P
4570 @item CONSTANT_ADDRESS_P (@var{x})
4571 A C expression that is 1 if the RTX @var{x} is a constant which
4572 is a valid address.  On most machines, this can be defined as
4573 @code{CONSTANT_P (@var{x})}, but a few machines are more restrictive
4574 in which constant addresses are supported.
4575
4576 @findex CONSTANT_P
4577 @code{CONSTANT_P} accepts integer-values expressions whose values are
4578 not explicitly known, such as @code{symbol_ref}, @code{label_ref}, and
4579 @code{high} expressions and @code{const} arithmetic expressions, in
4580 addition to @code{const_int} and @code{const_double} expressions.
4581
4582 @findex MAX_REGS_PER_ADDRESS
4583 @item MAX_REGS_PER_ADDRESS
4584 A number, the maximum number of registers that can appear in a valid
4585 memory address.  Note that it is up to you to specify a value equal to
4586 the maximum number that @code{GO_IF_LEGITIMATE_ADDRESS} would ever
4587 accept.
4588
4589 @findex GO_IF_LEGITIMATE_ADDRESS
4590 @item GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})
4591 A C compound statement with a conditional @code{goto @var{label};}
4592 executed if @var{x} (an RTX) is a legitimate memory address on the
4593 target machine for a memory operand of mode @var{mode}.
4594
4595 It usually pays to define several simpler macros to serve as
4596 subroutines for this one.  Otherwise it may be too complicated to
4597 understand.
4598
4599 This macro must exist in two variants: a strict variant and a
4600 non-strict one.  The strict variant is used in the reload pass.  It
4601 must be defined so that any pseudo-register that has not been
4602 allocated a hard register is considered a memory reference.  In
4603 contexts where some kind of register is required, a pseudo-register
4604 with no hard register must be rejected.
4605
4606 The non-strict variant is used in other passes.  It must be defined to
4607 accept all pseudo-registers in every context where some kind of
4608 register is required.
4609
4610 @findex REG_OK_STRICT
4611 Compiler source files that want to use the strict variant of this
4612 macro define the macro @code{REG_OK_STRICT}.  You should use an
4613 @code{#ifdef REG_OK_STRICT} conditional to define the strict variant
4614 in that case and the non-strict variant otherwise.
4615
4616 Subroutines to check for acceptable registers for various purposes (one
4617 for base registers, one for index registers, and so on) are typically
4618 among the subroutines used to define @code{GO_IF_LEGITIMATE_ADDRESS}.
4619 Then only these subroutine macros need have two variants; the higher
4620 levels of macros may be the same whether strict or not.@refill
4621
4622 Normally, constant addresses which are the sum of a @code{symbol_ref}
4623 and an integer are stored inside a @code{const} RTX to mark them as
4624 constant.  Therefore, there is no need to recognize such sums
4625 specifically as legitimate addresses.  Normally you would simply
4626 recognize any @code{const} as legitimate.
4627
4628 Usually @code{PRINT_OPERAND_ADDRESS} is not prepared to handle constant
4629 sums that are not marked with  @code{const}.  It assumes that a naked
4630 @code{plus} indicates indexing.  If so, then you @emph{must} reject such
4631 naked constant sums as illegitimate addresses, so that none of them will
4632 be given to @code{PRINT_OPERAND_ADDRESS}.
4633
4634 @cindex @code{ENCODE_SECTION_INFO} and address validation
4635 On some machines, whether a symbolic address is legitimate depends on
4636 the section that the address refers to.  On these machines, define the
4637 macro @code{ENCODE_SECTION_INFO} to store the information into the
4638 @code{symbol_ref}, and then check for it here.  When you see a
4639 @code{const}, you will have to look inside it to find the
4640 @code{symbol_ref} in order to determine the section.  @xref{Assembler
4641 Format}.
4642
4643 @findex saveable_obstack
4644 The best way to modify the name string is by adding text to the
4645 beginning, with suitable punctuation to prevent any ambiguity.  Allocate
4646 the new name in @code{saveable_obstack}.  You will have to modify
4647 @code{ASM_OUTPUT_LABELREF} to remove and decode the added text and
4648 output the name accordingly, and define @code{STRIP_NAME_ENCODING} to
4649 access the original name string.
4650
4651 You can check the information stored here into the @code{symbol_ref} in
4652 the definitions of the macros @code{GO_IF_LEGITIMATE_ADDRESS} and
4653 @code{PRINT_OPERAND_ADDRESS}.
4654
4655 @findex REG_OK_FOR_BASE_P
4656 @item REG_OK_FOR_BASE_P (@var{x})
4657 A C expression that is nonzero if @var{x} (assumed to be a @code{reg}
4658 RTX) is valid for use as a base register.  For hard registers, it
4659 should always accept those which the hardware permits and reject the
4660 others.  Whether the macro accepts or rejects pseudo registers must be
4661 controlled by @code{REG_OK_STRICT} as described above.  This usually
4662 requires two variant definitions, of which @code{REG_OK_STRICT}
4663 controls the one actually used.
4664
4665 @findex REG_MODE_OK_FOR_BASE_P
4666 @item REG_MODE_OK_FOR_BASE_P (@var{x}, @var{mode})
4667 A C expression that is just like @code{REG_OK_FOR_BASE_P}, except that
4668 that expression may examine the mode of the memory reference in
4669 @var{mode}.  You should define this macro if the mode of the memory
4670 reference affects whether a register may be used as a base register.  If
4671 you define this macro, the compiler will use it instead of
4672 @code{REG_OK_FOR_BASE_P}.
4673
4674 @findex REG_OK_FOR_INDEX_P
4675 @item REG_OK_FOR_INDEX_P (@var{x})
4676 A C expression that is nonzero if @var{x} (assumed to be a @code{reg}
4677 RTX) is valid for use as an index register.
4678
4679 The difference between an index register and a base register is that
4680 the index register may be scaled.  If an address involves the sum of
4681 two registers, neither one of them scaled, then either one may be
4682 labeled the ``base'' and the other the ``index''; but whichever
4683 labeling is used must fit the machine's constraints of which registers
4684 may serve in each capacity.  The compiler will try both labelings,
4685 looking for one that is valid, and will reload one or both registers
4686 only if neither labeling works.
4687
4688 @findex FIND_BASE_TERM
4689 @item FIND_BASE_TERM (@var{x})
4690 A C expression to determine the base term of address @var{x}.
4691 This macro is used in only one place: `find_base_term' in alias.c.
4692
4693 It is always safe for this macro to not be defined.  It exists so
4694 that alias analysis can understand machine-dependent addresses.
4695
4696 The typical use of this macro is to handle addresses containing
4697 a label_ref or symbol_ref within an UNSPEC.
4698
4699 @findex LEGITIMIZE_ADDRESS
4700 @item LEGITIMIZE_ADDRESS (@var{x}, @var{oldx}, @var{mode}, @var{win})
4701 A C compound statement that attempts to replace @var{x} with a valid
4702 memory address for an operand of mode @var{mode}.  @var{win} will be a
4703 C statement label elsewhere in the code; the macro definition may use
4704
4705 @example
4706 GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{win});
4707 @end example
4708
4709 @noindent
4710 to avoid further processing if the address has become legitimate.
4711
4712 @findex break_out_memory_refs
4713 @var{x} will always be the result of a call to @code{break_out_memory_refs},
4714 and @var{oldx} will be the operand that was given to that function to produce
4715 @var{x}.
4716
4717 The code generated by this macro should not alter the substructure of
4718 @var{x}.  If it transforms @var{x} into a more legitimate form, it
4719 should assign @var{x} (which will always be a C variable) a new value.
4720
4721 It is not necessary for this macro to come up with a legitimate
4722 address.  The compiler has standard ways of doing so in all cases.  In
4723 fact, it is safe for this macro to do nothing.  But often a
4724 machine-dependent strategy can generate better code.
4725
4726 @findex LEGITIMIZE_RELOAD_ADDRESS
4727 @item LEGITIMIZE_RELOAD_ADDRESS (@var{x}, @var{mode}, @var{opnum}, @var{type}, @var{ind_levels}, @var{win})
4728 A C compound statement that attempts to replace @var{x}, which is an address
4729 that needs reloading, with a valid memory address for an operand of mode
4730 @var{mode}.  @var{win} will be a C statement label elsewhere in the code.
4731 It is not necessary to define this macro, but it might be useful for
4732 performance reasons.
4733
4734 For example, on the i386, it is sometimes possible to use a single
4735 reload register instead of two by reloading a sum of two pseudo
4736 registers into a register.  On the other hand, for number of RISC
4737 processors offsets are limited so that often an intermediate address
4738 needs to be generated in order to address a stack slot.  By defining
4739 LEGITIMIZE_RELOAD_ADDRESS appropriately, the intermediate addresses
4740 generated for adjacent some stack slots can be made identical, and thus
4741 be shared.
4742
4743 @emph{Note}: This macro should be used with caution.  It is necessary
4744 to know something of how reload works in order to effectively use this,
4745 and it is quite easy to produce macros that build in too much knowledge
4746 of reload internals.
4747
4748 @emph{Note}: This macro must be able to reload an address created by a
4749 previous invocation of this macro.  If it fails to handle such addresses
4750 then the compiler may generate incorrect code or abort.
4751
4752 @findex push_reload
4753 The macro definition should use @code{push_reload} to indicate parts that
4754 need reloading; @var{opnum}, @var{type} and @var{ind_levels} are usually
4755 suitable to be passed unaltered to @code{push_reload}.
4756
4757 The code generated by this macro must not alter the substructure of
4758 @var{x}.  If it transforms @var{x} into a more legitimate form, it
4759 should assign @var{x} (which will always be a C variable) a new value.
4760 This also applies to parts that you change indirectly by calling
4761 @code{push_reload}.
4762
4763 @findex strict_memory_address_p
4764 The macro definition may use @code{strict_memory_address_p} to test if
4765 the address has become legitimate.
4766
4767 @findex copy_rtx
4768 If you want to change only a part of @var{x}, one standard way of doing
4769 this is to use @code{copy_rtx}.  Note, however, that is unshares only a
4770 single level of rtl.  Thus, if the part to be changed is not at the
4771 top level, you'll need to replace first the top level.
4772 It is not necessary for this macro to come up with a legitimate
4773 address;  but often a machine-dependent strategy can generate better code.
4774
4775 @findex GO_IF_MODE_DEPENDENT_ADDRESS
4776 @item GO_IF_MODE_DEPENDENT_ADDRESS (@var{addr}, @var{label})
4777 A C statement or compound statement with a conditional @code{goto
4778 @var{label};} executed if memory address @var{x} (an RTX) can have
4779 different meanings depending on the machine mode of the memory
4780 reference it is used for or if the address is valid for some modes
4781 but not others.
4782
4783 Autoincrement and autodecrement addresses typically have mode-dependent
4784 effects because the amount of the increment or decrement is the size
4785 of the operand being addressed.  Some machines have other mode-dependent
4786 addresses.  Many RISC machines have no mode-dependent addresses.
4787
4788 You may assume that @var{addr} is a valid address for the machine.
4789
4790 @findex LEGITIMATE_CONSTANT_P
4791 @item LEGITIMATE_CONSTANT_P (@var{x})
4792 A C expression that is nonzero if @var{x} is a legitimate constant for
4793 an immediate operand on the target machine.  You can assume that
4794 @var{x} satisfies @code{CONSTANT_P}, so you need not check this.  In fact,
4795 @samp{1} is a suitable definition for this macro on machines where
4796 anything @code{CONSTANT_P} is valid.@refill
4797 @end table
4798
4799 @node Condition Code
4800 @section Condition Code Status
4801 @cindex condition code status
4802
4803 @c prevent bad page break with this line
4804 This describes the condition code status.
4805
4806 @findex cc_status
4807 The file @file{conditions.h} defines a variable @code{cc_status} to
4808 describe how the condition code was computed (in case the interpretation of
4809 the condition code depends on the instruction that it was set by).  This
4810 variable contains the RTL expressions on which the condition code is
4811 currently based, and several standard flags.
4812
4813 Sometimes additional machine-specific flags must be defined in the machine
4814 description header file.  It can also add additional machine-specific
4815 information by defining @code{CC_STATUS_MDEP}.
4816
4817 @table @code
4818 @findex CC_STATUS_MDEP
4819 @item CC_STATUS_MDEP
4820 C code for a data type which is used for declaring the @code{mdep}
4821 component of @code{cc_status}.  It defaults to @code{int}.
4822
4823 This macro is not used on machines that do not use @code{cc0}.
4824
4825 @findex CC_STATUS_MDEP_INIT
4826 @item CC_STATUS_MDEP_INIT
4827 A C expression to initialize the @code{mdep} field to ``empty''.
4828 The default definition does nothing, since most machines don't use
4829 the field anyway.  If you want to use the field, you should probably
4830 define this macro to initialize it.
4831
4832 This macro is not used on machines that do not use @code{cc0}.
4833
4834 @findex NOTICE_UPDATE_CC
4835 @item NOTICE_UPDATE_CC (@var{exp}, @var{insn})
4836 A C compound statement to set the components of @code{cc_status}
4837 appropriately for an insn @var{insn} whose body is @var{exp}.  It is
4838 this macro's responsibility to recognize insns that set the condition
4839 code as a byproduct of other activity as well as those that explicitly
4840 set @code{(cc0)}.
4841
4842 This macro is not used on machines that do not use @code{cc0}.
4843
4844 If there are insns that do not set the condition code but do alter
4845 other machine registers, this macro must check to see whether they
4846 invalidate the expressions that the condition code is recorded as
4847 reflecting.  For example, on the 68000, insns that store in address
4848 registers do not set the condition code, which means that usually
4849 @code{NOTICE_UPDATE_CC} can leave @code{cc_status} unaltered for such
4850 insns.  But suppose that the previous insn set the condition code
4851 based on location @samp{a4@@(102)} and the current insn stores a new
4852 value in @samp{a4}.  Although the condition code is not changed by
4853 this, it will no longer be true that it reflects the contents of
4854 @samp{a4@@(102)}.  Therefore, @code{NOTICE_UPDATE_CC} must alter
4855 @code{cc_status} in this case to say that nothing is known about the
4856 condition code value.
4857
4858 The definition of @code{NOTICE_UPDATE_CC} must be prepared to deal
4859 with the results of peephole optimization: insns whose patterns are
4860 @code{parallel} RTXs containing various @code{reg}, @code{mem} or
4861 constants which are just the operands.  The RTL structure of these
4862 insns is not sufficient to indicate what the insns actually do.  What
4863 @code{NOTICE_UPDATE_CC} should do when it sees one is just to run
4864 @code{CC_STATUS_INIT}.
4865
4866 A possible definition of @code{NOTICE_UPDATE_CC} is to call a function
4867 that looks at an attribute (@pxref{Insn Attributes}) named, for example,
4868 @samp{cc}.  This avoids having detailed information about patterns in
4869 two places, the @file{md} file and in @code{NOTICE_UPDATE_CC}.
4870
4871 @findex EXTRA_CC_MODES
4872 @item EXTRA_CC_MODES
4873 A list of additional modes for condition code values in registers
4874 (@pxref{Jump Patterns}).  This macro should expand to a sequence of
4875 calls of the macro @code{CC} separated by white space.  @code{CC} takes
4876 two arguments.  The first is the enumeration name of the mode, which
4877 should begin with @samp{CC} and end with @samp{mode}.  The second is a C
4878 string giving the printable name of the mode; it should be the same as
4879 the first argument, but with the trailing @samp{mode} removed.
4880
4881 You should only define this macro if additional modes are required.
4882
4883 A sample definition of @code{EXTRA_CC_MODES} is:
4884 @smallexample
4885 #define EXTRA_CC_MODES            \
4886     CC(CC_NOOVmode, "CC_NOOV")    \
4887     CC(CCFPmode, "CCFP")          \
4888     CC(CCFPEmode, "CCFPE")
4889 @end smallexample
4890
4891 @findex SELECT_CC_MODE
4892 @item SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
4893 Returns a mode from class @code{MODE_CC} to be used when comparison
4894 operation code @var{op} is applied to rtx @var{x} and @var{y}.  For
4895 example, on the Sparc, @code{SELECT_CC_MODE} is defined as (see
4896 @pxref{Jump Patterns} for a description of the reason for this
4897 definition)
4898
4899 @smallexample
4900 #define SELECT_CC_MODE(OP,X,Y) \
4901   (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT          \
4902    ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode)    \
4903    : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS    \
4904        || GET_CODE (X) == NEG) \
4905       ? CC_NOOVmode : CCmode))
4906 @end smallexample
4907
4908 You need not define this macro if @code{EXTRA_CC_MODES} is not defined.
4909
4910 @findex CANONICALIZE_COMPARISON
4911 @item CANONICALIZE_COMPARISON (@var{code}, @var{op0}, @var{op1})
4912 On some machines not all possible comparisons are defined, but you can
4913 convert an invalid comparison into a valid one.  For example, the Alpha
4914 does not have a @code{GT} comparison, but you can use an @code{LT}
4915 comparison instead and swap the order of the operands.
4916
4917 On such machines, define this macro to be a C statement to do any
4918 required conversions.  @var{code} is the initial comparison code
4919 and @var{op0} and @var{op1} are the left and right operands of the
4920 comparison, respectively.  You should modify @var{code}, @var{op0}, and
4921 @var{op1} as required.
4922
4923 GCC will not assume that the comparison resulting from this macro is
4924 valid but will see if the resulting insn matches a pattern in the
4925 @file{md} file.
4926
4927 You need not define this macro if it would never change the comparison
4928 code or operands.
4929
4930 @findex REVERSIBLE_CC_MODE
4931 @item REVERSIBLE_CC_MODE (@var{mode})
4932 A C expression whose value is one if it is always safe to reverse a
4933 comparison whose mode is @var{mode}.  If @code{SELECT_CC_MODE}
4934 can ever return @var{mode} for a floating-point inequality comparison,
4935 then @code{REVERSIBLE_CC_MODE (@var{mode})} must be zero.
4936
4937 You need not define this macro if it would always returns zero or if the
4938 floating-point format is anything other than @code{IEEE_FLOAT_FORMAT}.
4939 For example, here is the definition used on the Sparc, where floating-point
4940 inequality comparisons are always given @code{CCFPEmode}:
4941
4942 @smallexample
4943 #define REVERSIBLE_CC_MODE(MODE)  ((MODE) != CCFPEmode)
4944 @end smallexample
4945
4946 @findex REVERSE_CONDITION (@var{code}, @var{mode})
4947 A C expression whose value is reversed condition code of the @var{code} for
4948 comparison done in CC_MODE @var{mode}.  The macro is used only in case
4949 @code{REVERSIBLE_CC_MODE (@var{mode})} is nonzero.  Define this macro in case
4950 machine has some non-standard way how to reverse certain conditionals.  For
4951 instance in case all floating point conditions are non-trapping, compiler may
4952 freely convert unordered compares to ordered one.  Then definition may look
4953 like:
4954
4955 @smallexample
4956 #define REVERSE_CONDITION(CODE, MODE) \
4957    ((MODE) != CCFPmode ? reverse_condition (CODE) \
4958     : reverse_condition_maybe_unordered (CODE))
4959 @end smallexample
4960
4961 @findex REVERSE_CONDEXEC_PREDICATES_P
4962 @item REVERSE_CONDEXEC_PREDICATES_P (@var{code1}, @var{code2})
4963 A C expression that returns true if the conditional execution predicate
4964 @var{code1} is the inverse of @var{code2} and vice versa.  Define this to
4965 return 0 if the target has conditional execution predicates that cannot be
4966 reversed safely.  If no expansion is specified, this macro is defined as
4967 follows:
4968
4969 @smallexample
4970 #define REVERSE_CONDEXEC_PREDICATES_P (x, y) ((x) == reverse_condition (y))
4971 @end smallexample
4972
4973 @end table
4974
4975 @node Costs
4976 @section Describing Relative Costs of Operations
4977 @cindex costs of instructions
4978 @cindex relative costs
4979 @cindex speed of instructions
4980
4981 These macros let you describe the relative speed of various operations
4982 on the target machine.
4983
4984 @table @code
4985 @findex CONST_COSTS
4986 @item CONST_COSTS (@var{x}, @var{code}, @var{outer_code})
4987 A part of a C @code{switch} statement that describes the relative costs
4988 of constant RTL expressions.  It must contain @code{case} labels for
4989 expression codes @code{const_int}, @code{const}, @code{symbol_ref},
4990 @code{label_ref} and @code{const_double}.  Each case must ultimately
4991 reach a @code{return} statement to return the relative cost of the use
4992 of that kind of constant value in an expression.  The cost may depend on
4993 the precise value of the constant, which is available for examination in
4994 @var{x}, and the rtx code of the expression in which it is contained,
4995 found in @var{outer_code}.
4996
4997 @var{code} is the expression code---redundant, since it can be
4998 obtained with @code{GET_CODE (@var{x})}.
4999
5000 @findex RTX_COSTS
5001 @findex COSTS_N_INSNS
5002 @item RTX_COSTS (@var{x}, @var{code}, @var{outer_code})
5003 Like @code{CONST_COSTS} but applies to nonconstant RTL expressions.
5004 This can be used, for example, to indicate how costly a multiply
5005 instruction is.  In writing this macro, you can use the construct
5006 @code{COSTS_N_INSNS (@var{n})} to specify a cost equal to @var{n} fast
5007 instructions.  @var{outer_code} is the code of the expression in which
5008 @var{x} is contained.
5009
5010 This macro is optional; do not define it if the default cost assumptions
5011 are adequate for the target machine.
5012
5013 @findex DEFAULT_RTX_COSTS
5014 @item DEFAULT_RTX_COSTS (@var{x}, @var{code}, @var{outer_code})
5015 This macro, if defined, is called for any case not handled by the
5016 @code{RTX_COSTS} or @code{CONST_COSTS} macros.  This eliminates the need
5017 to put case labels into the macro, but the code, or any functions it
5018 calls, must assume that the RTL in @var{x} could be of any type that has
5019 not already been handled.  The arguments are the same as for
5020 @code{RTX_COSTS}, and the macro should execute a return statement giving
5021 the cost of any RTL expressions that it can handle.  The default cost
5022 calculation is used for any RTL for which this macro does not return a
5023 value.
5024
5025 This macro is optional; do not define it if the default cost assumptions
5026 are adequate for the target machine.
5027
5028 @findex ADDRESS_COST
5029 @item ADDRESS_COST (@var{address})
5030 An expression giving the cost of an addressing mode that contains
5031 @var{address}.  If not defined, the cost is computed from
5032 the @var{address} expression and the @code{CONST_COSTS} values.
5033
5034 For most CISC machines, the default cost is a good approximation of the
5035 true cost of the addressing mode.  However, on RISC machines, all
5036 instructions normally have the same length and execution time.  Hence
5037 all addresses will have equal costs.
5038
5039 In cases where more than one form of an address is known, the form with
5040 the lowest cost will be used.  If multiple forms have the same, lowest,
5041 cost, the one that is the most complex will be used.
5042
5043 For example, suppose an address that is equal to the sum of a register
5044 and a constant is used twice in the same basic block.  When this macro
5045 is not defined, the address will be computed in a register and memory
5046 references will be indirect through that register.  On machines where
5047 the cost of the addressing mode containing the sum is no higher than
5048 that of a simple indirect reference, this will produce an additional
5049 instruction and possibly require an additional register.  Proper
5050 specification of this macro eliminates this overhead for such machines.
5051
5052 Similar use of this macro is made in strength reduction of loops.
5053
5054 @var{address} need not be valid as an address.  In such a case, the cost
5055 is not relevant and can be any value; invalid addresses need not be
5056 assigned a different cost.
5057
5058 On machines where an address involving more than one register is as
5059 cheap as an address computation involving only one register, defining
5060 @code{ADDRESS_COST} to reflect this can cause two registers to be live
5061 over a region of code where only one would have been if
5062 @code{ADDRESS_COST} were not defined in that manner.  This effect should
5063 be considered in the definition of this macro.  Equivalent costs should
5064 probably only be given to addresses with different numbers of registers
5065 on machines with lots of registers.
5066
5067 This macro will normally either not be defined or be defined as a
5068 constant.
5069
5070 @findex REGISTER_MOVE_COST
5071 @item REGISTER_MOVE_COST (@var{mode}, @var{from}, @var{to})
5072 A C expression for the cost of moving data of mode @var{mode} from a
5073 register in class @var{from} to one in class @var{to}.  The classes are
5074 expressed using the enumeration values such as @code{GENERAL_REGS}.  A
5075 value of 2 is the default; other values are interpreted relative to
5076 that.
5077
5078 It is not required that the cost always equal 2 when @var{from} is the
5079 same as @var{to}; on some machines it is expensive to move between
5080 registers if they are not general registers.
5081
5082 If reload sees an insn consisting of a single @code{set} between two
5083 hard registers, and if @code{REGISTER_MOVE_COST} applied to their
5084 classes returns a value of 2, reload does not check to ensure that the
5085 constraints of the insn are met.  Setting a cost of other than 2 will
5086 allow reload to verify that the constraints are met.  You should do this
5087 if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
5088
5089 @findex MEMORY_MOVE_COST
5090 @item MEMORY_MOVE_COST (@var{mode}, @var{class}, @var{in})
5091 A C expression for the cost of moving data of mode @var{mode} between a
5092 register of class @var{class} and memory; @var{in} is zero if the value
5093 is to be written to memory, non-zero if it is to be read in.  This cost
5094 is relative to those in @code{REGISTER_MOVE_COST}.  If moving between
5095 registers and memory is more expensive than between two registers, you
5096 should define this macro to express the relative cost.
5097
5098 If you do not define this macro, GCC uses a default cost of 4 plus
5099 the cost of copying via a secondary reload register, if one is
5100 needed.  If your machine requires a secondary reload register to copy
5101 between memory and a register of @var{class} but the reload mechanism is
5102 more complex than copying via an intermediate, define this macro to
5103 reflect the actual cost of the move.
5104
5105 GCC defines the function @code{memory_move_secondary_cost} if
5106 secondary reloads are needed.  It computes the costs due to copying via
5107 a secondary register.  If your machine copies from memory using a
5108 secondary register in the conventional way but the default base value of
5109 4 is not correct for your machine, define this macro to add some other
5110 value to the result of that function.  The arguments to that function
5111 are the same as to this macro.
5112
5113 @findex BRANCH_COST
5114 @item BRANCH_COST
5115 A C expression for the cost of a branch instruction.  A value of 1 is
5116 the default; other values are interpreted relative to that.
5117 @end table
5118
5119 Here are additional macros which do not specify precise relative costs,
5120 but only that certain actions are more expensive than GCC would
5121 ordinarily expect.
5122
5123 @table @code
5124 @findex SLOW_BYTE_ACCESS
5125 @item SLOW_BYTE_ACCESS
5126 Define this macro as a C expression which is nonzero if accessing less
5127 than a word of memory (i.e. a @code{char} or a @code{short}) is no
5128 faster than accessing a word of memory, i.e., if such access
5129 require more than one instruction or if there is no difference in cost
5130 between byte and (aligned) word loads.
5131
5132 When this macro is not defined, the compiler will access a field by
5133 finding the smallest containing object; when it is defined, a fullword
5134 load will be used if alignment permits.  Unless bytes accesses are
5135 faster than word accesses, using word accesses is preferable since it
5136 may eliminate subsequent memory access if subsequent accesses occur to
5137 other fields in the same word of the structure, but to different bytes.
5138
5139 @findex SLOW_ZERO_EXTEND
5140 @item SLOW_ZERO_EXTEND
5141 Define this macro if zero-extension (of a @code{char} or @code{short}
5142 to an @code{int}) can be done faster if the destination is a register
5143 that is known to be zero.
5144
5145 If you define this macro, you must have instruction patterns that
5146 recognize RTL structures like this:
5147
5148 @smallexample
5149 (set (strict_low_part (subreg:QI (reg:SI @dots{}) 0)) @dots{})
5150 @end smallexample
5151
5152 @noindent
5153 and likewise for @code{HImode}.
5154
5155 @findex SLOW_UNALIGNED_ACCESS
5156 @item SLOW_UNALIGNED_ACCESS (@var{mode}, @var{alignment})
5157 Define this macro to be the value 1 if memory accesses described by the
5158 @var{mode} and @var{alignment} parameters have a cost many times greater
5159 than aligned accesses, for example if they are emulated in a trap
5160 handler.
5161
5162 When this macro is non-zero, the compiler will act as if
5163 @code{STRICT_ALIGNMENT} were non-zero when generating code for block
5164 moves.  This can cause significantly more instructions to be produced.
5165 Therefore, do not set this macro non-zero if unaligned accesses only add a
5166 cycle or two to the time for a memory access.
5167
5168 If the value of this macro is always zero, it need not be defined.  If
5169 this macro is defined, it should produce a non-zero value when
5170 @code{STRICT_ALIGNMENT} is non-zero.
5171
5172 @findex DONT_REDUCE_ADDR
5173 @item DONT_REDUCE_ADDR
5174 Define this macro to inhibit strength reduction of memory addresses.
5175 (On some machines, such strength reduction seems to do harm rather
5176 than good.)
5177
5178 @findex MOVE_RATIO
5179 @item MOVE_RATIO
5180 The threshold of number of scalar memory-to-memory move insns, @emph{below}
5181 which a sequence of insns should be generated instead of a
5182 string move insn or a library call.  Increasing the value will always
5183 make code faster, but eventually incurs high cost in increased code size.
5184
5185 Note that on machines where the corresponding move insn is a
5186 @code{define_expand} that emits a sequence of insns, this macro counts
5187 the number of such sequences.
5188
5189 If you don't define this, a reasonable default is used.
5190
5191 @findex MOVE_BY_PIECES_P
5192 @item MOVE_BY_PIECES_P (@var{size}, @var{alignment})
5193 A C expression used to determine whether @code{move_by_pieces} will be used to
5194 copy a chunk of memory, or whether some other block move mechanism
5195 will be used.  Defaults to 1 if @code{move_by_pieces_ninsns} returns less
5196 than @code{MOVE_RATIO}.
5197
5198 @findex MOVE_MAX_PIECES
5199 @item MOVE_MAX_PIECES
5200 A C expression used by @code{move_by_pieces} to determine the largest unit
5201 a load or store used to copy memory is.  Defaults to @code{MOVE_MAX}.
5202
5203 @findex USE_LOAD_POST_INCREMENT
5204 @item USE_LOAD_POST_INCREMENT (@var{mode})
5205 A C expression used to determine whether a load postincrement is a good
5206 thing to use for a given mode.  Defaults to the value of
5207 @code{HAVE_POST_INCREMENT}.
5208
5209 @findex USE_LOAD_POST_DECREMENT
5210 @item USE_LOAD_POST_DECREMENT (@var{mode})
5211 A C expression used to determine whether a load postdecrement is a good
5212 thing to use for a given mode.  Defaults to the value of
5213 @code{HAVE_POST_DECREMENT}.
5214
5215 @findex USE_LOAD_PRE_INCREMENT
5216 @item USE_LOAD_PRE_INCREMENT (@var{mode})
5217 A C expression used to determine whether a load preincrement is a good
5218 thing to use for a given mode.  Defaults to the value of
5219 @code{HAVE_PRE_INCREMENT}.
5220
5221 @findex USE_LOAD_PRE_DECREMENT
5222 @item USE_LOAD_PRE_DECREMENT (@var{mode})
5223 A C expression used to determine whether a load predecrement is a good
5224 thing to use for a given mode.  Defaults to the value of
5225 @code{HAVE_PRE_DECREMENT}.
5226
5227 @findex USE_STORE_POST_INCREMENT
5228 @item USE_STORE_POST_INCREMENT (@var{mode})
5229 A C expression used to determine whether a store postincrement is a good
5230 thing to use for a given mode.  Defaults to the value of
5231 @code{HAVE_POST_INCREMENT}.
5232
5233 @findex USE_STORE_POST_DECREMENT
5234 @item USE_STORE_POST_DECREMENT (@var{mode})
5235 A C expression used to determine whether a store postdecrement is a good
5236 thing to use for a given mode.  Defaults to the value of
5237 @code{HAVE_POST_DECREMENT}.
5238
5239 @findex USE_STORE_PRE_INCREMENT
5240 @item USE_STORE_PRE_INCREMENT (@var{mode})
5241 This macro is used to determine whether a store preincrement is a good
5242 thing to use for a given mode.  Defaults to the value of
5243 @code{HAVE_PRE_INCREMENT}.
5244
5245 @findex USE_STORE_PRE_DECREMENT
5246 @item USE_STORE_PRE_DECREMENT (@var{mode})
5247 This macro is used to determine whether a store predecrement is a good
5248 thing to use for a given mode.  Defaults to the value of
5249 @code{HAVE_PRE_DECREMENT}.
5250
5251 @findex NO_FUNCTION_CSE
5252 @item NO_FUNCTION_CSE
5253 Define this macro if it is as good or better to call a constant
5254 function address than to call an address kept in a register.
5255
5256 @findex NO_RECURSIVE_FUNCTION_CSE
5257 @item NO_RECURSIVE_FUNCTION_CSE
5258 Define this macro if it is as good or better for a function to call
5259 itself with an explicit address than to call an address kept in a
5260 register.
5261
5262 @findex ADJUST_COST
5263 @item ADJUST_COST (@var{insn}, @var{link}, @var{dep_insn}, @var{cost})
5264 A C statement (sans semicolon) to update the integer variable @var{cost}
5265 based on the relationship between @var{insn} that is dependent on
5266 @var{dep_insn} through the dependence @var{link}.  The default is to
5267 make no adjustment to @var{cost}.  This can be used for example to
5268 specify to the scheduler that an output- or anti-dependence does not
5269 incur the same cost as a data-dependence.
5270
5271 @findex ADJUST_PRIORITY
5272 @item ADJUST_PRIORITY (@var{insn})
5273 A C statement (sans semicolon) to update the integer scheduling
5274 priority @code{INSN_PRIORITY(@var{insn})}.  Reduce the priority
5275 to execute the @var{insn} earlier, increase the priority to execute
5276 @var{insn} later.    Do not define this macro if you do not need to
5277 adjust the scheduling priorities of insns.
5278 @end table
5279
5280 @node Sections
5281 @section Dividing the Output into Sections (Texts, Data, @dots{})
5282 @c the above section title is WAY too long.  maybe cut the part between
5283 @c the (...)?  --mew 10feb93
5284
5285 An object file is divided into sections containing different types of
5286 data.  In the most common case, there are three sections: the @dfn{text
5287 section}, which holds instructions and read-only data; the @dfn{data
5288 section}, which holds initialized writable data; and the @dfn{bss
5289 section}, which holds uninitialized data.  Some systems have other kinds
5290 of sections.
5291
5292 The compiler must tell the assembler when to switch sections.  These
5293 macros control what commands to output to tell the assembler this.  You
5294 can also define additional sections.
5295
5296 @table @code
5297 @findex TEXT_SECTION_ASM_OP
5298 @item TEXT_SECTION_ASM_OP
5299 A C expression whose value is a string, including spacing, containing the
5300 assembler operation that should precede instructions and read-only data.
5301 Normally @code{"\t.text"} is right.
5302
5303 @findex DATA_SECTION_ASM_OP
5304 @item DATA_SECTION_ASM_OP
5305 A C expression whose value is a string, including spacing, containing the
5306 assembler operation to identify the following data as writable initialized
5307 data.  Normally @code{"\t.data"} is right.
5308
5309 @findex SHARED_SECTION_ASM_OP
5310 @item SHARED_SECTION_ASM_OP
5311 If defined, a C expression whose value is a string, including spacing,
5312 containing the assembler operation to identify the following data as
5313 shared data.  If not defined, @code{DATA_SECTION_ASM_OP} will be used.
5314
5315 @findex BSS_SECTION_ASM_OP
5316 @item BSS_SECTION_ASM_OP
5317 If defined, a C expression whose value is a string, including spacing,
5318 containing the assembler operation to identify the following data as
5319 uninitialized global data.  If not defined, and neither
5320 @code{ASM_OUTPUT_BSS} nor @code{ASM_OUTPUT_ALIGNED_BSS} are defined,
5321 uninitialized global data will be output in the data section if
5322 @option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
5323 used.
5324
5325 @findex SHARED_BSS_SECTION_ASM_OP
5326 @item SHARED_BSS_SECTION_ASM_OP
5327 If defined, a C expression whose value is a string, including spacing,
5328 containing the assembler operation to identify the following data as
5329 uninitialized global shared data.  If not defined, and
5330 @code{BSS_SECTION_ASM_OP} is, the latter will be used.
5331
5332 @findex INIT_SECTION_ASM_OP
5333 @item INIT_SECTION_ASM_OP
5334 If defined, a C expression whose value is a string, including spacing,
5335 containing the assembler operation to identify the following data as
5336 initialization code.  If not defined, GCC will assume such a section does
5337 not exist.
5338
5339 @findex FINI_SECTION_ASM_OP
5340 @item FINI_SECTION_ASM_OP
5341 If defined, a C expression whose value is a string, including spacing,
5342 containing the assembler operation to identify the following data as
5343 finalization code.  If not defined, GCC will assume such a section does
5344 not exist.
5345
5346 @findex CRT_CALL_STATIC_FUNCTION
5347 @item CRT_CALL_STATIC_FUNCTION
5348 If defined, a C statement that calls the function named as the sole
5349 argument of this macro.  This is used in @file{crtstuff.c} if
5350 @code{INIT_SECTION_ASM_OP} or @code{FINI_SECTION_ASM_OP} to calls to
5351 initialization and finalization functions from the init and fini
5352 sections. By default, this macro is a simple function call.  Some
5353 ports need hand-crafted assembly code to avoid dependencies on
5354 registers initialized in the function prologue or to ensure that
5355 constant pools don't end up too far way in the text section.
5356
5357 @findex EXTRA_SECTIONS
5358 @findex in_text
5359 @findex in_data
5360 @item EXTRA_SECTIONS
5361 A list of names for sections other than the standard two, which are
5362 @code{in_text} and @code{in_data}.  You need not define this macro
5363 on a system with no other sections (that GCC needs to use).
5364
5365 @findex EXTRA_SECTION_FUNCTIONS
5366 @findex text_section
5367 @findex data_section
5368 @item EXTRA_SECTION_FUNCTIONS
5369 One or more functions to be defined in @file{varasm.c}.  These
5370 functions should do jobs analogous to those of @code{text_section} and
5371 @code{data_section}, for your additional sections.  Do not define this
5372 macro if you do not define @code{EXTRA_SECTIONS}.
5373
5374 @findex READONLY_DATA_SECTION
5375 @item READONLY_DATA_SECTION
5376 On most machines, read-only variables, constants, and jump tables are
5377 placed in the text section.  If this is not the case on your machine,
5378 this macro should be defined to be the name of a function (either
5379 @code{data_section} or a function defined in @code{EXTRA_SECTIONS}) that
5380 switches to the section to be used for read-only items.
5381
5382 If these items should be placed in the text section, this macro should
5383 not be defined.
5384
5385 @findex SELECT_SECTION
5386 @item SELECT_SECTION (@var{exp}, @var{reloc})
5387 A C statement or statements to switch to the appropriate section for
5388 output of @var{exp}.  You can assume that @var{exp} is either a
5389 @code{VAR_DECL} node or a constant of some sort.  @var{reloc}
5390 indicates whether the initial value of @var{exp} requires link-time
5391 relocations.  Select the section by calling @code{text_section} or one
5392 of the alternatives for other sections.
5393
5394 Do not define this macro if you put all read-only variables and
5395 constants in the read-only data section (usually the text section).
5396
5397 @findex SELECT_RTX_SECTION
5398 @item SELECT_RTX_SECTION (@var{mode}, @var{rtx})
5399 A C statement or statements to switch to the appropriate section for
5400 output of @var{rtx} in mode @var{mode}.  You can assume that @var{rtx}
5401 is some kind of constant in RTL.  The argument @var{mode} is redundant
5402 except in the case of a @code{const_int} rtx.  Select the section by
5403 calling @code{text_section} or one of the alternatives for other
5404 sections.
5405
5406 Do not define this macro if you put all constants in the read-only
5407 data section.
5408
5409 @findex JUMP_TABLES_IN_TEXT_SECTION
5410 @item JUMP_TABLES_IN_TEXT_SECTION
5411 Define this macro to be an expression with a non-zero value if jump
5412 tables (for @code{tablejump} insns) should be output in the text
5413 section, along with the assembler instructions.  Otherwise, the
5414 readonly data section is used.
5415
5416 This macro is irrelevant if there is no separate readonly data section.
5417
5418 @findex ENCODE_SECTION_INFO
5419 @item ENCODE_SECTION_INFO (@var{decl})
5420 Define this macro if references to a symbol must be treated differently
5421 depending on something about the variable or function named by the
5422 symbol (such as what section it is in).
5423
5424 The macro definition, if any, is executed immediately after the rtl for
5425 @var{decl} has been created and stored in @code{DECL_RTL (@var{decl})}.
5426 The value of the rtl will be a @code{mem} whose address is a
5427 @code{symbol_ref}.
5428
5429 @cindex @code{SYMBOL_REF_FLAG}, in @code{ENCODE_SECTION_INFO}
5430 The usual thing for this macro to do is to record a flag in the
5431 @code{symbol_ref} (such as @code{SYMBOL_REF_FLAG}) or to store a
5432 modified name string in the @code{symbol_ref} (if one bit is not enough
5433 information).
5434
5435 @findex STRIP_NAME_ENCODING
5436 @item STRIP_NAME_ENCODING (@var{var}, @var{sym_name})
5437 Decode @var{sym_name} and store the real name part in @var{var}, sans
5438 the characters that encode section info.  Define this macro if
5439 @code{ENCODE_SECTION_INFO} alters the symbol's name string.
5440
5441 @findex UNIQUE_SECTION_P
5442 @item UNIQUE_SECTION_P (@var{decl})
5443 A C expression which evaluates to true if @var{decl} should be placed
5444 into a unique section for some target-specific reason.  If you do not
5445 define this macro, the default is @samp{0}.  Note that the flag
5446 @option{-ffunction-sections} will also cause functions to be placed into
5447 unique sections.
5448
5449 @findex UNIQUE_SECTION
5450 @item UNIQUE_SECTION (@var{decl}, @var{reloc})
5451 A C statement to build up a unique section name, expressed as a
5452 STRING_CST node, and assign it to @samp{DECL_SECTION_NAME (@var{decl})}.
5453 @var{reloc} indicates whether the initial value of @var{exp} requires
5454 link-time relocations.  If you do not define this macro, GCC will use
5455 the symbol name prefixed by @samp{.} as the section name.  Note - this
5456 macro can now be called for uninitialised data items as well as
5457 initialised data and functions.
5458 @end table
5459
5460 @node PIC
5461 @section Position Independent Code
5462 @cindex position independent code
5463 @cindex PIC
5464
5465 This section describes macros that help implement generation of position
5466 independent code.  Simply defining these macros is not enough to
5467 generate valid PIC; you must also add support to the macros
5468 @code{GO_IF_LEGITIMATE_ADDRESS} and @code{PRINT_OPERAND_ADDRESS}, as
5469 well as @code{LEGITIMIZE_ADDRESS}.  You must modify the definition of
5470 @samp{movsi} to do something appropriate when the source operand
5471 contains a symbolic address.  You may also need to alter the handling of
5472 switch statements so that they use relative addresses.
5473 @c i rearranged the order of the macros above to try to force one of
5474 @c them to the next line, to eliminate an overfull hbox. --mew 10feb93
5475
5476 @table @code
5477 @findex PIC_OFFSET_TABLE_REGNUM
5478 @item PIC_OFFSET_TABLE_REGNUM
5479 The register number of the register used to address a table of static
5480 data addresses in memory.  In some cases this register is defined by a
5481 processor's ``application binary interface'' (ABI).  When this macro
5482 is defined, RTL is generated for this register once, as with the stack
5483 pointer and frame pointer registers.  If this macro is not defined, it
5484 is up to the machine-dependent files to allocate such a register (if
5485 necessary).
5486
5487 @findex PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
5488 @item PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
5489 Define this macro if the register defined by
5490 @code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls.  Do not define
5491 this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined.
5492
5493 @findex FINALIZE_PIC
5494 @item FINALIZE_PIC
5495 By generating position-independent code, when two different programs (A
5496 and B) share a common library (libC.a), the text of the library can be
5497 shared whether or not the library is linked at the same address for both
5498 programs.  In some of these environments, position-independent code
5499 requires not only the use of different addressing modes, but also
5500 special code to enable the use of these addressing modes.
5501
5502 The @code{FINALIZE_PIC} macro serves as a hook to emit these special
5503 codes once the function is being compiled into assembly code, but not
5504 before.  (It is not done before, because in the case of compiling an
5505 inline function, it would lead to multiple PIC prologues being
5506 included in functions which used inline functions and were compiled to
5507 assembly language.)
5508
5509 @findex LEGITIMATE_PIC_OPERAND_P
5510 @item LEGITIMATE_PIC_OPERAND_P (@var{x})
5511 A C expression that is nonzero if @var{x} is a legitimate immediate
5512 operand on the target machine when generating position independent code.
5513 You can assume that @var{x} satisfies @code{CONSTANT_P}, so you need not
5514 check this.  You can also assume @var{flag_pic} is true, so you need not
5515 check it either.  You need not define this macro if all constants
5516 (including @code{SYMBOL_REF}) can be immediate operands when generating
5517 position independent code.
5518 @end table
5519
5520 @node Assembler Format
5521 @section Defining the Output Assembler Language
5522
5523 This section describes macros whose principal purpose is to describe how
5524 to write instructions in assembler language--rather than what the
5525 instructions do.
5526
5527 @menu
5528 * File Framework::       Structural information for the assembler file.
5529 * Data Output::          Output of constants (numbers, strings, addresses).
5530 * Uninitialized Data::   Output of uninitialized variables.
5531 * Label Output::         Output and generation of labels.
5532 * Initialization::       General principles of initialization
5533                            and termination routines.
5534 * Macros for Initialization::
5535                          Specific macros that control the handling of
5536                            initialization and termination routines.
5537 * Instruction Output::   Output of actual instructions.
5538 * Dispatch Tables::      Output of jump tables.
5539 * Exception Region Output:: Output of exception region code.
5540 * Alignment Output::     Pseudo ops for alignment and skipping data.
5541 @end menu
5542
5543 @node File Framework
5544 @subsection The Overall Framework of an Assembler File
5545 @cindex assembler format
5546 @cindex output of assembler code
5547
5548 @c prevent bad page break with this line
5549 This describes the overall framework of an assembler file.
5550
5551 @table @code
5552 @findex ASM_FILE_START
5553 @item ASM_FILE_START (@var{stream})
5554 A C expression which outputs to the stdio stream @var{stream}
5555 some appropriate text to go at the start of an assembler file.
5556
5557 Normally this macro is defined to output a line containing
5558 @samp{#NO_APP}, which is a comment that has no effect on most
5559 assemblers but tells the GNU assembler that it can save time by not
5560 checking for certain assembler constructs.
5561
5562 On systems that use SDB, it is necessary to output certain commands;
5563 see @file{attasm.h}.
5564
5565 @findex ASM_FILE_END
5566 @item ASM_FILE_END (@var{stream})
5567 A C expression which outputs to the stdio stream @var{stream}
5568 some appropriate text to go at the end of an assembler file.
5569
5570 If this macro is not defined, the default is to output nothing
5571 special at the end of the file.  Most systems don't require any
5572 definition.
5573
5574 On systems that use SDB, it is necessary to output certain commands;
5575 see @file{attasm.h}.
5576
5577 @findex ASM_COMMENT_START
5578 @item ASM_COMMENT_START
5579 A C string constant describing how to begin a comment in the target
5580 assembler language.  The compiler assumes that the comment will end at
5581 the end of the line.
5582
5583 @findex ASM_APP_ON
5584 @item ASM_APP_ON
5585 A C string constant for text to be output before each @code{asm}
5586 statement or group of consecutive ones.  Normally this is
5587 @code{"#APP"}, which is a comment that has no effect on most
5588 assemblers but tells the GNU assembler that it must check the lines
5589 that follow for all valid assembler constructs.
5590
5591 @findex ASM_APP_OFF
5592 @item ASM_APP_OFF
5593 A C string constant for text to be output after each @code{asm}
5594 statement or group of consecutive ones.  Normally this is
5595 @code{"#NO_APP"}, which tells the GNU assembler to resume making the
5596 time-saving assumptions that are valid for ordinary compiler output.
5597
5598 @findex ASM_OUTPUT_SOURCE_FILENAME
5599 @item ASM_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
5600 A C statement to output COFF information or DWARF debugging information
5601 which indicates that filename @var{name} is the current source file to
5602 the stdio stream @var{stream}.
5603
5604 This macro need not be defined if the standard form of output
5605 for the file format in use is appropriate.
5606
5607 @findex OUTPUT_QUOTED_STRING
5608 @item OUTPUT_QUOTED_STRING (@var{stream}, @var{string})
5609 A C statement to output the string @var{string} to the stdio stream
5610 @var{stream}.  If you do not call the function @code{output_quoted_string}
5611 in your config files, GCC will only call it to output filenames to
5612 the assembler source.  So you can use it to canonicalize the format
5613 of the filename using this macro.
5614
5615 @findex ASM_OUTPUT_SOURCE_LINE
5616 @item ASM_OUTPUT_SOURCE_LINE (@var{stream}, @var{line})
5617 A C statement to output DBX or SDB debugging information before code
5618 for line number @var{line} of the current source file to the
5619 stdio stream @var{stream}.
5620
5621 This macro need not be defined if the standard form of debugging
5622 information for the debugger in use is appropriate.
5623
5624 @findex ASM_OUTPUT_IDENT
5625 @item ASM_OUTPUT_IDENT (@var{stream}, @var{string})
5626 A C statement to output something to the assembler file to handle a
5627 @samp{#ident} directive containing the text @var{string}.  If this
5628 macro is not defined, nothing is output for a @samp{#ident} directive.
5629
5630 @findex ASM_OUTPUT_SECTION_NAME
5631 @item ASM_OUTPUT_SECTION_NAME (@var{stream}, @var{decl}, @var{name}, @var{reloc})
5632 A C statement to output something to the assembler file to switch to section
5633 @var{name} for object @var{decl} which is either a @code{FUNCTION_DECL}, a
5634 @code{VAR_DECL} or @code{NULL_TREE}.  @var{reloc}
5635 indicates whether the initial value of @var{exp} requires link-time
5636 relocations.  The string given by @var{name} will always be the
5637 canonical version stored in the global stringpool.
5638
5639 Some target formats do not support arbitrary sections.  Do not define
5640 this macro in such cases.
5641
5642 At present this macro is only used to support section attributes.
5643 When this macro is undefined, section attributes are disabled.
5644
5645 @findex OBJC_PROLOGUE
5646 @item OBJC_PROLOGUE
5647 A C statement to output any assembler statements which are required to
5648 precede any Objective C object definitions or message sending.  The
5649 statement is executed only when compiling an Objective C program.
5650 @end table
5651
5652 @need 2000
5653 @node Data Output
5654 @subsection Output of Data
5655
5656 @c prevent bad page break with this line
5657 This describes data output.
5658
5659 @table @code
5660 @findex ASM_OUTPUT_LONG_DOUBLE
5661 @findex ASM_OUTPUT_DOUBLE
5662 @findex ASM_OUTPUT_FLOAT
5663 @item ASM_OUTPUT_LONG_DOUBLE (@var{stream}, @var{value})
5664 @itemx ASM_OUTPUT_DOUBLE (@var{stream}, @var{value})
5665 @itemx ASM_OUTPUT_FLOAT (@var{stream}, @var{value})
5666 @itemx ASM_OUTPUT_THREE_QUARTER_FLOAT (@var{stream}, @var{value})
5667 @itemx ASM_OUTPUT_SHORT_FLOAT (@var{stream}, @var{value})
5668 @itemx ASM_OUTPUT_BYTE_FLOAT (@var{stream}, @var{value})
5669 A C statement to output to the stdio stream @var{stream} an assembler
5670 instruction to assemble a floating-point constant of @code{TFmode},
5671 @code{DFmode}, @code{SFmode}, @code{TQFmode}, @code{HFmode}, or
5672 @code{QFmode}, respectively, whose value is @var{value}.  @var{value}
5673 will be a C expression of type @code{REAL_VALUE_TYPE}.  Macros such as
5674 @code{REAL_VALUE_TO_TARGET_DOUBLE} are useful for writing these
5675 definitions.
5676
5677 @findex ASM_OUTPUT_QUADRUPLE_INT
5678 @findex ASM_OUTPUT_DOUBLE_INT
5679 @findex ASM_OUTPUT_INT
5680 @findex ASM_OUTPUT_SHORT
5681 @findex ASM_OUTPUT_CHAR
5682 @findex output_addr_const
5683 @item ASM_OUTPUT_QUADRUPLE_INT (@var{stream}, @var{exp})
5684 @itemx ASM_OUTPUT_DOUBLE_INT (@var{stream}, @var{exp})
5685 @itemx ASM_OUTPUT_INT (@var{stream}, @var{exp})
5686 @itemx ASM_OUTPUT_SHORT (@var{stream}, @var{exp})
5687 @itemx ASM_OUTPUT_CHAR (@var{stream}, @var{exp})
5688 A C statement to output to the stdio stream @var{stream} an assembler
5689 instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
5690 respectively, whose value is @var{value}.  The argument @var{exp} will
5691 be an RTL expression which represents a constant value.  Use
5692 @samp{output_addr_const (@var{stream}, @var{exp})} to output this value
5693 as an assembler expression.@refill
5694
5695 For sizes larger than @code{UNITS_PER_WORD}, if the action of a macro
5696 would be identical to repeatedly calling the macro corresponding to
5697 a size of @code{UNITS_PER_WORD}, once for each word, you need not define
5698 the macro.
5699
5700 @findex OUTPUT_ADDR_CONST_EXTRA
5701 @item OUTPUT_ADDR_CONST_EXTRA (@var{stream}, @var{x}, @var{fail})
5702 A C statement to recognize @var{rtx} patterns that
5703 @code{output_addr_const} can't deal with, and output assembly code to
5704 @var{stream} corresponding to the pattern @var{x}.  This may be used to
5705 allow machine-dependent @code{UNSPEC}s to appear within constants.
5706
5707 If @code{OUTPUT_ADDR_CONST_EXTRA} fails to recognize a pattern, it must
5708 @code{goto fail}, so that a standard error message is printed.  If it
5709 prints an error message itself, by calling, for example,
5710 @code{output_operand_lossage}, it may just complete normally.
5711
5712 @findex ASM_OUTPUT_BYTE
5713 @item ASM_OUTPUT_BYTE (@var{stream}, @var{value})
5714 A C statement to output to the stdio stream @var{stream} an assembler
5715 instruction to assemble a single byte containing the number @var{value}.
5716
5717 @findex ASM_BYTE_OP
5718 @item ASM_BYTE_OP
5719 A C string constant, including spacing, giving the pseudo-op to use for a
5720 sequence of single-byte constants.  If this macro is not defined, the
5721 default is @code{"\t.byte\t"}.
5722
5723 @findex UNALIGNED_SHORT_ASM_OP
5724 @findex UNALIGNED_INT_ASM_OP
5725 @findex UNALIGNED_DOUBLE_INT_ASM_OP
5726 @item UNALIGNED_SHORT_ASM_OP
5727 @itemx UNALIGNED_INT_ASM_OP
5728 @itemx UNALIGNED_DOUBLE_INT_ASM_OP
5729 A C string constant, including spacing, giving the pseudo-op to use
5730 to assemble 16-, 32-, and 64-bit integers respectively @emph{without}
5731 adding implicit padding or alignment.  These macros are required if
5732 DWARF 2 frame unwind is used.  On ELF systems, these will default
5733 to @code{.2byte}, @code{.4byte}, and @code{.8byte}.@refill
5734
5735 @findex ASM_OUTPUT_ASCII
5736 @item ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len})
5737 A C statement to output to the stdio stream @var{stream} an assembler
5738 instruction to assemble a string constant containing the @var{len}
5739 bytes at @var{ptr}.  @var{ptr} will be a C expression of type
5740 @code{char *} and @var{len} a C expression of type @code{int}.
5741
5742 If the assembler has a @code{.ascii} pseudo-op as found in the
5743 Berkeley Unix assembler, do not define the macro
5744 @code{ASM_OUTPUT_ASCII}.
5745
5746 @findex CONSTANT_POOL_BEFORE_FUNCTION
5747 @item CONSTANT_POOL_BEFORE_FUNCTION
5748 You may define this macro as a C expression.  You should define the
5749 expression to have a non-zero value if GCC should output the constant
5750 pool for a function before the code for the function, or a zero value if
5751 GCC should output the constant pool after the function.  If you do
5752 not define this macro, the usual case, GCC will output the constant
5753 pool before the function.
5754
5755 @findex ASM_OUTPUT_POOL_PROLOGUE
5756 @item ASM_OUTPUT_POOL_PROLOGUE (@var{file}, @var{funname}, @var{fundecl}, @var{size})
5757 A C statement to output assembler commands to define the start of the
5758 constant pool for a function.  @var{funname} is a string giving
5759 the name of the function.  Should the return type of the function
5760 be required, it can be obtained via @var{fundecl}.  @var{size}
5761 is the size, in bytes, of the constant pool that will be written
5762 immediately after this call.
5763
5764 If no constant-pool prefix is required, the usual case, this macro need
5765 not be defined.
5766
5767 @findex ASM_OUTPUT_SPECIAL_POOL_ENTRY
5768 @item ASM_OUTPUT_SPECIAL_POOL_ENTRY (@var{file}, @var{x}, @var{mode}, @var{align}, @var{labelno}, @var{jumpto})
5769 A C statement (with or without semicolon) to output a constant in the
5770 constant pool, if it needs special treatment.  (This macro need not do
5771 anything for RTL expressions that can be output normally.)
5772
5773 The argument @var{file} is the standard I/O stream to output the
5774 assembler code on.  @var{x} is the RTL expression for the constant to
5775 output, and @var{mode} is the machine mode (in case @var{x} is a
5776 @samp{const_int}).  @var{align} is the required alignment for the value
5777 @var{x}; you should output an assembler directive to force this much
5778 alignment.
5779
5780 The argument @var{labelno} is a number to use in an internal label for
5781 the address of this pool entry.  The definition of this macro is
5782 responsible for outputting the label definition at the proper place.
5783 Here is how to do this:
5784
5785 @example
5786 ASM_OUTPUT_INTERNAL_LABEL (@var{file}, "LC", @var{labelno});
5787 @end example
5788
5789 When you output a pool entry specially, you should end with a
5790 @code{goto} to the label @var{jumpto}.  This will prevent the same pool
5791 entry from being output a second time in the usual manner.
5792
5793 You need not define this macro if it would do nothing.
5794
5795 @findex CONSTANT_AFTER_FUNCTION_P
5796 @item CONSTANT_AFTER_FUNCTION_P (@var{exp})
5797 Define this macro as a C expression which is nonzero if the constant
5798 @var{exp}, of type @code{tree}, should be output after the code for a
5799 function.  The compiler will normally output all constants before the
5800 function; you need not define this macro if this is OK.
5801
5802 @findex ASM_OUTPUT_POOL_EPILOGUE
5803 @item ASM_OUTPUT_POOL_EPILOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
5804 A C statement to output assembler commands to at the end of the constant
5805 pool for a function.  @var{funname} is a string giving the name of the
5806 function.  Should the return type of the function be required, you can
5807 obtain it via @var{fundecl}.  @var{size} is the size, in bytes, of the
5808 constant pool that GCC wrote immediately before this call.
5809
5810 If no constant-pool epilogue is required, the usual case, you need not
5811 define this macro.
5812
5813 @findex IS_ASM_LOGICAL_LINE_SEPARATOR
5814 @item IS_ASM_LOGICAL_LINE_SEPARATOR (@var{C})
5815 Define this macro as a C expression which is nonzero if @var{C} is
5816 used as a logical line separator by the assembler.
5817
5818 If you do not define this macro, the default is that only
5819 the character @samp{;} is treated as a logical line separator.
5820
5821
5822 @findex ASM_OPEN_PAREN
5823 @findex ASM_CLOSE_PAREN
5824 @item ASM_OPEN_PAREN
5825 @itemx ASM_CLOSE_PAREN
5826 These macros are defined as C string constants, describing the syntax
5827 in the assembler for grouping arithmetic expressions.  The following
5828 definitions are correct for most assemblers:
5829
5830 @example
5831 #define ASM_OPEN_PAREN "("
5832 #define ASM_CLOSE_PAREN ")"
5833 @end example
5834 @end table
5835
5836   These macros are provided by @file{real.h} for writing the definitions
5837 of @code{ASM_OUTPUT_DOUBLE} and the like:
5838
5839 @table @code
5840 @item REAL_VALUE_TO_TARGET_SINGLE (@var{x}, @var{l})
5841 @itemx REAL_VALUE_TO_TARGET_DOUBLE (@var{x}, @var{l})
5842 @itemx REAL_VALUE_TO_TARGET_LONG_DOUBLE (@var{x}, @var{l})
5843 @findex REAL_VALUE_TO_TARGET_SINGLE
5844 @findex REAL_VALUE_TO_TARGET_DOUBLE
5845 @findex REAL_VALUE_TO_TARGET_LONG_DOUBLE
5846 These translate @var{x}, of type @code{REAL_VALUE_TYPE}, to the target's
5847 floating point representation, and store its bit pattern in the array of
5848 @code{long int} whose address is @var{l}.  The number of elements in the
5849 output array is determined by the size of the desired target floating
5850 point data type: 32 bits of it go in each @code{long int} array
5851 element.  Each array element holds 32 bits of the result, even if
5852 @code{long int} is wider than 32 bits on the host machine.
5853
5854 The array element values are designed so that you can print them out
5855 using @code{fprintf} in the order they should appear in the target
5856 machine's memory.
5857
5858 @item REAL_VALUE_TO_DECIMAL (@var{x}, @var{format}, @var{string})
5859 @findex REAL_VALUE_TO_DECIMAL
5860 This macro converts @var{x}, of type @code{REAL_VALUE_TYPE}, to a
5861 decimal number and stores it as a string into @var{string}.
5862 You must pass, as @var{string}, the address of a long enough block
5863 of space to hold the result.
5864
5865 The argument @var{format} is a @code{printf}-specification that serves
5866 as a suggestion for how to format the output string.
5867 @end table
5868
5869 @node Uninitialized Data
5870 @subsection Output of Uninitialized Variables
5871
5872 Each of the macros in this section is used to do the whole job of
5873 outputting a single uninitialized variable.
5874
5875 @table @code
5876 @findex ASM_OUTPUT_COMMON
5877 @item ASM_OUTPUT_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
5878 A C statement (sans semicolon) to output to the stdio stream
5879 @var{stream} the assembler definition of a common-label named
5880 @var{name} whose size is @var{size} bytes.  The variable @var{rounded}
5881 is the size rounded up to whatever alignment the caller wants.
5882
5883 Use the expression @code{assemble_name (@var{stream}, @var{name})} to
5884 output the name itself; before and after that, output the additional
5885 assembler syntax for defining the name, and a newline.
5886
5887 This macro controls how the assembler definitions of uninitialized
5888 common global variables are output.
5889
5890 @findex ASM_OUTPUT_ALIGNED_COMMON
5891 @item ASM_OUTPUT_ALIGNED_COMMON (@var{stream}, @var{name}, @var{size}, @var{alignment})
5892 Like @code{ASM_OUTPUT_COMMON} except takes the required alignment as a
5893 separate, explicit argument.  If you define this macro, it is used in
5894 place of @code{ASM_OUTPUT_COMMON}, and gives you more flexibility in
5895 handling the required alignment of the variable.  The alignment is specified
5896 as the number of bits.
5897
5898 @findex ASM_OUTPUT_ALIGNED_DECL_COMMON
5899 @item ASM_OUTPUT_ALIGNED_DECL_COMMON (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
5900 Like @code{ASM_OUTPUT_ALIGNED_COMMON} except that @var{decl} of the
5901 variable to be output, if there is one, or @code{NULL_TREE} if there
5902 is no corresponding variable.  If you define this macro, GCC will use it
5903 in place of both @code{ASM_OUTPUT_COMMON} and
5904 @code{ASM_OUTPUT_ALIGNED_COMMON}.  Define this macro when you need to see
5905 the variable's decl in order to chose what to output.
5906
5907 @findex ASM_OUTPUT_SHARED_COMMON
5908 @item ASM_OUTPUT_SHARED_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
5909 If defined, it is similar to @code{ASM_OUTPUT_COMMON}, except that it
5910 is used when @var{name} is shared.  If not defined, @code{ASM_OUTPUT_COMMON}
5911 will be used.
5912
5913 @findex ASM_OUTPUT_BSS
5914 @item ASM_OUTPUT_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{rounded})
5915 A C statement (sans semicolon) to output to the stdio stream
5916 @var{stream} the assembler definition of uninitialized global @var{decl} named
5917 @var{name} whose size is @var{size} bytes.  The variable @var{rounded}
5918 is the size rounded up to whatever alignment the caller wants.
5919
5920 Try to use function @code{asm_output_bss} defined in @file{varasm.c} when
5921 defining this macro.  If unable, use the expression
5922 @code{assemble_name (@var{stream}, @var{name})} to output the name itself;
5923 before and after that, output the additional assembler syntax for defining
5924 the name, and a newline.
5925
5926 This macro controls how the assembler definitions of uninitialized global
5927 variables are output.  This macro exists to properly support languages like
5928 @code{c++} which do not have @code{common} data.  However, this macro currently
5929 is not defined for all targets.  If this macro and
5930 @code{ASM_OUTPUT_ALIGNED_BSS} are not defined then @code{ASM_OUTPUT_COMMON}
5931 or @code{ASM_OUTPUT_ALIGNED_COMMON} or
5932 @code{ASM_OUTPUT_ALIGNED_DECL_COMMON} is used.
5933
5934 @findex ASM_OUTPUT_ALIGNED_BSS
5935 @item ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
5936 Like @code{ASM_OUTPUT_BSS} except takes the required alignment as a
5937 separate, explicit argument.  If you define this macro, it is used in
5938 place of @code{ASM_OUTPUT_BSS}, and gives you more flexibility in
5939 handling the required alignment of the variable.  The alignment is specified
5940 as the number of bits.
5941
5942 Try to use function @code{asm_output_aligned_bss} defined in file
5943 @file{varasm.c} when defining this macro.
5944
5945 @findex ASM_OUTPUT_SHARED_BSS
5946 @item ASM_OUTPUT_SHARED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{rounded})
5947 If defined, it is similar to @code{ASM_OUTPUT_BSS}, except that it
5948 is used when @var{name} is shared.  If not defined, @code{ASM_OUTPUT_BSS}
5949 will be used.
5950
5951 @findex ASM_OUTPUT_LOCAL
5952 @item ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
5953 A C statement (sans semicolon) to output to the stdio stream
5954 @var{stream} the assembler definition of a local-common-label named
5955 @var{name} whose size is @var{size} bytes.  The variable @var{rounded}
5956 is the size rounded up to whatever alignment the caller wants.
5957
5958 Use the expression @code{assemble_name (@var{stream}, @var{name})} to
5959 output the name itself; before and after that, output the additional
5960 assembler syntax for defining the name, and a newline.
5961
5962 This macro controls how the assembler definitions of uninitialized
5963 static variables are output.
5964
5965 @findex ASM_OUTPUT_ALIGNED_LOCAL
5966 @item ASM_OUTPUT_ALIGNED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{alignment})
5967 Like @code{ASM_OUTPUT_LOCAL} except takes the required alignment as a
5968 separate, explicit argument.  If you define this macro, it is used in
5969 place of @code{ASM_OUTPUT_LOCAL}, and gives you more flexibility in
5970 handling the required alignment of the variable.  The alignment is specified
5971 as the number of bits.
5972
5973 @findex ASM_OUTPUT_ALIGNED_DECL_LOCAL
5974 @item ASM_OUTPUT_ALIGNED_DECL_LOCAL (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
5975 Like @code{ASM_OUTPUT_ALIGNED_DECL} except that @var{decl} of the
5976 variable to be output, if there is one, or @code{NULL_TREE} if there
5977 is no corresponding variable.  If you define this macro, GCC will use it
5978 in place of both @code{ASM_OUTPUT_DECL} and
5979 @code{ASM_OUTPUT_ALIGNED_DECL}.  Define this macro when you need to see
5980 the variable's decl in order to chose what to output.
5981
5982 @findex ASM_OUTPUT_SHARED_LOCAL
5983 @item ASM_OUTPUT_SHARED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
5984 If defined, it is similar to @code{ASM_OUTPUT_LOCAL}, except that it
5985 is used when @var{name} is shared.  If not defined, @code{ASM_OUTPUT_LOCAL}
5986 will be used.
5987 @end table
5988
5989 @node Label Output
5990 @subsection Output and Generation of Labels
5991
5992 @c prevent bad page break with this line
5993 This is about outputting labels.
5994
5995 @table @code
5996 @findex ASM_OUTPUT_LABEL
5997 @findex assemble_name
5998 @item ASM_OUTPUT_LABEL (@var{stream}, @var{name})
5999 A C statement (sans semicolon) to output to the stdio stream
6000 @var{stream} the assembler definition of a label named @var{name}.
6001 Use the expression @code{assemble_name (@var{stream}, @var{name})} to
6002 output the name itself; before and after that, output the additional
6003 assembler syntax for defining the name, and a newline.
6004
6005 @findex ASM_DECLARE_FUNCTION_NAME
6006 @item ASM_DECLARE_FUNCTION_NAME (@var{stream}, @var{name}, @var{decl})
6007 A C statement (sans semicolon) to output to the stdio stream
6008 @var{stream} any text necessary for declaring the name @var{name} of a
6009 function which is being defined.  This macro is responsible for
6010 outputting the label definition (perhaps using
6011 @code{ASM_OUTPUT_LABEL}).  The argument @var{decl} is the
6012 @code{FUNCTION_DECL} tree node representing the function.
6013
6014 If this macro is not defined, then the function name is defined in the
6015 usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
6016
6017 @findex ASM_DECLARE_FUNCTION_SIZE
6018 @item ASM_DECLARE_FUNCTION_SIZE (@var{stream}, @var{name}, @var{decl})
6019 A C statement (sans semicolon) to output to the stdio stream
6020 @var{stream} any text necessary for declaring the size of a function
6021 which is being defined.  The argument @var{name} is the name of the
6022 function.  The argument @var{decl} is the @code{FUNCTION_DECL} tree node
6023 representing the function.
6024
6025 If this macro is not defined, then the function size is not defined.
6026
6027 @findex ASM_DECLARE_OBJECT_NAME
6028 @item ASM_DECLARE_OBJECT_NAME (@var{stream}, @var{name}, @var{decl})
6029 A C statement (sans semicolon) to output to the stdio stream
6030 @var{stream} any text necessary for declaring the name @var{name} of an
6031 initialized variable which is being defined.  This macro must output the
6032 label definition (perhaps using @code{ASM_OUTPUT_LABEL}).  The argument
6033 @var{decl} is the @code{VAR_DECL} tree node representing the variable.
6034
6035 If this macro is not defined, then the variable name is defined in the
6036 usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
6037
6038 @findex ASM_DECLARE_REGISTER_GLOBAL
6039 @item ASM_DECLARE_REGISTER_GLOBAL (@var{stream}, @var{decl}, @var{regno}, @var{name})
6040 A C statement (sans semicolon) to output to the stdio stream
6041 @var{stream} any text necessary for claiming a register @var{regno}
6042 for a global variable @var{decl} with name @var{name}.
6043
6044 If you don't define this macro, that is equivalent to defining it to do
6045 nothing.
6046
6047 @findex  ASM_FINISH_DECLARE_OBJECT
6048 @item ASM_FINISH_DECLARE_OBJECT (@var{stream}, @var{decl}, @var{toplevel}, @var{atend})
6049 A C statement (sans semicolon) to finish up declaring a variable name
6050 once the compiler has processed its initializer fully and thus has had a
6051 chance to determine the size of an array when controlled by an
6052 initializer.  This is used on systems where it's necessary to declare
6053 something about the size of the object.
6054
6055 If you don't define this macro, that is equivalent to defining it to do
6056 nothing.
6057
6058 @findex ASM_GLOBALIZE_LABEL
6059 @item ASM_GLOBALIZE_LABEL (@var{stream}, @var{name})
6060 A C statement (sans semicolon) to output to the stdio stream
6061 @var{stream} some commands that will make the label @var{name} global;
6062 that is, available for reference from other files.  Use the expression
6063 @code{assemble_name (@var{stream}, @var{name})} to output the name
6064 itself; before and after that, output the additional assembler syntax
6065 for making that name global, and a newline.
6066
6067 @findex ASM_WEAKEN_LABEL
6068 @item ASM_WEAKEN_LABEL
6069 A C statement (sans semicolon) to output to the stdio stream
6070 @var{stream} some commands that will make the label @var{name} weak;
6071 that is, available for reference from other files but only used if
6072 no other definition is available.  Use the expression
6073 @code{assemble_name (@var{stream}, @var{name})} to output the name
6074 itself; before and after that, output the additional assembler syntax
6075 for making that name weak, and a newline.
6076
6077 If you don't define this macro, GCC will not support weak
6078 symbols and you should not define the @code{SUPPORTS_WEAK} macro.
6079
6080 @findex SUPPORTS_WEAK
6081 @item SUPPORTS_WEAK
6082 A C expression which evaluates to true if the target supports weak symbols.
6083
6084 If you don't define this macro, @file{defaults.h} provides a default
6085 definition.  If @code{ASM_WEAKEN_LABEL} is defined, the default
6086 definition is @samp{1}; otherwise, it is @samp{0}.  Define this macro if
6087 you want to control weak symbol support with a compiler flag such as
6088 @option{-melf}.
6089
6090 @findex MAKE_DECL_ONE_ONLY (@var{decl})
6091 @item MAKE_DECL_ONE_ONLY
6092 A C statement (sans semicolon) to mark @var{decl} to be emitted as a
6093 public symbol such that extra copies in multiple translation units will
6094 be discarded by the linker.  Define this macro if your object file
6095 format provides support for this concept, such as the @samp{COMDAT}
6096 section flags in the Microsoft Windows PE/COFF format, and this support
6097 requires changes to @var{decl}, such as putting it in a separate section.
6098
6099 @findex SUPPORTS_ONE_ONLY
6100 @item SUPPORTS_ONE_ONLY
6101 A C expression which evaluates to true if the target supports one-only
6102 semantics.
6103
6104 If you don't define this macro, @file{varasm.c} provides a default
6105 definition.  If @code{MAKE_DECL_ONE_ONLY} is defined, the default
6106 definition is @samp{1}; otherwise, it is @samp{0}.  Define this macro if
6107 you want to control one-only symbol support with a compiler flag, or if
6108 setting the @code{DECL_ONE_ONLY} flag is enough to mark a declaration to
6109 be emitted as one-only.
6110
6111 @findex ASM_OUTPUT_EXTERNAL
6112 @item ASM_OUTPUT_EXTERNAL (@var{stream}, @var{decl}, @var{name})
6113 A C statement (sans semicolon) to output to the stdio stream
6114 @var{stream} any text necessary for declaring the name of an external
6115 symbol named @var{name} which is referenced in this compilation but
6116 not defined.  The value of @var{decl} is the tree node for the
6117 declaration.
6118
6119 This macro need not be defined if it does not need to output anything.
6120 The GNU assembler and most Unix assemblers don't require anything.
6121
6122 @findex ASM_OUTPUT_EXTERNAL_LIBCALL
6123 @item ASM_OUTPUT_EXTERNAL_LIBCALL (@var{stream}, @var{symref})
6124 A C statement (sans semicolon) to output on @var{stream} an assembler
6125 pseudo-op to declare a library function name external.  The name of the
6126 library function is given by @var{symref}, which has type @code{rtx} and
6127 is a @code{symbol_ref}.
6128
6129 This macro need not be defined if it does not need to output anything.
6130 The GNU assembler and most Unix assemblers don't require anything.
6131
6132 @findex ASM_OUTPUT_LABELREF
6133 @item ASM_OUTPUT_LABELREF (@var{stream}, @var{name})
6134 A C statement (sans semicolon) to output to the stdio stream
6135 @var{stream} a reference in assembler syntax to a label named
6136 @var{name}.  This should add @samp{_} to the front of the name, if that
6137 is customary on your operating system, as it is in most Berkeley Unix
6138 systems.  This macro is used in @code{assemble_name}.
6139
6140 @ignore @c Seems not to exist anymore.
6141 @findex ASM_OUTPUT_LABELREF_AS_INT
6142 @item ASM_OUTPUT_LABELREF_AS_INT (@var{file}, @var{label})
6143 Define this macro for systems that use the program @code{collect2}.
6144 The definition should be a C statement to output a word containing
6145 a reference to the label @var{label}.
6146 @end ignore
6147
6148 @findex ASM_OUTPUT_SYMBOL_REF
6149 @item ASM_OUTPUT_SYMBOL_REF (@var{stream}, @var{sym})
6150 A C statement (sans semicolon) to output a reference to
6151 @code{SYMBOL_REF} @var{sym}.  If not defined, @code{assemble_output}
6152 will be used to output the name of the symbol.  This macro may be used
6153 to modify the way a symbol is referenced depending on information
6154 encoded by @code{ENCODE_SECTION_INFO}.
6155
6156 @findex ASM_OUTPUT_INTERNAL_LABEL
6157 @item ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{prefix}, @var{num})
6158 A C statement to output to the stdio stream @var{stream} a label whose
6159 name is made from the string @var{prefix} and the number @var{num}.
6160
6161 It is absolutely essential that these labels be distinct from the labels
6162 used for user-level functions and variables.  Otherwise, certain programs
6163 will have name conflicts with internal labels.
6164
6165 It is desirable to exclude internal labels from the symbol table of the
6166 object file.  Most assemblers have a naming convention for labels that
6167 should be excluded; on many systems, the letter @samp{L} at the
6168 beginning of a label has this effect.  You should find out what
6169 convention your system uses, and follow it.
6170
6171 The usual definition of this macro is as follows:
6172
6173 @example
6174 fprintf (@var{stream}, "L%s%d:\n", @var{prefix}, @var{num})
6175 @end example
6176
6177 @findex ASM_OUTPUT_DEBUG_LABEL
6178 @item ASM_OUTPUT_DEBUG_LABEL (@var{stream}, @var{prefix}, @var{num})
6179 A C statement to output to the stdio stream @var{stream} a debug info
6180 label whose name is made from the string @var{prefix} and the number
6181 @var{num}.  This is useful for VLIW targets, where debug info labels
6182 may need to be treated differently than branch target labels.  On some
6183 systems, branch target labels must be at the beginning of instruction
6184 bundles, but debug info labels can occur in the middle of instruction
6185 bundles.
6186
6187 If this macro is not defined, then @code{ASM_OUTPUT_INTERNAL_LABEL} will be
6188 used.
6189
6190 @findex ASM_OUTPUT_ALTERNATE_LABEL_NAME
6191 @item ASM_OUTPUT_ALTERNATE_LABEL_NAME (@var{stream}, @var{string})
6192 A C statement to output to the stdio stream @var{stream} the string
6193 @var{string}.
6194
6195 The default definition of this macro is as follows:
6196
6197 @example
6198 fprintf (@var{stream}, "%s:\n", LABEL_ALTERNATE_NAME (INSN))
6199 @end example
6200
6201 @findex ASM_GENERATE_INTERNAL_LABEL
6202 @item ASM_GENERATE_INTERNAL_LABEL (@var{string}, @var{prefix}, @var{num})
6203 A C statement to store into the string @var{string} a label whose name
6204 is made from the string @var{prefix} and the number @var{num}.
6205
6206 This string, when output subsequently by @code{assemble_name}, should
6207 produce the output that @code{ASM_OUTPUT_INTERNAL_LABEL} would produce
6208 with the same @var{prefix} and @var{num}.
6209
6210 If the string begins with @samp{*}, then @code{assemble_name} will
6211 output the rest of the string unchanged.  It is often convenient for
6212 @code{ASM_GENERATE_INTERNAL_LABEL} to use @samp{*} in this way.  If the
6213 string doesn't start with @samp{*}, then @code{ASM_OUTPUT_LABELREF} gets
6214 to output the string, and may change it.  (Of course,
6215 @code{ASM_OUTPUT_LABELREF} is also part of your machine description, so
6216 you should know what it does on your machine.)
6217
6218 @findex ASM_FORMAT_PRIVATE_NAME
6219 @item ASM_FORMAT_PRIVATE_NAME (@var{outvar}, @var{name}, @var{number})
6220 A C expression to assign to @var{outvar} (which is a variable of type
6221 @code{char *}) a newly allocated string made from the string
6222 @var{name} and the number @var{number}, with some suitable punctuation
6223 added.  Use @code{alloca} to get space for the string.
6224
6225 The string will be used as an argument to @code{ASM_OUTPUT_LABELREF} to
6226 produce an assembler label for an internal static variable whose name is
6227 @var{name}.  Therefore, the string must be such as to result in valid
6228 assembler code.  The argument @var{number} is different each time this
6229 macro is executed; it prevents conflicts between similarly-named
6230 internal static variables in different scopes.
6231
6232 Ideally this string should not be a valid C identifier, to prevent any
6233 conflict with the user's own symbols.  Most assemblers allow periods
6234 or percent signs in assembler symbols; putting at least one of these
6235 between the name and the number will suffice.
6236
6237 @findex ASM_OUTPUT_DEF
6238 @item ASM_OUTPUT_DEF (@var{stream}, @var{name}, @var{value})
6239 A C statement to output to the stdio stream @var{stream} assembler code
6240 which defines (equates) the symbol @var{name} to have the value @var{value}.
6241
6242 @findex SET_ASM_OP
6243 If SET_ASM_OP is defined, a default definition is provided which is
6244 correct for most systems.
6245
6246 @findex ASM_OUTPUT_DEF_FROM_DECLS
6247 @item ASM_OUTPUT_DEF_FROM_DECLS (@var{stream}, @var{decl_of_name}, @var{decl_of_value})
6248 A C statement to output to the stdio stream @var{stream} assembler code
6249 which defines (equates) the symbol whose tree node is @var{decl_of_name}
6250 to have the value of the tree node @var{decl_of_value}.  This macro will
6251 be used in preference to @samp{ASM_OUTPUT_DEF} if it is defined and if
6252 the tree nodes are available.
6253
6254 @findex ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
6255 @item ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL (@var{stream}, @var{symbol}, @var{high}, @var{low})
6256 A C statement to output to the stdio stream @var{stream} assembler code
6257 which defines (equates) the symbol @var{symbol} to have a value equal to
6258 the difference of the two symbols @var{high} and @var{low}, i.e.
6259 @var{high} minus @var{low}.  GCC guarantees that the symbols @var{high}
6260 and @var{low} are already known by the assembler so that the difference
6261 resolves into a constant.
6262
6263 @findex SET_ASM_OP
6264 If SET_ASM_OP is defined, a default definition is provided which is
6265 correct for most systems.
6266
6267 @findex ASM_OUTPUT_WEAK_ALIAS
6268 @item ASM_OUTPUT_WEAK_ALIAS (@var{stream}, @var{name}, @var{value})
6269 A C statement to output to the stdio stream @var{stream} assembler code
6270 which defines (equates) the weak symbol @var{name} to have the value
6271 @var{value}.
6272
6273 Define this macro if the target only supports weak aliases; define
6274 ASM_OUTPUT_DEF instead if possible.
6275
6276 @findex OBJC_GEN_METHOD_LABEL
6277 @item OBJC_GEN_METHOD_LABEL (@var{buf}, @var{is_inst}, @var{class_name}, @var{cat_name}, @var{sel_name})
6278 Define this macro to override the default assembler names used for
6279 Objective C methods.
6280
6281 The default name is a unique method number followed by the name of the
6282 class (e.g.@: @samp{_1_Foo}).  For methods in categories, the name of
6283 the category is also included in the assembler name (e.g.@:
6284 @samp{_1_Foo_Bar}).
6285
6286 These names are safe on most systems, but make debugging difficult since
6287 the method's selector is not present in the name.  Therefore, particular
6288 systems define other ways of computing names.
6289
6290 @var{buf} is an expression of type @code{char *} which gives you a
6291 buffer in which to store the name; its length is as long as
6292 @var{class_name}, @var{cat_name} and @var{sel_name} put together, plus
6293 50 characters extra.
6294
6295 The argument @var{is_inst} specifies whether the method is an instance
6296 method or a class method; @var{class_name} is the name of the class;
6297 @var{cat_name} is the name of the category (or NULL if the method is not
6298 in a category); and @var{sel_name} is the name of the selector.
6299
6300 On systems where the assembler can handle quoted names, you can use this
6301 macro to provide more human-readable names.
6302
6303 @findex ASM_DECLARE_UNRESOLVED_REFERENCE
6304 @item ASM_DECLARE_UNRESOLVED_REFERENCE (@var{stream}, @var{name})
6305 A C statement (sans semicolon) to output to the stdio stream
6306 @var{stream} commands to declare that the label @var{name} is an
6307 unresolved Objective-C class reference.  This is only needed for targets
6308 whose linkers have special support for NeXT-style runtimes.
6309 @end table
6310
6311 @node Initialization
6312 @subsection How Initialization Functions Are Handled
6313 @cindex initialization routines
6314 @cindex termination routines
6315 @cindex constructors, output of
6316 @cindex destructors, output of
6317
6318 The compiled code for certain languages includes @dfn{constructors}
6319 (also called @dfn{initialization routines})---functions to initialize
6320 data in the program when the program is started.  These functions need
6321 to be called before the program is ``started''---that is to say, before
6322 @code{main} is called.
6323
6324 Compiling some languages generates @dfn{destructors} (also called
6325 @dfn{termination routines}) that should be called when the program
6326 terminates.
6327
6328 To make the initialization and termination functions work, the compiler
6329 must output something in the assembler code to cause those functions to
6330 be called at the appropriate time.  When you port the compiler to a new
6331 system, you need to specify how to do this.
6332
6333 There are two major ways that GCC currently supports the execution of
6334 initialization and termination functions.  Each way has two variants.
6335 Much of the structure is common to all four variations.
6336
6337 @findex __CTOR_LIST__
6338 @findex __DTOR_LIST__
6339 The linker must build two lists of these functions---a list of
6340 initialization functions, called @code{__CTOR_LIST__}, and a list of
6341 termination functions, called @code{__DTOR_LIST__}.
6342
6343 Each list always begins with an ignored function pointer (which may hold
6344 0, @minus{}1, or a count of the function pointers after it, depending on
6345 the environment).  This is followed by a series of zero or more function
6346 pointers to constructors (or destructors), followed by a function
6347 pointer containing zero.
6348
6349 Depending on the operating system and its executable file format, either
6350 @file{crtstuff.c} or @file{libgcc2.c} traverses these lists at startup
6351 time and exit time.  Constructors are called in reverse order of the
6352 list; destructors in forward order.
6353
6354 The best way to handle static constructors works only for object file
6355 formats which provide arbitrarily-named sections.  A section is set
6356 aside for a list of constructors, and another for a list of destructors.
6357 Traditionally these are called @samp{.ctors} and @samp{.dtors}.  Each
6358 object file that defines an initialization function also puts a word in
6359 the constructor section to point to that function.  The linker
6360 accumulates all these words into one contiguous @samp{.ctors} section.
6361 Termination functions are handled similarly.
6362
6363 To use this method, you need appropriate definitions of the macros
6364 @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR}.  Usually
6365 you can get them by including @file{svr4.h}.
6366
6367 When arbitrary sections are available, there are two variants, depending
6368 upon how the code in @file{crtstuff.c} is called.  On systems that
6369 support an @dfn{init} section which is executed at program startup,
6370 parts of @file{crtstuff.c} are compiled into that section.  The
6371 program is linked by the @code{gcc} driver like this:
6372
6373 @example
6374 ld -o @var{output_file} crtbegin.o @dots{} crtend.o -lgcc
6375 @end example
6376
6377 The head of a function (@code{__do_global_ctors}) appears in the init
6378 section of @file{crtbegin.o}; the remainder of the function appears in
6379 the init section of @file{crtend.o}.  The linker will pull these two
6380 parts of the section together, making a whole function.  If any of the
6381 user's object files linked into the middle of it contribute code, then that
6382 code will be executed as part of the body of @code{__do_global_ctors}.
6383
6384 To use this variant, you must define the @code{INIT_SECTION_ASM_OP}
6385 macro properly.
6386
6387 If no init section is available, do not define
6388 @code{INIT_SECTION_ASM_OP}.  Then @code{__do_global_ctors} is built into
6389 the text section like all other functions, and resides in
6390 @file{libgcc.a}.  When GCC compiles any function called @code{main}, it
6391 inserts a procedure call to @code{__main} as the first executable code
6392 after the function prologue.  The @code{__main} function, also defined
6393 in @file{libgcc2.c}, simply calls @file{__do_global_ctors}.
6394
6395 In file formats that don't support arbitrary sections, there are again
6396 two variants.  In the simplest variant, the GNU linker (GNU @code{ld})
6397 and an `a.out' format must be used.  In this case,
6398 @code{ASM_OUTPUT_CONSTRUCTOR} is defined to produce a @code{.stabs}
6399 entry of type @samp{N_SETT}, referencing the name @code{__CTOR_LIST__},
6400 and with the address of the void function containing the initialization
6401 code as its value.  The GNU linker recognizes this as a request to add
6402 the value to a ``set''; the values are accumulated, and are eventually
6403 placed in the executable as a vector in the format described above, with
6404 a leading (ignored) count and a trailing zero element.
6405 @code{ASM_OUTPUT_DESTRUCTOR} is handled similarly.  Since no init
6406 section is available, the absence of @code{INIT_SECTION_ASM_OP} causes
6407 the compilation of @code{main} to call @code{__main} as above, starting
6408 the initialization process.
6409
6410 The last variant uses neither arbitrary sections nor the GNU linker.
6411 This is preferable when you want to do dynamic linking and when using
6412 file formats which the GNU linker does not support, such as `ECOFF'.  In
6413 this case, @code{ASM_OUTPUT_CONSTRUCTOR} does not produce an
6414 @code{N_SETT} symbol; initialization and termination functions are
6415 recognized simply by their names.  This requires an extra program in the
6416 linkage step, called @code{collect2}.  This program pretends to be the
6417 linker, for use with GCC; it does its job by running the ordinary
6418 linker, but also arranges to include the vectors of initialization and
6419 termination functions.  These functions are called via @code{__main} as
6420 described above.
6421
6422 Choosing among these configuration options has been simplified by a set
6423 of operating-system-dependent files in the @file{config} subdirectory.
6424 These files define all of the relevant parameters.  Usually it is
6425 sufficient to include one into your specific machine-dependent
6426 configuration file.  These files are:
6427
6428 @table @file
6429 @item aoutos.h
6430 For operating systems using the `a.out' format.
6431
6432 @item next.h
6433 For operating systems using the `MachO' format.
6434
6435 @item svr3.h
6436 For System V Release 3 and similar systems using `COFF' format.
6437
6438 @item svr4.h
6439 For System V Release 4 and similar systems using `ELF' format.
6440
6441 @item vms.h
6442 For the VMS operating system.
6443 @end table
6444
6445 @ifinfo
6446 The following section describes the specific macros that control and
6447 customize the handling of initialization and termination functions.
6448 @end ifinfo
6449
6450 @node Macros for Initialization
6451 @subsection Macros Controlling Initialization Routines
6452
6453 Here are the macros that control how the compiler handles initialization
6454 and termination functions:
6455
6456 @table @code
6457 @findex INIT_SECTION_ASM_OP
6458 @item INIT_SECTION_ASM_OP
6459 If defined, a C string constant, including spacing, for the assembler
6460 operation to identify the following data as initialization code.  If not
6461 defined, GCC will assume such a section does not exist.  When you are
6462 using special sections for initialization and termination functions, this
6463 macro also controls how @file{crtstuff.c} and @file{libgcc2.c} arrange to
6464 run the initialization functions.
6465
6466 @item HAS_INIT_SECTION
6467 @findex HAS_INIT_SECTION
6468 If defined, @code{main} will not call @code{__main} as described above.
6469 This macro should be defined for systems that control the contents of the
6470 init section on a symbol-by-symbol basis, such as OSF/1, and should not
6471 be defined explicitly for systems that support
6472 @code{INIT_SECTION_ASM_OP}.
6473
6474 @item LD_INIT_SWITCH
6475 @findex LD_INIT_SWITCH
6476 If defined, a C string constant for a switch that tells the linker that
6477 the following symbol is an initialization routine.
6478
6479 @item LD_FINI_SWITCH
6480 @findex LD_FINI_SWITCH
6481 If defined, a C string constant for a switch that tells the linker that
6482 the following symbol is a finalization routine.
6483
6484 @item INVOKE__main
6485 @findex INVOKE__main
6486 If defined, @code{main} will call @code{__main} despite the presence of
6487 @code{INIT_SECTION_ASM_OP}.  This macro should be defined for systems
6488 where the init section is not actually run automatically, but is still
6489 useful for collecting the lists of constructors and destructors.
6490
6491 @item SUPPORTS_INIT_PRIORITY
6492 @findex SUPPORTS_INIT_PRIORITY
6493 If nonzero, the C++ @code{init_priority} attribute is supported and the
6494 compiler should emit instructions to control the order of initialization
6495 of objects.  If zero, the compiler will issue an error message upon
6496 encountering an @code{init_priority} attribute.
6497
6498 @item ASM_OUTPUT_CONSTRUCTOR (@var{stream}, @var{name})
6499 @findex ASM_OUTPUT_CONSTRUCTOR
6500 Define this macro as a C statement to output on the stream @var{stream}
6501 the assembler code to arrange to call the function named @var{name} at
6502 initialization time.
6503
6504 Assume that @var{name} is the name of a C function generated
6505 automatically by the compiler.  This function takes no arguments.  Use
6506 the function @code{assemble_name} to output the name @var{name}; this
6507 performs any system-specific syntactic transformations such as adding an
6508 underscore.
6509
6510 If you don't define this macro, nothing special is output to arrange to
6511 call the function.  This is correct when the function will be called in
6512 some other manner---for example, by means of the @code{collect2} program,
6513 which looks through the symbol table to find these functions by their
6514 names.
6515
6516 @item ASM_OUTPUT_DESTRUCTOR (@var{stream}, @var{name})
6517 @findex ASM_OUTPUT_DESTRUCTOR
6518 This is like @code{ASM_OUTPUT_CONSTRUCTOR} but used for termination
6519 functions rather than initialization functions.
6520
6521 When @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR} are
6522 defined, the initialization routine generated for the generated object
6523 file will have static linkage.
6524 @end table
6525
6526 If your system uses @code{collect2} as the means of processing
6527 constructors, then that program normally uses @code{nm} to scan an
6528 object file for constructor functions to be called.  On such systems you
6529 must not define @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR}
6530 as the object file's initialization routine must have global scope.
6531
6532 On certain kinds of systems, you can define these macros to make
6533 @code{collect2} work faster (and, in some cases, make it work at all):
6534
6535 @table @code
6536 @findex OBJECT_FORMAT_COFF
6537 @item OBJECT_FORMAT_COFF
6538 Define this macro if the system uses COFF (Common Object File Format)
6539 object files, so that @code{collect2} can assume this format and scan
6540 object files directly for dynamic constructor/destructor functions.
6541
6542 @findex OBJECT_FORMAT_ROSE
6543 @item OBJECT_FORMAT_ROSE
6544 Define this macro if the system uses ROSE format object files, so that
6545 @code{collect2} can assume this format and scan object files directly
6546 for dynamic constructor/destructor functions.
6547
6548 These macros are effective only in a native compiler; @code{collect2} as
6549 part of a cross compiler always uses @code{nm} for the target machine.
6550
6551 @findex REAL_NM_FILE_NAME
6552 @item REAL_NM_FILE_NAME
6553 Define this macro as a C string constant containing the file name to use
6554 to execute @code{nm}.  The default is to search the path normally for
6555 @code{nm}.
6556
6557 If your system supports shared libraries and has a program to list the
6558 dynamic dependencies of a given library or executable, you can define
6559 these macros to enable support for running initialization and
6560 termination functions in shared libraries:
6561
6562 @findex LDD_SUFFIX
6563 @item LDD_SUFFIX
6564 Define this macro to a C string constant containing the name of the
6565 program which lists dynamic dependencies, like @code{"ldd"} under SunOS 4.
6566
6567 @findex PARSE_LDD_OUTPUT
6568 @item PARSE_LDD_OUTPUT (@var{PTR})
6569 Define this macro to be C code that extracts filenames from the output
6570 of the program denoted by @code{LDD_SUFFIX}.  @var{PTR} is a variable
6571 of type @code{char *} that points to the beginning of a line of output
6572 from @code{LDD_SUFFIX}.  If the line lists a dynamic dependency, the
6573 code must advance @var{PTR} to the beginning of the filename on that
6574 line.  Otherwise, it must set @var{PTR} to @code{NULL}.
6575
6576 @end table
6577
6578 @node Instruction Output
6579 @subsection Output of Assembler Instructions
6580
6581 @c prevent bad page break with this line
6582 This describes assembler instruction output.
6583
6584 @table @code
6585 @findex REGISTER_NAMES
6586 @item REGISTER_NAMES
6587 A C initializer containing the assembler's names for the machine
6588 registers, each one as a C string constant.  This is what translates
6589 register numbers in the compiler into assembler language.
6590
6591 @findex ADDITIONAL_REGISTER_NAMES
6592 @item ADDITIONAL_REGISTER_NAMES
6593 If defined, a C initializer for an array of structures containing a name
6594 and a register number.  This macro defines additional names for hard
6595 registers, thus allowing the @code{asm} option in declarations to refer
6596 to registers using alternate names.
6597
6598 @findex ASM_OUTPUT_OPCODE
6599 @item ASM_OUTPUT_OPCODE (@var{stream}, @var{ptr})
6600 Define this macro if you are using an unusual assembler that
6601 requires different names for the machine instructions.
6602
6603 The definition is a C statement or statements which output an
6604 assembler instruction opcode to the stdio stream @var{stream}.  The
6605 macro-operand @var{ptr} is a variable of type @code{char *} which
6606 points to the opcode name in its ``internal'' form---the form that is
6607 written in the machine description.  The definition should output the
6608 opcode name to @var{stream}, performing any translation you desire, and
6609 increment the variable @var{ptr} to point at the end of the opcode
6610 so that it will not be output twice.
6611
6612 In fact, your macro definition may process less than the entire opcode
6613 name, or more than the opcode name; but if you want to process text
6614 that includes @samp{%}-sequences to substitute operands, you must take
6615 care of the substitution yourself.  Just be sure to increment
6616 @var{ptr} over whatever text should not be output normally.
6617
6618 @findex recog_operand
6619 If you need to look at the operand values, they can be found as the
6620 elements of @code{recog_operand}.
6621
6622 If the macro definition does nothing, the instruction is output
6623 in the usual way.
6624
6625 @findex FINAL_PRESCAN_INSN
6626 @item FINAL_PRESCAN_INSN (@var{insn}, @var{opvec}, @var{noperands})
6627 If defined, a C statement to be executed just prior to the output of
6628 assembler code for @var{insn}, to modify the extracted operands so
6629 they will be output differently.
6630
6631 Here the argument @var{opvec} is the vector containing the operands
6632 extracted from @var{insn}, and @var{noperands} is the number of
6633 elements of the vector which contain meaningful data for this insn.
6634 The contents of this vector are what will be used to convert the insn
6635 template into assembler code, so you can change the assembler output
6636 by changing the contents of the vector.
6637
6638 This macro is useful when various assembler syntaxes share a single
6639 file of instruction patterns; by defining this macro differently, you
6640 can cause a large class of instructions to be output differently (such
6641 as with rearranged operands).  Naturally, variations in assembler
6642 syntax affecting individual insn patterns ought to be handled by
6643 writing conditional output routines in those patterns.
6644
6645 If this macro is not defined, it is equivalent to a null statement.
6646
6647 @findex FINAL_PRESCAN_LABEL
6648 @item FINAL_PRESCAN_LABEL
6649 If defined, @code{FINAL_PRESCAN_INSN} will be called on each
6650 @code{CODE_LABEL}.  In that case, @var{opvec} will be a null pointer and
6651 @var{noperands} will be zero.
6652
6653 @findex PRINT_OPERAND
6654 @item PRINT_OPERAND (@var{stream}, @var{x}, @var{code})
6655 A C compound statement to output to stdio stream @var{stream} the
6656 assembler syntax for an instruction operand @var{x}.  @var{x} is an
6657 RTL expression.
6658
6659 @var{code} is a value that can be used to specify one of several ways
6660 of printing the operand.  It is used when identical operands must be
6661 printed differently depending on the context.  @var{code} comes from
6662 the @samp{%} specification that was used to request printing of the
6663 operand.  If the specification was just @samp{%@var{digit}} then
6664 @var{code} is 0; if the specification was @samp{%@var{ltr}
6665 @var{digit}} then @var{code} is the ASCII code for @var{ltr}.
6666
6667 @findex reg_names
6668 If @var{x} is a register, this macro should print the register's name.
6669 The names can be found in an array @code{reg_names} whose type is
6670 @code{char *[]}.  @code{reg_names} is initialized from
6671 @code{REGISTER_NAMES}.
6672
6673 When the machine description has a specification @samp{%@var{punct}}
6674 (a @samp{%} followed by a punctuation character), this macro is called
6675 with a null pointer for @var{x} and the punctuation character for
6676 @var{code}.
6677
6678 @findex PRINT_OPERAND_PUNCT_VALID_P
6679 @item PRINT_OPERAND_PUNCT_VALID_P (@var{code})
6680 A C expression which evaluates to true if @var{code} is a valid
6681 punctuation character for use in the @code{PRINT_OPERAND} macro.  If
6682 @code{PRINT_OPERAND_PUNCT_VALID_P} is not defined, it means that no
6683 punctuation characters (except for the standard one, @samp{%}) are used
6684 in this way.
6685
6686 @findex PRINT_OPERAND_ADDRESS
6687 @item PRINT_OPERAND_ADDRESS (@var{stream}, @var{x})
6688 A C compound statement to output to stdio stream @var{stream} the
6689 assembler syntax for an instruction operand that is a memory reference
6690 whose address is @var{x}.  @var{x} is an RTL expression.
6691
6692 @cindex @code{ENCODE_SECTION_INFO} usage
6693 On some machines, the syntax for a symbolic address depends on the
6694 section that the address refers to.  On these machines, define the macro
6695 @code{ENCODE_SECTION_INFO} to store the information into the
6696 @code{symbol_ref}, and then check for it here.  @xref{Assembler Format}.
6697
6698 @findex DBR_OUTPUT_SEQEND
6699 @findex dbr_sequence_length
6700 @item DBR_OUTPUT_SEQEND(@var{file})
6701 A C statement, to be executed after all slot-filler instructions have
6702 been output.  If necessary, call @code{dbr_sequence_length} to
6703 determine the number of slots filled in a sequence (zero if not
6704 currently outputting a sequence), to decide how many no-ops to output,
6705 or whatever.
6706
6707 Don't define this macro if it has nothing to do, but it is helpful in
6708 reading assembly output if the extent of the delay sequence is made
6709 explicit (e.g. with white space).
6710
6711 @findex final_sequence
6712 Note that output routines for instructions with delay slots must be
6713 prepared to deal with not being output as part of a sequence (i.e.
6714 when the scheduling pass is not run, or when no slot fillers could be
6715 found.)  The variable @code{final_sequence} is null when not
6716 processing a sequence, otherwise it contains the @code{sequence} rtx
6717 being output.
6718
6719 @findex REGISTER_PREFIX
6720 @findex LOCAL_LABEL_PREFIX
6721 @findex USER_LABEL_PREFIX
6722 @findex IMMEDIATE_PREFIX
6723 @findex asm_fprintf
6724 @item REGISTER_PREFIX
6725 @itemx LOCAL_LABEL_PREFIX
6726 @itemx USER_LABEL_PREFIX
6727 @itemx IMMEDIATE_PREFIX
6728 If defined, C string expressions to be used for the @samp{%R}, @samp{%L},
6729 @samp{%U}, and @samp{%I} options of @code{asm_fprintf} (see
6730 @file{final.c}).  These are useful when a single @file{md} file must
6731 support multiple assembler formats.  In that case, the various @file{tm.h}
6732 files can define these macros differently.
6733
6734 @item ASM_FPRINTF_EXTENSIONS(@var{file}, @var{argptr}, @var{format})
6735 @findex ASM_FPRINTF_EXTENSIONS
6736 If defined this macro should expand to a series of @code{case}
6737 statements which will be parsed inside the @code{switch} statement of
6738 the @code{asm_fprintf} function.  This allows targets to define extra
6739 printf formats which may useful when generating their assembler
6740 statements.  Note that upper case letters are reserved for future
6741 generic extensions to asm_fprintf, and so are not available to target
6742 specific code.  The output file is given by the parameter @var{file}.
6743 The varargs input pointer is @var{argptr} and the rest of the format
6744 string, starting the character after the one that is being switched
6745 upon, is pointed to by @var{format}.
6746
6747 @findex ASSEMBLER_DIALECT
6748 @item ASSEMBLER_DIALECT
6749 If your target supports multiple dialects of assembler language (such as
6750 different opcodes), define this macro as a C expression that gives the
6751 numeric index of the assembler language dialect to use, with zero as the
6752 first variant.
6753
6754 If this macro is defined, you may use constructs of the form
6755 @samp{@{option0|option1|option2@dots{}@}} in the output
6756 templates of patterns (@pxref{Output Template}) or in the first argument
6757 of @code{asm_fprintf}.  This construct outputs @samp{option0},
6758 @samp{option1} or @samp{option2}, etc., if the value of
6759 @code{ASSEMBLER_DIALECT} is zero, one or two, etc.  Any special
6760 characters within these strings retain their usual meaning.
6761
6762 If you do not define this macro, the characters @samp{@{}, @samp{|} and
6763 @samp{@}} do not have any special meaning when used in templates or
6764 operands to @code{asm_fprintf}.
6765
6766 Define the macros @code{REGISTER_PREFIX}, @code{LOCAL_LABEL_PREFIX},
6767 @code{USER_LABEL_PREFIX} and @code{IMMEDIATE_PREFIX} if you can express
6768 the variations in assembler language syntax with that mechanism.  Define
6769 @code{ASSEMBLER_DIALECT} and use the @samp{@{option0|option1@}} syntax
6770 if the syntax variant are larger and involve such things as different
6771 opcodes or operand order.
6772
6773 @findex ASM_OUTPUT_REG_PUSH
6774 @item ASM_OUTPUT_REG_PUSH (@var{stream}, @var{regno})
6775 A C expression to output to @var{stream} some assembler code
6776 which will push hard register number @var{regno} onto the stack.
6777 The code need not be optimal, since this macro is used only when
6778 profiling.
6779
6780 @findex ASM_OUTPUT_REG_POP
6781 @item ASM_OUTPUT_REG_POP (@var{stream}, @var{regno})
6782 A C expression to output to @var{stream} some assembler code
6783 which will pop hard register number @var{regno} off of the stack.
6784 The code need not be optimal, since this macro is used only when
6785 profiling.
6786 @end table
6787
6788 @node Dispatch Tables
6789 @subsection Output of Dispatch Tables
6790
6791 @c prevent bad page break with this line
6792 This concerns dispatch tables.
6793
6794 @table @code
6795 @cindex dispatch table
6796 @findex ASM_OUTPUT_ADDR_DIFF_ELT
6797 @item ASM_OUTPUT_ADDR_DIFF_ELT (@var{stream}, @var{body}, @var{value}, @var{rel})
6798 A C statement to output to the stdio stream @var{stream} an assembler
6799 pseudo-instruction to generate a difference between two labels.
6800 @var{value} and @var{rel} are the numbers of two internal labels.  The
6801 definitions of these labels are output using
6802 @code{ASM_OUTPUT_INTERNAL_LABEL}, and they must be printed in the same
6803 way here.  For example,
6804
6805 @example
6806 fprintf (@var{stream}, "\t.word L%d-L%d\n",
6807          @var{value}, @var{rel})
6808 @end example
6809
6810 You must provide this macro on machines where the addresses in a
6811 dispatch table are relative to the table's own address.  If defined, GNU
6812 CC will also use this macro on all machines when producing PIC.
6813 @var{body} is the body of the ADDR_DIFF_VEC; it is provided so that the
6814 mode and flags can be read.
6815
6816 @findex ASM_OUTPUT_ADDR_VEC_ELT
6817 @item ASM_OUTPUT_ADDR_VEC_ELT (@var{stream}, @var{value})
6818 This macro should be provided on machines where the addresses
6819 in a dispatch table are absolute.
6820
6821 The definition should be a C statement to output to the stdio stream
6822 @var{stream} an assembler pseudo-instruction to generate a reference to
6823 a label.  @var{value} is the number of an internal label whose
6824 definition is output using @code{ASM_OUTPUT_INTERNAL_LABEL}.
6825 For example,
6826
6827 @example
6828 fprintf (@var{stream}, "\t.word L%d\n", @var{value})
6829 @end example
6830
6831 @findex ASM_OUTPUT_CASE_LABEL
6832 @item ASM_OUTPUT_CASE_LABEL (@var{stream}, @var{prefix}, @var{num}, @var{table})
6833 Define this if the label before a jump-table needs to be output
6834 specially.  The first three arguments are the same as for
6835 @code{ASM_OUTPUT_INTERNAL_LABEL}; the fourth argument is the
6836 jump-table which follows (a @code{jump_insn} containing an
6837 @code{addr_vec} or @code{addr_diff_vec}).
6838
6839 This feature is used on system V to output a @code{swbeg} statement
6840 for the table.
6841
6842 If this macro is not defined, these labels are output with
6843 @code{ASM_OUTPUT_INTERNAL_LABEL}.
6844
6845 @findex ASM_OUTPUT_CASE_END
6846 @item ASM_OUTPUT_CASE_END (@var{stream}, @var{num}, @var{table})
6847 Define this if something special must be output at the end of a
6848 jump-table.  The definition should be a C statement to be executed
6849 after the assembler code for the table is written.  It should write
6850 the appropriate code to stdio stream @var{stream}.  The argument
6851 @var{table} is the jump-table insn, and @var{num} is the label-number
6852 of the preceding label.
6853
6854 If this macro is not defined, nothing special is output at the end of
6855 the jump-table.
6856 @end table
6857
6858 @node Exception Region Output
6859 @subsection Assembler Commands for Exception Regions
6860
6861 @c prevent bad page break with this line
6862
6863 This describes commands marking the start and the end of an exception
6864 region.
6865
6866 @table @code
6867 @findex ASM_OUTPUT_EH_REGION_BEG
6868 @item ASM_OUTPUT_EH_REGION_BEG ()
6869 A C expression to output text to mark the start of an exception region.
6870
6871 This macro need not be defined on most platforms.
6872
6873 @findex ASM_OUTPUT_EH_REGION_END
6874 @item ASM_OUTPUT_EH_REGION_END ()
6875 A C expression to output text to mark the end of an exception region.
6876
6877 This macro need not be defined on most platforms.
6878
6879 @findex EXCEPTION_SECTION
6880 @item EXCEPTION_SECTION ()
6881 A C expression to switch to the section in which the main
6882 exception table is to be placed (@pxref{Sections}).  The default is a
6883 section named @code{.gcc_except_table} on machines that support named
6884 sections via @code{ASM_OUTPUT_SECTION_NAME}, otherwise if @option{-fpic}
6885 or @option{-fPIC} is in effect, the @code{data_section}, otherwise the
6886 @code{readonly_data_section}.
6887
6888 @findex EH_FRAME_SECTION_ASM_OP
6889 @item EH_FRAME_SECTION_ASM_OP
6890 If defined, a C string constant, including spacing, for the assembler
6891 operation to switch to the section for exception handling frame unwind
6892 information.  If not defined, GCC will provide a default definition if the
6893 target supports named sections.  @file{crtstuff.c} uses this macro to
6894 switch to the appropriate section.
6895
6896 You should define this symbol if your target supports DWARF 2 frame
6897 unwind information and the default definition does not work.
6898
6899 @findex OMIT_EH_TABLE
6900 @item OMIT_EH_TABLE ()
6901 A C expression that is nonzero if the normal exception table output
6902 should be omitted.
6903
6904 This macro need not be defined on most platforms.
6905
6906 @findex EH_TABLE_LOOKUP
6907 @item EH_TABLE_LOOKUP ()
6908 Alternate runtime support for looking up an exception at runtime and
6909 finding the associated handler, if the default method won't work.
6910
6911 This macro need not be defined on most platforms.
6912
6913 @findex DOESNT_NEED_UNWINDER
6914 @item DOESNT_NEED_UNWINDER
6915 A C expression that decides whether or not the current function needs to
6916 have a function unwinder generated for it.  See the file @code{except.c}
6917 for details on when to define this, and how.
6918
6919 @findex MASK_RETURN_ADDR
6920 @item MASK_RETURN_ADDR
6921 An rtx used to mask the return address found via RETURN_ADDR_RTX, so
6922 that it does not contain any extraneous set bits in it.
6923
6924 @findex DWARF2_UNWIND_INFO
6925 @item DWARF2_UNWIND_INFO
6926 Define this macro to 0 if your target supports DWARF 2 frame unwind
6927 information, but it does not yet work with exception handling.
6928 Otherwise, if your target supports this information (if it defines
6929 @samp{INCOMING_RETURN_ADDR_RTX} and either @samp{UNALIGNED_INT_ASM_OP}
6930 or @samp{OBJECT_FORMAT_ELF}), GCC will provide a default definition of
6931 1.
6932
6933 If this macro is defined to 1, the DWARF 2 unwinder will be the default
6934 exception handling mechanism; otherwise, setjmp/longjmp will be used by
6935 default.
6936
6937 If this macro is defined to anything, the DWARF 2 unwinder will be used
6938 instead of inline unwinders and __unwind_function in the non-setjmp case.
6939
6940 @findex DWARF_CIE_DATA_ALIGNMENT
6941 @item DWARF_CIE_DATA_ALIGNMENT
6942 This macro need only be defined if the target might save registers in the
6943 function prologue at an offset to the stack pointer that is not aligned to
6944 @code{UNITS_PER_WORD}.  The definition should be the negative minimum
6945 alignment if @code{STACK_GROWS_DOWNWARD} is defined, and the positive
6946 minimum alignment otherwise.  @xref{SDB and DWARF}.  Only applicable if
6947 the target supports DWARF 2 frame unwind information.
6948
6949 @end table
6950
6951 @node Alignment Output
6952 @subsection Assembler Commands for Alignment
6953
6954 @c prevent bad page break with this line
6955 This describes commands for alignment.
6956
6957 @table @code
6958 @findex LABEL_ALIGN_AFTER_BARRIER
6959 @item LABEL_ALIGN_AFTER_BARRIER (@var{label})
6960 The alignment (log base 2) to put in front of @var{label}, which follows
6961 a BARRIER.
6962
6963 This macro need not be defined if you don't want any special alignment
6964 to be done at such a time.  Most machine descriptions do not currently
6965 define the macro.
6966
6967 Unless it's necessary to inspect the @var{label} parameter, it is better
6968 to set the variable @var{align_jumps} in the target's
6969 @code{OVERRIDE_OPTIONS}.  Otherwise, you should try to honour the user's
6970 selection in @var{align_jumps} in a @code{LABEL_ALIGN_AFTER_BARRIER}
6971 implementation.
6972
6973 @findex LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
6974 @item LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
6975 The maximum number of bytes to skip when applying
6976 @code{LABEL_ALIGN_AFTER_BARRIER}.  This works only if
6977 @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
6978
6979 @findex LOOP_ALIGN
6980 @item LOOP_ALIGN (@var{label})
6981 The alignment (log base 2) to put in front of @var{label}, which follows
6982 a NOTE_INSN_LOOP_BEG note.
6983
6984 This macro need not be defined if you don't want any special alignment
6985 to be done at such a time.  Most machine descriptions do not currently
6986 define the macro.
6987
6988 Unless it's necessary to inspect the @var{label} parameter, it is better
6989 to set the variable @var{align_loops} in the target's
6990 @code{OVERRIDE_OPTIONS}.  Otherwise, you should try to honour the user's
6991 selection in @var{align_loops} in a @code{LOOP_ALIGN} implementation.
6992
6993 @findex LOOP_ALIGN_MAX_SKIP
6994 @item LOOP_ALIGN_MAX_SKIP
6995 The maximum number of bytes to skip when applying @code{LOOP_ALIGN}.
6996 This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
6997
6998 @findex LABEL_ALIGN
6999 @item LABEL_ALIGN (@var{label})
7000 The alignment (log base 2) to put in front of @var{label}.
7001 If LABEL_ALIGN_AFTER_BARRIER / LOOP_ALIGN specify a different alignment,
7002 the maximum of the specified values is used.
7003
7004 Unless it's necessary to inspect the @var{label} parameter, it is better
7005 to set the variable @var{align_labels} in the target's
7006 @code{OVERRIDE_OPTIONS}.  Otherwise, you should try to honour the user's
7007 selection in @var{align_labels} in a @code{LABEL_ALIGN} implementation.
7008
7009 @findex LABEL_ALIGN_MAX_SKIP
7010 @item LABEL_ALIGN_MAX_SKIP
7011 The maximum number of bytes to skip when applying @code{LABEL_ALIGN}.
7012 This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
7013
7014 @findex ASM_OUTPUT_SKIP
7015 @item ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes})
7016 A C statement to output to the stdio stream @var{stream} an assembler
7017 instruction to advance the location counter by @var{nbytes} bytes.
7018 Those bytes should be zero when loaded.  @var{nbytes} will be a C
7019 expression of type @code{int}.
7020
7021 @findex ASM_NO_SKIP_IN_TEXT
7022 @item ASM_NO_SKIP_IN_TEXT
7023 Define this macro if @code{ASM_OUTPUT_SKIP} should not be used in the
7024 text section because it fails to put zeros in the bytes that are skipped.
7025 This is true on many Unix systems, where the pseudo--op to skip bytes
7026 produces no-op instructions rather than zeros when used in the text
7027 section.
7028
7029 @findex ASM_OUTPUT_ALIGN
7030 @item ASM_OUTPUT_ALIGN (@var{stream}, @var{power})
7031 A C statement to output to the stdio stream @var{stream} an assembler
7032 command to advance the location counter to a multiple of 2 to the
7033 @var{power} bytes.  @var{power} will be a C expression of type @code{int}.
7034
7035 @findex ASM_OUTPUT_MAX_SKIP_ALIGN
7036 @item ASM_OUTPUT_MAX_SKIP_ALIGN (@var{stream}, @var{power}, @var{max_skip})
7037 A C statement to output to the stdio stream @var{stream} an assembler
7038 command to advance the location counter to a multiple of 2 to the
7039 @var{power} bytes, but only if @var{max_skip} or fewer bytes are needed to
7040 satisfy the alignment request.  @var{power} and @var{max_skip} will be
7041 a C expression of type @code{int}.
7042 @end table
7043
7044 @need 3000
7045 @node Debugging Info
7046 @section Controlling Debugging Information Format
7047
7048 @c prevent bad page break with this line
7049 This describes how to specify debugging information.
7050
7051 @menu
7052 * All Debuggers::      Macros that affect all debugging formats uniformly.
7053 * DBX Options::        Macros enabling specific options in DBX format.
7054 * DBX Hooks::          Hook macros for varying DBX format.
7055 * File Names and DBX:: Macros controlling output of file names in DBX format.
7056 * SDB and DWARF::      Macros for SDB (COFF) and DWARF formats.
7057 @end menu
7058
7059 @node All Debuggers
7060 @subsection Macros Affecting All Debugging Formats
7061
7062 @c prevent bad page break with this line
7063 These macros affect all debugging formats.
7064
7065 @table @code
7066 @findex DBX_REGISTER_NUMBER
7067 @item DBX_REGISTER_NUMBER (@var{regno})
7068 A C expression that returns the DBX register number for the compiler
7069 register number @var{regno}.  In simple cases, the value of this
7070 expression may be @var{regno} itself.  But sometimes there are some
7071 registers that the compiler knows about and DBX does not, or vice
7072 versa.  In such cases, some register may need to have one number in
7073 the compiler and another for DBX.
7074
7075 If two registers have consecutive numbers inside GCC, and they can be
7076 used as a pair to hold a multiword value, then they @emph{must} have
7077 consecutive numbers after renumbering with @code{DBX_REGISTER_NUMBER}.
7078 Otherwise, debuggers will be unable to access such a pair, because they
7079 expect register pairs to be consecutive in their own numbering scheme.
7080
7081 If you find yourself defining @code{DBX_REGISTER_NUMBER} in way that
7082 does not preserve register pairs, then what you must do instead is
7083 redefine the actual register numbering scheme.
7084
7085 @findex DEBUGGER_AUTO_OFFSET
7086 @item DEBUGGER_AUTO_OFFSET (@var{x})
7087 A C expression that returns the integer offset value for an automatic
7088 variable having address @var{x} (an RTL expression).  The default
7089 computation assumes that @var{x} is based on the frame-pointer and
7090 gives the offset from the frame-pointer.  This is required for targets
7091 that produce debugging output for DBX or COFF-style debugging output
7092 for SDB and allow the frame-pointer to be eliminated when the
7093 @option{-g} options is used.
7094
7095 @findex DEBUGGER_ARG_OFFSET
7096 @item DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
7097 A C expression that returns the integer offset value for an argument
7098 having address @var{x} (an RTL expression).  The nominal offset is
7099 @var{offset}.
7100
7101 @findex PREFERRED_DEBUGGING_TYPE
7102 @item PREFERRED_DEBUGGING_TYPE
7103 A C expression that returns the type of debugging output GCC should
7104 produce when the user specifies just @option{-g}.  Define
7105 this if you have arranged for GCC to support more than one format of
7106 debugging output.  Currently, the allowable values are @code{DBX_DEBUG},
7107 @code{SDB_DEBUG}, @code{DWARF_DEBUG}, @code{DWARF2_DEBUG}, and
7108 @code{XCOFF_DEBUG}.
7109
7110 When the user specifies @option{-ggdb}, GCC normally also uses the
7111 value of this macro to select the debugging output format, but with two
7112 exceptions.  If @code{DWARF2_DEBUGGING_INFO} is defined and
7113 @code{LINKER_DOES_NOT_WORK_WITH_DWARF2} is not defined, GCC uses the
7114 value @code{DWARF2_DEBUG}.  Otherwise, if @code{DBX_DEBUGGING_INFO} is
7115 defined, GCC uses @code{DBX_DEBUG}.
7116
7117 The value of this macro only affects the default debugging output; the
7118 user can always get a specific type of output by using @option{-gstabs},
7119 @option{-gcoff}, @option{-gdwarf-1}, @option{-gdwarf-2}, or @option{-gxcoff}.
7120 @end table
7121
7122 @node DBX Options
7123 @subsection Specific Options for DBX Output
7124
7125 @c prevent bad page break with this line
7126 These are specific options for DBX output.
7127
7128 @table @code
7129 @findex DBX_DEBUGGING_INFO
7130 @item DBX_DEBUGGING_INFO
7131 Define this macro if GCC should produce debugging output for DBX
7132 in response to the @option{-g} option.
7133
7134 @findex XCOFF_DEBUGGING_INFO
7135 @item XCOFF_DEBUGGING_INFO
7136 Define this macro if GCC should produce XCOFF format debugging output
7137 in response to the @option{-g} option.  This is a variant of DBX format.
7138
7139 @findex DEFAULT_GDB_EXTENSIONS
7140 @item DEFAULT_GDB_EXTENSIONS
7141 Define this macro to control whether GCC should by default generate
7142 GDB's extended version of DBX debugging information (assuming DBX-format
7143 debugging information is enabled at all).  If you don't define the
7144 macro, the default is 1: always generate the extended information
7145 if there is any occasion to.
7146
7147 @findex DEBUG_SYMS_TEXT
7148 @item DEBUG_SYMS_TEXT
7149 Define this macro if all @code{.stabs} commands should be output while
7150 in the text section.
7151
7152 @findex ASM_STABS_OP
7153 @item ASM_STABS_OP
7154 A C string constant, including spacing, naming the assembler pseudo op to
7155 use instead of @code{"\t.stabs\t"} to define an ordinary debugging symbol.
7156 If you don't define this macro, @code{"\t.stabs\t"} is used.  This macro
7157 applies only to DBX debugging information format.
7158
7159 @findex ASM_STABD_OP
7160 @item ASM_STABD_OP
7161 A C string constant, including spacing, naming the assembler pseudo op to
7162 use instead of @code{"\t.stabd\t"} to define a debugging symbol whose
7163 value is the current location.  If you don't define this macro,
7164 @code{"\t.stabd\t"} is used.  This macro applies only to DBX debugging
7165 information format.
7166
7167 @findex ASM_STABN_OP
7168 @item ASM_STABN_OP
7169 A C string constant, including spacing, naming the assembler pseudo op to
7170 use instead of @code{"\t.stabn\t"} to define a debugging symbol with no
7171 name.  If you don't define this macro, @code{"\t.stabn\t"} is used.  This
7172 macro applies only to DBX debugging information format.
7173
7174 @findex DBX_NO_XREFS
7175 @item DBX_NO_XREFS
7176 Define this macro if DBX on your system does not support the construct
7177 @samp{xs@var{tagname}}.  On some systems, this construct is used to
7178 describe a forward reference to a structure named @var{tagname}.
7179 On other systems, this construct is not supported at all.
7180
7181 @findex DBX_CONTIN_LENGTH
7182 @item DBX_CONTIN_LENGTH
7183 A symbol name in DBX-format debugging information is normally
7184 continued (split into two separate @code{.stabs} directives) when it
7185 exceeds a certain length (by default, 80 characters).  On some
7186 operating systems, DBX requires this splitting; on others, splitting
7187 must not be done.  You can inhibit splitting by defining this macro
7188 with the value zero.  You can override the default splitting-length by
7189 defining this macro as an expression for the length you desire.
7190
7191 @findex DBX_CONTIN_CHAR
7192 @item DBX_CONTIN_CHAR
7193 Normally continuation is indicated by adding a @samp{\} character to
7194 the end of a @code{.stabs} string when a continuation follows.  To use
7195 a different character instead, define this macro as a character
7196 constant for the character you want to use.  Do not define this macro
7197 if backslash is correct for your system.
7198
7199 @findex DBX_STATIC_STAB_DATA_SECTION
7200 @item DBX_STATIC_STAB_DATA_SECTION
7201 Define this macro if it is necessary to go to the data section before
7202 outputting the @samp{.stabs} pseudo-op for a non-global static
7203 variable.
7204
7205 @findex DBX_TYPE_DECL_STABS_CODE
7206 @item DBX_TYPE_DECL_STABS_CODE
7207 The value to use in the ``code'' field of the @code{.stabs} directive
7208 for a typedef.  The default is @code{N_LSYM}.
7209
7210 @findex DBX_STATIC_CONST_VAR_CODE
7211 @item DBX_STATIC_CONST_VAR_CODE
7212 The value to use in the ``code'' field of the @code{.stabs} directive
7213 for a static variable located in the text section.  DBX format does not
7214 provide any ``right'' way to do this.  The default is @code{N_FUN}.
7215
7216 @findex DBX_REGPARM_STABS_CODE
7217 @item DBX_REGPARM_STABS_CODE
7218 The value to use in the ``code'' field of the @code{.stabs} directive
7219 for a parameter passed in registers.  DBX format does not provide any
7220 ``right'' way to do this.  The default is @code{N_RSYM}.
7221
7222 @findex DBX_REGPARM_STABS_LETTER
7223 @item DBX_REGPARM_STABS_LETTER
7224 The letter to use in DBX symbol data to identify a symbol as a parameter
7225 passed in registers.  DBX format does not customarily provide any way to
7226 do this.  The default is @code{'P'}.
7227
7228 @findex DBX_MEMPARM_STABS_LETTER
7229 @item DBX_MEMPARM_STABS_LETTER
7230 The letter to use in DBX symbol data to identify a symbol as a stack
7231 parameter.  The default is @code{'p'}.
7232
7233 @findex DBX_FUNCTION_FIRST
7234 @item DBX_FUNCTION_FIRST
7235 Define this macro if the DBX information for a function and its
7236 arguments should precede the assembler code for the function.  Normally,
7237 in DBX format, the debugging information entirely follows the assembler
7238 code.
7239
7240 @findex DBX_LBRAC_FIRST
7241 @item DBX_LBRAC_FIRST
7242 Define this macro if the @code{N_LBRAC} symbol for a block should
7243 precede the debugging information for variables and functions defined in
7244 that block.  Normally, in DBX format, the @code{N_LBRAC} symbol comes
7245 first.
7246
7247 @findex DBX_BLOCKS_FUNCTION_RELATIVE
7248 @item DBX_BLOCKS_FUNCTION_RELATIVE
7249 Define this macro if the value of a symbol describing the scope of a
7250 block (@code{N_LBRAC} or @code{N_RBRAC}) should be relative to the start
7251 of the enclosing function.  Normally, GNU C uses an absolute address.
7252
7253 @findex DBX_USE_BINCL
7254 @item DBX_USE_BINCL
7255 Define this macro if GNU C should generate @code{N_BINCL} and
7256 @code{N_EINCL} stabs for included header files, as on Sun systems.  This
7257 macro also directs GNU C to output a type number as a pair of a file
7258 number and a type number within the file.  Normally, GNU C does not
7259 generate @code{N_BINCL} or @code{N_EINCL} stabs, and it outputs a single
7260 number for a type number.
7261 @end table
7262
7263 @node DBX Hooks
7264 @subsection Open-Ended Hooks for DBX Format
7265
7266 @c prevent bad page break with this line
7267 These are hooks for DBX format.
7268
7269 @table @code
7270 @findex DBX_OUTPUT_LBRAC
7271 @item DBX_OUTPUT_LBRAC (@var{stream}, @var{name})
7272 Define this macro to say how to output to @var{stream} the debugging
7273 information for the start of a scope level for variable names.  The
7274 argument @var{name} is the name of an assembler symbol (for use with
7275 @code{assemble_name}) whose value is the address where the scope begins.
7276
7277 @findex DBX_OUTPUT_RBRAC
7278 @item DBX_OUTPUT_RBRAC (@var{stream}, @var{name})
7279 Like @code{DBX_OUTPUT_LBRAC}, but for the end of a scope level.
7280
7281 @findex DBX_OUTPUT_ENUM
7282 @item DBX_OUTPUT_ENUM (@var{stream}, @var{type})
7283 Define this macro if the target machine requires special handling to
7284 output an enumeration type.  The definition should be a C statement
7285 (sans semicolon) to output the appropriate information to @var{stream}
7286 for the type @var{type}.
7287
7288 @findex DBX_OUTPUT_FUNCTION_END
7289 @item DBX_OUTPUT_FUNCTION_END (@var{stream}, @var{function})
7290 Define this macro if the target machine requires special output at the
7291 end of the debugging information for a function.  The definition should
7292 be a C statement (sans semicolon) to output the appropriate information
7293 to @var{stream}.  @var{function} is the @code{FUNCTION_DECL} node for
7294 the function.
7295
7296 @findex DBX_OUTPUT_STANDARD_TYPES
7297 @item DBX_OUTPUT_STANDARD_TYPES (@var{syms})
7298 Define this macro if you need to control the order of output of the
7299 standard data types at the beginning of compilation.  The argument
7300 @var{syms} is a @code{tree} which is a chain of all the predefined
7301 global symbols, including names of data types.
7302
7303 Normally, DBX output starts with definitions of the types for integers
7304 and characters, followed by all the other predefined types of the
7305 particular language in no particular order.
7306
7307 On some machines, it is necessary to output different particular types
7308 first.  To do this, define @code{DBX_OUTPUT_STANDARD_TYPES} to output
7309 those symbols in the necessary order.  Any predefined types that you
7310 don't explicitly output will be output afterward in no particular order.
7311
7312 Be careful not to define this macro so that it works only for C.  There
7313 are no global variables to access most of the built-in types, because
7314 another language may have another set of types.  The way to output a
7315 particular type is to look through @var{syms} to see if you can find it.
7316 Here is an example:
7317
7318 @smallexample
7319 @{
7320   tree decl;
7321   for (decl = syms; decl; decl = TREE_CHAIN (decl))
7322     if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
7323                  "long int"))
7324       dbxout_symbol (decl);
7325   @dots{}
7326 @}
7327 @end smallexample
7328
7329 @noindent
7330 This does nothing if the expected type does not exist.
7331
7332 See the function @code{init_decl_processing} in @file{c-decl.c} to find
7333 the names to use for all the built-in C types.
7334
7335 Here is another way of finding a particular type:
7336
7337 @c this is still overfull.  --mew 10feb93
7338 @smallexample
7339 @{
7340   tree decl;
7341   for (decl = syms; decl; decl = TREE_CHAIN (decl))
7342     if (TREE_CODE (decl) == TYPE_DECL
7343         && (TREE_CODE (TREE_TYPE (decl))
7344             == INTEGER_CST)
7345         && TYPE_PRECISION (TREE_TYPE (decl)) == 16
7346         && TYPE_UNSIGNED (TREE_TYPE (decl)))
7347 @group
7348       /* @r{This must be @code{unsigned short}.}  */
7349       dbxout_symbol (decl);
7350   @dots{}
7351 @}
7352 @end group
7353 @end smallexample
7354
7355 @findex NO_DBX_FUNCTION_END
7356 @item NO_DBX_FUNCTION_END
7357 Some stabs encapsulation formats (in particular ECOFF), cannot handle the
7358 @code{.stabs "",N_FUN,,0,0,Lscope-function-1} gdb dbx extension construct.
7359 On those machines, define this macro to turn this feature off without
7360 disturbing the rest of the gdb extensions.
7361
7362 @end table
7363
7364 @node File Names and DBX
7365 @subsection File Names in DBX Format
7366
7367 @c prevent bad page break with this line
7368 This describes file names in DBX format.
7369
7370 @table @code
7371 @findex DBX_WORKING_DIRECTORY
7372 @item DBX_WORKING_DIRECTORY
7373 Define this if DBX wants to have the current directory recorded in each
7374 object file.
7375
7376 Note that the working directory is always recorded if GDB extensions are
7377 enabled.
7378
7379 @findex DBX_OUTPUT_MAIN_SOURCE_FILENAME
7380 @item DBX_OUTPUT_MAIN_SOURCE_FILENAME (@var{stream}, @var{name})
7381 A C statement to output DBX debugging information to the stdio stream
7382 @var{stream} which indicates that file @var{name} is the main source
7383 file---the file specified as the input file for compilation.
7384 This macro is called only once, at the beginning of compilation.
7385
7386 This macro need not be defined if the standard form of output
7387 for DBX debugging information is appropriate.
7388
7389 @findex DBX_OUTPUT_MAIN_SOURCE_DIRECTORY
7390 @item DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (@var{stream}, @var{name})
7391 A C statement to output DBX debugging information to the stdio stream
7392 @var{stream} which indicates that the current directory during
7393 compilation is named @var{name}.
7394
7395 This macro need not be defined if the standard form of output
7396 for DBX debugging information is appropriate.
7397
7398 @findex DBX_OUTPUT_MAIN_SOURCE_FILE_END
7399 @item DBX_OUTPUT_MAIN_SOURCE_FILE_END (@var{stream}, @var{name})
7400 A C statement to output DBX debugging information at the end of
7401 compilation of the main source file @var{name}.
7402
7403 If you don't define this macro, nothing special is output at the end
7404 of compilation, which is correct for most machines.
7405
7406 @findex DBX_OUTPUT_SOURCE_FILENAME
7407 @item DBX_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
7408 A C statement to output DBX debugging information to the stdio stream
7409 @var{stream} which indicates that file @var{name} is the current source
7410 file.  This output is generated each time input shifts to a different
7411 source file as a result of @samp{#include}, the end of an included file,
7412 or a @samp{#line} command.
7413
7414 This macro need not be defined if the standard form of output
7415 for DBX debugging information is appropriate.
7416 @end table
7417
7418 @need 2000
7419 @node SDB and DWARF
7420 @subsection Macros for SDB and DWARF Output
7421
7422 @c prevent bad page break with this line
7423 Here are macros for SDB and DWARF output.
7424
7425 @table @code
7426 @findex SDB_DEBUGGING_INFO
7427 @item SDB_DEBUGGING_INFO
7428 Define this macro if GCC should produce COFF-style debugging output
7429 for SDB in response to the @option{-g} option.
7430
7431 @findex DWARF_DEBUGGING_INFO
7432 @item DWARF_DEBUGGING_INFO
7433 Define this macro if GCC should produce dwarf format debugging output
7434 in response to the @option{-g} option.
7435
7436 @findex DWARF2_DEBUGGING_INFO
7437 @item DWARF2_DEBUGGING_INFO
7438 Define this macro if GCC should produce dwarf version 2 format
7439 debugging output in response to the @option{-g} option.
7440
7441 To support optional call frame debugging information, you must also
7442 define @code{INCOMING_RETURN_ADDR_RTX} and either set
7443 @code{RTX_FRAME_RELATED_P} on the prologue insns if you use RTL for the
7444 prologue, or call @code{dwarf2out_def_cfa} and @code{dwarf2out_reg_save}
7445 as appropriate from @code{FUNCTION_PROLOGUE} if you don't.
7446
7447 @findex DWARF2_FRAME_INFO
7448 @item DWARF2_FRAME_INFO
7449 Define this macro to a nonzero value if GCC should always output
7450 Dwarf 2 frame information.  If @code{DWARF2_UNWIND_INFO}
7451 (@pxref{Exception Region Output} is nonzero, GCC will output this
7452 information not matter how you define @code{DWARF2_FRAME_INFO}.
7453
7454 @findex LINKER_DOES_NOT_WORK_WITH_DWARF2
7455 @item LINKER_DOES_NOT_WORK_WITH_DWARF2
7456 Define this macro if the linker does not work with Dwarf version 2.
7457 Normally, if the user specifies only @option{-ggdb} GCC will use Dwarf
7458 version 2 if available; this macro disables this.  See the description
7459 of the @code{PREFERRED_DEBUGGING_TYPE} macro for more details.
7460
7461 @findex DWARF2_GENERATE_TEXT_SECTION_LABEL
7462 @item DWARF2_GENERATE_TEXT_SECTION_LABEL
7463 By default, the Dwarf 2 debugging information generator will generate a
7464 label to mark the beginning of the text section.  If it is better simply
7465 to use the name of the text section itself, rather than an explicit label,
7466 to indicate the beginning of the text section, define this macro to zero.
7467
7468 @findex DWARF2_ASM_LINE_DEBUG_INFO
7469 @item DWARF2_ASM_LINE_DEBUG_INFO
7470 Define this macro to be a nonzero value if the assembler can generate Dwarf 2
7471 line debug info sections.  This will result in much more compact line number
7472 tables, and hence is desirable if it works.
7473
7474 @findex PUT_SDB_@dots{}
7475 @item PUT_SDB_@dots{}
7476 Define these macros to override the assembler syntax for the special
7477 SDB assembler directives.  See @file{sdbout.c} for a list of these
7478 macros and their arguments.  If the standard syntax is used, you need
7479 not define them yourself.
7480
7481 @findex SDB_DELIM
7482 @item SDB_DELIM
7483 Some assemblers do not support a semicolon as a delimiter, even between
7484 SDB assembler directives.  In that case, define this macro to be the
7485 delimiter to use (usually @samp{\n}).  It is not necessary to define
7486 a new set of @code{PUT_SDB_@var{op}} macros if this is the only change
7487 required.
7488
7489 @findex SDB_GENERATE_FAKE
7490 @item SDB_GENERATE_FAKE
7491 Define this macro to override the usual method of constructing a dummy
7492 name for anonymous structure and union types.  See @file{sdbout.c} for
7493 more information.
7494
7495 @findex SDB_ALLOW_UNKNOWN_REFERENCES
7496 @item SDB_ALLOW_UNKNOWN_REFERENCES
7497 Define this macro to allow references to unknown structure,
7498 union, or enumeration tags to be emitted.  Standard COFF does not
7499 allow handling of unknown references, MIPS ECOFF has support for
7500 it.
7501
7502 @findex SDB_ALLOW_FORWARD_REFERENCES
7503 @item SDB_ALLOW_FORWARD_REFERENCES
7504 Define this macro to allow references to structure, union, or
7505 enumeration tags that have not yet been seen to be handled.  Some
7506 assemblers choke if forward tags are used, while some require it.
7507 @end table
7508
7509 @node Cross-compilation
7510 @section Cross Compilation and Floating Point
7511 @cindex cross compilation and floating point
7512 @cindex floating point and cross compilation
7513
7514 While all modern machines use 2's complement representation for integers,
7515 there are a variety of representations for floating point numbers.  This
7516 means that in a cross-compiler the representation of floating point numbers
7517 in the compiled program may be different from that used in the machine
7518 doing the compilation.
7519
7520 @findex atof
7521 Because different representation systems may offer different amounts of
7522 range and precision, the cross compiler cannot safely use the host
7523 machine's floating point arithmetic.  Therefore, floating point constants
7524 must be represented in the target machine's format.  This means that the
7525 cross compiler cannot use @code{atof} to parse a floating point constant;
7526 it must have its own special routine to use instead.  Also, constant
7527 folding must emulate the target machine's arithmetic (or must not be done
7528 at all).
7529
7530 The macros in the following table should be defined only if you are cross
7531 compiling between different floating point formats.
7532
7533 Otherwise, don't define them.  Then default definitions will be set up which
7534 use @code{double} as the data type, @code{==} to test for equality, etc.
7535
7536 You don't need to worry about how many times you use an operand of any
7537 of these macros.  The compiler never uses operands which have side effects.
7538
7539 @table @code
7540 @findex REAL_VALUE_TYPE
7541 @item REAL_VALUE_TYPE
7542 A macro for the C data type to be used to hold a floating point value
7543 in the target machine's format.  Typically this would be a
7544 @code{struct} containing an array of @code{int}.
7545
7546 @findex REAL_VALUES_EQUAL
7547 @item REAL_VALUES_EQUAL (@var{x}, @var{y})
7548 A macro for a C expression which compares for equality the two values,
7549 @var{x} and @var{y}, both of type @code{REAL_VALUE_TYPE}.
7550
7551 @findex REAL_VALUES_LESS
7552 @item REAL_VALUES_LESS (@var{x}, @var{y})
7553 A macro for a C expression which tests whether @var{x} is less than
7554 @var{y}, both values being of type @code{REAL_VALUE_TYPE} and
7555 interpreted as floating point numbers in the target machine's
7556 representation.
7557
7558 @findex REAL_VALUE_LDEXP
7559 @findex ldexp
7560 @item REAL_VALUE_LDEXP (@var{x}, @var{scale})
7561 A macro for a C expression which performs the standard library
7562 function @code{ldexp}, but using the target machine's floating point
7563 representation.  Both @var{x} and the value of the expression have
7564 type @code{REAL_VALUE_TYPE}.  The second argument, @var{scale}, is an
7565 integer.
7566
7567 @findex REAL_VALUE_FIX
7568 @item REAL_VALUE_FIX (@var{x})
7569 A macro whose definition is a C expression to convert the target-machine
7570 floating point value @var{x} to a signed integer.  @var{x} has type
7571 @code{REAL_VALUE_TYPE}.
7572
7573 @findex REAL_VALUE_UNSIGNED_FIX
7574 @item REAL_VALUE_UNSIGNED_FIX (@var{x})
7575 A macro whose definition is a C expression to convert the target-machine
7576 floating point value @var{x} to an unsigned integer.  @var{x} has type
7577 @code{REAL_VALUE_TYPE}.
7578
7579 @findex REAL_VALUE_RNDZINT
7580 @item REAL_VALUE_RNDZINT (@var{x})
7581 A macro whose definition is a C expression to round the target-machine
7582 floating point value @var{x} towards zero to an integer value (but still
7583 as a floating point number).  @var{x} has type @code{REAL_VALUE_TYPE},
7584 and so does the value.
7585
7586 @findex REAL_VALUE_UNSIGNED_RNDZINT
7587 @item REAL_VALUE_UNSIGNED_RNDZINT (@var{x})
7588 A macro whose definition is a C expression to round the target-machine
7589 floating point value @var{x} towards zero to an unsigned integer value
7590 (but still represented as a floating point number).  @var{x} has type
7591 @code{REAL_VALUE_TYPE}, and so does the value.
7592
7593 @findex REAL_VALUE_ATOF
7594 @item REAL_VALUE_ATOF (@var{string}, @var{mode})
7595 A macro for a C expression which converts @var{string}, an expression of
7596 type @code{char *}, into a floating point number in the target machine's
7597 representation for mode @var{mode}.  The value has type
7598 @code{REAL_VALUE_TYPE}.
7599
7600 @findex REAL_INFINITY
7601 @item REAL_INFINITY
7602 Define this macro if infinity is a possible floating point value, and
7603 therefore division by 0 is legitimate.
7604
7605 @findex REAL_VALUE_ISINF
7606 @findex isinf
7607 @item REAL_VALUE_ISINF (@var{x})
7608 A macro for a C expression which determines whether @var{x}, a floating
7609 point value, is infinity.  The value has type @code{int}.
7610 By default, this is defined to call @code{isinf}.
7611
7612 @findex REAL_VALUE_ISNAN
7613 @findex isnan
7614 @item REAL_VALUE_ISNAN (@var{x})
7615 A macro for a C expression which determines whether @var{x}, a floating
7616 point value, is a ``nan'' (not-a-number).  The value has type
7617 @code{int}.  By default, this is defined to call @code{isnan}.
7618 @end table
7619
7620 @cindex constant folding and floating point
7621 Define the following additional macros if you want to make floating
7622 point constant folding work while cross compiling.  If you don't
7623 define them, cross compilation is still possible, but constant folding
7624 will not happen for floating point values.
7625
7626 @table @code
7627 @findex REAL_ARITHMETIC
7628 @item REAL_ARITHMETIC (@var{output}, @var{code}, @var{x}, @var{y})
7629 A macro for a C statement which calculates an arithmetic operation of
7630 the two floating point values @var{x} and @var{y}, both of type
7631 @code{REAL_VALUE_TYPE} in the target machine's representation, to
7632 produce a result of the same type and representation which is stored
7633 in @var{output} (which will be a variable).
7634
7635 The operation to be performed is specified by @var{code}, a tree code
7636 which will always be one of the following: @code{PLUS_EXPR},
7637 @code{MINUS_EXPR}, @code{MULT_EXPR}, @code{RDIV_EXPR},
7638 @code{MAX_EXPR}, @code{MIN_EXPR}.@refill
7639
7640 @cindex overflow while constant folding
7641 The expansion of this macro is responsible for checking for overflow.
7642 If overflow happens, the macro expansion should execute the statement
7643 @code{return 0;}, which indicates the inability to perform the
7644 arithmetic operation requested.
7645
7646 @findex REAL_VALUE_NEGATE
7647 @item REAL_VALUE_NEGATE (@var{x})
7648 A macro for a C expression which returns the negative of the floating
7649 point value @var{x}.  Both @var{x} and the value of the expression
7650 have type @code{REAL_VALUE_TYPE} and are in the target machine's
7651 floating point representation.
7652
7653 There is no way for this macro to report overflow, since overflow
7654 can't happen in the negation operation.
7655
7656 @findex REAL_VALUE_TRUNCATE
7657 @item REAL_VALUE_TRUNCATE (@var{mode}, @var{x})
7658 A macro for a C expression which converts the floating point value
7659 @var{x} to mode @var{mode}.
7660
7661 Both @var{x} and the value of the expression are in the target machine's
7662 floating point representation and have type @code{REAL_VALUE_TYPE}.
7663 However, the value should have an appropriate bit pattern to be output
7664 properly as a floating constant whose precision accords with mode
7665 @var{mode}.
7666
7667 There is no way for this macro to report overflow.
7668
7669 @findex REAL_VALUE_TO_INT
7670 @item REAL_VALUE_TO_INT (@var{low}, @var{high}, @var{x})
7671 A macro for a C expression which converts a floating point value
7672 @var{x} into a double-precision integer which is then stored into
7673 @var{low} and @var{high}, two variables of type @var{int}.
7674
7675 @item REAL_VALUE_FROM_INT (@var{x}, @var{low}, @var{high}, @var{mode})
7676 @findex REAL_VALUE_FROM_INT
7677 A macro for a C expression which converts a double-precision integer
7678 found in @var{low} and @var{high}, two variables of type @var{int},
7679 into a floating point value which is then stored into @var{x}.
7680 The value is in the target machine's representation for mode @var{mode}
7681 and has the type @code{REAL_VALUE_TYPE}.
7682 @end table
7683
7684 @node Mode Switching
7685 @section Mode Switching Instructions
7686 @cindex mode switching
7687 The following macros control mode switching optimizations:
7688
7689 @table @code
7690 @findex OPTIMIZE_MODE_SWITCHING
7691 @item OPTIMIZE_MODE_SWITCHING (@var{entity})
7692 Define this macro if the port needs extra instructions inserted for mode
7693 switching in an optimizing compilation.
7694
7695 For an example, the SH4 can perform both single and double precision
7696 floating point operations, but to perform a single precision operation,
7697 the FPSCR PR bit has to be cleared, while for a double precision
7698 operation, this bit has to be set.  Changing the PR bit requires a general
7699 purpose register as a scratch register, hence these FPSCR sets have to
7700 be inserted before reload, i.e. you can't put this into instruction emitting
7701 or MACHINE_DEPENDENT_REORG.
7702
7703 You can have multiple entities that are mode-switched, and select at run time
7704 which entities actually need it.  @code{OPTIMIZE_MODE_SWITCHING} should
7705 return non-zero for any @var{entity} that that needs mode-switching.
7706 If you define this macro, you also have to define
7707 @code{NUM_MODES_FOR_MODE_SWITCHING}, @code{MODE_NEEDED},
7708 @code{MODE_PRIORITY_TO_MODE} and @code{EMIT_MODE_SET}.
7709 @code{NORMAL_MODE} is optional.
7710
7711 @findex NUM_MODES_FOR_MODE_SWITCHING
7712 @item NUM_MODES_FOR_MODE_SWITCHING
7713 If you define @code{OPTIMIZE_MODE_SWITCHING}, you have to define this as
7714 initializer for an array of integers.  Each initializer element
7715 N refers to an entity that needs mode switching, and specifies the number
7716 of different modes that might need to be set for this entity.
7717 The position of the initializer in the initializer - starting counting at
7718 zero - determines the integer that is used to refer to the mode-switched
7719 entity in question.
7720 In macros that take mode arguments / yield a mode result, modes are
7721 represented as numbers 0 @dots{} N @minus{} 1.  N is used to specify that no mode
7722 switch is needed / supplied.
7723
7724 @findex MODE_NEEDED
7725 @item MODE_NEEDED (@var{entity}, @var{insn})
7726 @var{entity} is an integer specifying a mode-switched entity.  If
7727 @code{OPTIMIZE_MODE_SWITCHING} is defined, you must define this macro to
7728 return an integer value not larger than the corresponding element in
7729 NUM_MODES_FOR_MODE_SWITCHING, to denote the mode that @var{entity} must
7730 be switched into prior to the execution of INSN.
7731
7732 @findex NORMAL_MODE
7733 @item NORMAL_MODE (@var{entity})
7734 If this macro is defined, it is evaluated for every @var{entity} that needs
7735 mode switching.  It should evaluate to an integer, which is a mode that
7736 @var{entity} is assumed to be switched to at function entry and exit.
7737
7738 @findex MODE_PRIORITY_TO_MODE
7739 @item MODE_PRIORITY_TO_MODE (@var{entity}, @var{n})
7740 This macro specifies the order in which modes for ENTITY are processed.
7741 0 is the highest priority, NUM_MODES_FOR_MODE_SWITCHING[ENTITY] - 1 the
7742 lowest.  The value of the macro should be an integer designating a mode
7743 for ENTITY.  For any fixed @var{entity}, @code{mode_priority_to_mode}
7744 (@var{entity}, @var{n}) shall be a bijection in 0 @dots{}
7745 @code{num_modes_for_mode_switching}[@var{entity}] @minus{} 1 .
7746
7747 @findex EMIT_MODE_SET
7748 @item EMIT_MODE_SET (@var{entity}, @var{mode}, @var{hard_regs_live})
7749 Generate one or more insns to set @var{entity} to @var{mode}.
7750 @var{hard_reg_live} is the set of hard registers live at the point where
7751 the insn(s) are to be inserted.
7752 @end table
7753
7754 @node Misc
7755 @section Miscellaneous Parameters
7756 @cindex parameters, miscellaneous
7757
7758 @c prevent bad page break with this line
7759 Here are several miscellaneous parameters.
7760
7761 @table @code
7762 @item PREDICATE_CODES
7763 @findex PREDICATE_CODES
7764 Define this if you have defined special-purpose predicates in the file
7765 @file{@var{machine}.c}.  This macro is called within an initializer of an
7766 array of structures.  The first field in the structure is the name of a
7767 predicate and the second field is an array of rtl codes.  For each
7768 predicate, list all rtl codes that can be in expressions matched by the
7769 predicate.  The list should have a trailing comma.  Here is an example
7770 of two entries in the list for a typical RISC machine:
7771
7772 @smallexample
7773 #define PREDICATE_CODES \
7774   @{"gen_reg_rtx_operand", @{SUBREG, REG@}@},  \
7775   @{"reg_or_short_cint_operand", @{SUBREG, REG, CONST_INT@}@},
7776 @end smallexample
7777
7778 Defining this macro does not affect the generated code (however,
7779 incorrect definitions that omit an rtl code that may be matched by the
7780 predicate can cause the compiler to malfunction).  Instead, it allows
7781 the table built by @file{genrecog} to be more compact and efficient,
7782 thus speeding up the compiler.  The most important predicates to include
7783 in the list specified by this macro are those used in the most insn
7784 patterns.
7785
7786 For each predicate function named in @var{PREDICATE_CODES}, a
7787 declaration will be generated in @file{insn-codes.h}.
7788
7789 @item SPECIAL_MODE_PREDICATES
7790 @findex SPECIAL_MODE_PREDICATES
7791 Define this if you have special predicates that know special things
7792 about modes.  Genrecog will warn about certain forms of
7793 @code{match_operand} without a mode; if the operand predicate is
7794 listed in @code{SPECIAL_MODE_PREDICATES}, the warning will be
7795 suppressed.
7796
7797 Here is an example from the IA-32 port (@code{ext_register_operand}
7798 specially checks for @code{HImode} or @code{SImode} in preparation
7799 for a byte extraction from @code{%ah} etc.).
7800
7801 @smallexample
7802 #define SPECIAL_MODE_PREDICATES \
7803   "ext_register_operand",
7804 @end smallexample
7805
7806 @findex CASE_VECTOR_MODE
7807 @item CASE_VECTOR_MODE
7808 An alias for a machine mode name.  This is the machine mode that
7809 elements of a jump-table should have.
7810
7811 @findex CASE_VECTOR_SHORTEN_MODE
7812 @item CASE_VECTOR_SHORTEN_MODE (@var{min_offset}, @var{max_offset}, @var{body})
7813 Optional: return the preferred mode for an @code{addr_diff_vec}
7814 when the minimum and maximum offset are known.  If you define this,
7815 it enables extra code in branch shortening to deal with @code{addr_diff_vec}.
7816 To make this work, you also have to define INSN_ALIGN and
7817 make the alignment for @code{addr_diff_vec} explicit.
7818 The @var{body} argument is provided so that the offset_unsigned and scale
7819 flags can be updated.
7820
7821 @findex CASE_VECTOR_PC_RELATIVE
7822 @item CASE_VECTOR_PC_RELATIVE
7823 Define this macro to be a C expression to indicate when jump-tables
7824 should contain relative addresses.  If jump-tables never contain
7825 relative addresses, then you need not define this macro.
7826
7827 @findex CASE_DROPS_THROUGH
7828 @item CASE_DROPS_THROUGH
7829 Define this if control falls through a @code{case} insn when the index
7830 value is out of range.  This means the specified default-label is
7831 actually ignored by the @code{case} insn proper.
7832
7833 @findex CASE_VALUES_THRESHOLD
7834 @item CASE_VALUES_THRESHOLD
7835 Define this to be the smallest number of different values for which it
7836 is best to use a jump-table instead of a tree of conditional branches.
7837 The default is four for machines with a @code{casesi} instruction and
7838 five otherwise.  This is best for most machines.
7839
7840 @findex WORD_REGISTER_OPERATIONS
7841 @item WORD_REGISTER_OPERATIONS
7842 Define this macro if operations between registers with integral mode
7843 smaller than a word are always performed on the entire register.
7844 Most RISC machines have this property and most CISC machines do not.
7845
7846 @findex LOAD_EXTEND_OP
7847 @item LOAD_EXTEND_OP (@var{mode})
7848 Define this macro to be a C expression indicating when insns that read
7849 memory in @var{mode}, an integral mode narrower than a word, set the
7850 bits outside of @var{mode} to be either the sign-extension or the
7851 zero-extension of the data read.  Return @code{SIGN_EXTEND} for values
7852 of @var{mode} for which the
7853 insn sign-extends, @code{ZERO_EXTEND} for which it zero-extends, and
7854 @code{NIL} for other modes.
7855
7856 This macro is not called with @var{mode} non-integral or with a width
7857 greater than or equal to @code{BITS_PER_WORD}, so you may return any
7858 value in this case.  Do not define this macro if it would always return
7859 @code{NIL}.  On machines where this macro is defined, you will normally
7860 define it as the constant @code{SIGN_EXTEND} or @code{ZERO_EXTEND}.
7861
7862 @findex SHORT_IMMEDIATES_SIGN_EXTEND
7863 @item SHORT_IMMEDIATES_SIGN_EXTEND
7864 Define this macro if loading short immediate values into registers sign
7865 extends.
7866
7867 @findex IMPLICIT_FIX_EXPR
7868 @item IMPLICIT_FIX_EXPR
7869 An alias for a tree code that should be used by default for conversion
7870 of floating point values to fixed point.  Normally,
7871 @code{FIX_ROUND_EXPR} is used.@refill
7872
7873 @findex FIXUNS_TRUNC_LIKE_FIX_TRUNC
7874 @item FIXUNS_TRUNC_LIKE_FIX_TRUNC
7875 Define this macro if the same instructions that convert a floating
7876 point number to a signed fixed point number also convert validly to an
7877 unsigned one.
7878
7879 @findex EASY_DIV_EXPR
7880 @item EASY_DIV_EXPR
7881 An alias for a tree code that is the easiest kind of division to
7882 compile code for in the general case.  It may be
7883 @code{TRUNC_DIV_EXPR}, @code{FLOOR_DIV_EXPR}, @code{CEIL_DIV_EXPR} or
7884 @code{ROUND_DIV_EXPR}.  These four division operators differ in how
7885 they round the result to an integer.  @code{EASY_DIV_EXPR} is used
7886 when it is permissible to use any of those kinds of division and the
7887 choice should be made on the basis of efficiency.@refill
7888
7889 @findex MOVE_MAX
7890 @item MOVE_MAX
7891 The maximum number of bytes that a single instruction can move quickly
7892 between memory and registers or between two memory locations.
7893
7894 @findex MAX_MOVE_MAX
7895 @item MAX_MOVE_MAX
7896 The maximum number of bytes that a single instruction can move quickly
7897 between memory and registers or between two memory locations.  If this
7898 is undefined, the default is @code{MOVE_MAX}.  Otherwise, it is the
7899 constant value that is the largest value that @code{MOVE_MAX} can have
7900 at run-time.
7901
7902 @findex SHIFT_COUNT_TRUNCATED
7903 @item SHIFT_COUNT_TRUNCATED
7904 A C expression that is nonzero if on this machine the number of bits
7905 actually used for the count of a shift operation is equal to the number
7906 of bits needed to represent the size of the object being shifted.  When
7907 this macro is non-zero, the compiler will assume that it is safe to omit
7908 a sign-extend, zero-extend, and certain bitwise `and' instructions that
7909 truncates the count of a shift operation.  On machines that have
7910 instructions that act on bit-fields at variable positions, which may
7911 include `bit test' instructions, a nonzero @code{SHIFT_COUNT_TRUNCATED}
7912 also enables deletion of truncations of the values that serve as
7913 arguments to bit-field instructions.
7914
7915 If both types of instructions truncate the count (for shifts) and
7916 position (for bit-field operations), or if no variable-position bit-field
7917 instructions exist, you should define this macro.
7918
7919 However, on some machines, such as the 80386 and the 680x0, truncation
7920 only applies to shift operations and not the (real or pretended)
7921 bit-field operations.  Define @code{SHIFT_COUNT_TRUNCATED} to be zero on
7922 such machines.  Instead, add patterns to the @file{md} file that include
7923 the implied truncation of the shift instructions.
7924
7925 You need not define this macro if it would always have the value of zero.
7926
7927 @findex TRULY_NOOP_TRUNCATION
7928 @item TRULY_NOOP_TRUNCATION (@var{outprec}, @var{inprec})
7929 A C expression which is nonzero if on this machine it is safe to
7930 ``convert'' an integer of @var{inprec} bits to one of @var{outprec}
7931 bits (where @var{outprec} is smaller than @var{inprec}) by merely
7932 operating on it as if it had only @var{outprec} bits.
7933
7934 On many machines, this expression can be 1.
7935
7936 @c rearranged this, removed the phrase "it is reported that".  this was
7937 @c to fix an overfull hbox.  --mew 10feb93
7938 When @code{TRULY_NOOP_TRUNCATION} returns 1 for a pair of sizes for
7939 modes for which @code{MODES_TIEABLE_P} is 0, suboptimal code can result.
7940 If this is the case, making @code{TRULY_NOOP_TRUNCATION} return 0 in
7941 such cases may improve things.
7942
7943 @findex STORE_FLAG_VALUE
7944 @item STORE_FLAG_VALUE
7945 A C expression describing the value returned by a comparison operator
7946 with an integral mode and stored by a store-flag instruction
7947 (@samp{s@var{cond}}) when the condition is true.  This description must
7948 apply to @emph{all} the @samp{s@var{cond}} patterns and all the
7949 comparison operators whose results have a @code{MODE_INT} mode.
7950
7951 A value of 1 or @minus{}1 means that the instruction implementing the
7952 comparison operator returns exactly 1 or @minus{}1 when the comparison is true
7953 and 0 when the comparison is false.  Otherwise, the value indicates
7954 which bits of the result are guaranteed to be 1 when the comparison is
7955 true.  This value is interpreted in the mode of the comparison
7956 operation, which is given by the mode of the first operand in the
7957 @samp{s@var{cond}} pattern.  Either the low bit or the sign bit of
7958 @code{STORE_FLAG_VALUE} be on.  Presently, only those bits are used by
7959 the compiler.
7960
7961 If @code{STORE_FLAG_VALUE} is neither 1 or @minus{}1, the compiler will
7962 generate code that depends only on the specified bits.  It can also
7963 replace comparison operators with equivalent operations if they cause
7964 the required bits to be set, even if the remaining bits are undefined.
7965 For example, on a machine whose comparison operators return an
7966 @code{SImode} value and where @code{STORE_FLAG_VALUE} is defined as
7967 @samp{0x80000000}, saying that just the sign bit is relevant, the
7968 expression
7969
7970 @smallexample
7971 (ne:SI (and:SI @var{x} (const_int @var{power-of-2})) (const_int 0))
7972 @end smallexample
7973
7974 @noindent
7975 can be converted to
7976
7977 @smallexample
7978 (ashift:SI @var{x} (const_int @var{n}))
7979 @end smallexample
7980
7981 @noindent
7982 where @var{n} is the appropriate shift count to move the bit being
7983 tested into the sign bit.
7984
7985 There is no way to describe a machine that always sets the low-order bit
7986 for a true value, but does not guarantee the value of any other bits,
7987 but we do not know of any machine that has such an instruction.  If you
7988 are trying to port GCC to such a machine, include an instruction to
7989 perform a logical-and of the result with 1 in the pattern for the
7990 comparison operators and let us know
7991 @ifset USING
7992 (@pxref{Bug Reporting,,How to Report Bugs}).
7993 @end ifset
7994 @ifclear USING
7995 (@pxref{Bug Reporting,,How to Report Bugs,gcc.info,Using GCC}).
7996 @end ifclear
7997
7998 Often, a machine will have multiple instructions that obtain a value
7999 from a comparison (or the condition codes).  Here are rules to guide the
8000 choice of value for @code{STORE_FLAG_VALUE}, and hence the instructions
8001 to be used:
8002
8003 @itemize @bullet
8004 @item
8005 Use the shortest sequence that yields a valid definition for
8006 @code{STORE_FLAG_VALUE}.  It is more efficient for the compiler to
8007 ``normalize'' the value (convert it to, e.g., 1 or 0) than for the
8008 comparison operators to do so because there may be opportunities to
8009 combine the normalization with other operations.
8010
8011 @item
8012 For equal-length sequences, use a value of 1 or @minus{}1, with @minus{}1 being
8013 slightly preferred on machines with expensive jumps and 1 preferred on
8014 other machines.
8015
8016 @item
8017 As a second choice, choose a value of @samp{0x80000001} if instructions
8018 exist that set both the sign and low-order bits but do not define the
8019 others.
8020
8021 @item
8022 Otherwise, use a value of @samp{0x80000000}.
8023 @end itemize
8024
8025 Many machines can produce both the value chosen for
8026 @code{STORE_FLAG_VALUE} and its negation in the same number of
8027 instructions.  On those machines, you should also define a pattern for
8028 those cases, e.g., one matching
8029
8030 @smallexample
8031 (set @var{A} (neg:@var{m} (ne:@var{m} @var{B} @var{C})))
8032 @end smallexample
8033
8034 Some machines can also perform @code{and} or @code{plus} operations on
8035 condition code values with less instructions than the corresponding
8036 @samp{s@var{cond}} insn followed by @code{and} or @code{plus}.  On those
8037 machines, define the appropriate patterns.  Use the names @code{incscc}
8038 and @code{decscc}, respectively, for the patterns which perform
8039 @code{plus} or @code{minus} operations on condition code values.  See
8040 @file{rs6000.md} for some examples.  The GNU Superoptizer can be used to
8041 find such instruction sequences on other machines.
8042
8043 You need not define @code{STORE_FLAG_VALUE} if the machine has no store-flag
8044 instructions.
8045
8046 @findex FLOAT_STORE_FLAG_VALUE
8047 @item FLOAT_STORE_FLAG_VALUE (@var{mode})
8048 A C expression that gives a non-zero @code{REAL_VALUE_TYPE} value that is
8049 returned when comparison operators with floating-point results are true.
8050 Define this macro on machine that have comparison operations that return
8051 floating-point values.  If there are no such operations, do not define
8052 this macro.
8053
8054 @findex Pmode
8055 @item Pmode
8056 An alias for the machine mode for pointers.  On most machines, define
8057 this to be the integer mode corresponding to the width of a hardware
8058 pointer; @code{SImode} on 32-bit machine or @code{DImode} on 64-bit machines.
8059 On some machines you must define this to be one of the partial integer
8060 modes, such as @code{PSImode}.
8061
8062 The width of @code{Pmode} must be at least as large as the value of
8063 @code{POINTER_SIZE}.  If it is not equal, you must define the macro
8064 @code{POINTERS_EXTEND_UNSIGNED} to specify how pointers are extended
8065 to @code{Pmode}.
8066
8067 @findex FUNCTION_MODE
8068 @item FUNCTION_MODE
8069 An alias for the machine mode used for memory references to functions
8070 being called, in @code{call} RTL expressions.  On most machines this
8071 should be @code{QImode}.
8072
8073 @findex INTEGRATE_THRESHOLD
8074 @item INTEGRATE_THRESHOLD (@var{decl})
8075 A C expression for the maximum number of instructions above which the
8076 function @var{decl} should not be inlined.  @var{decl} is a
8077 @code{FUNCTION_DECL} node.
8078
8079 The default definition of this macro is 64 plus 8 times the number of
8080 arguments that the function accepts.  Some people think a larger
8081 threshold should be used on RISC machines.
8082
8083 @findex SCCS_DIRECTIVE
8084 @item SCCS_DIRECTIVE
8085 Define this if the preprocessor should ignore @code{#sccs} directives
8086 and print no error message.
8087
8088 @findex NO_IMPLICIT_EXTERN_C
8089 @item NO_IMPLICIT_EXTERN_C
8090 Define this macro if the system header files support C++ as well as C.
8091 This macro inhibits the usual method of using system header files in
8092 C++, which is to pretend that the file's contents are enclosed in
8093 @samp{extern "C" @{@dots{}@}}.
8094
8095 @findex HANDLE_PRAGMA
8096 @item HANDLE_PRAGMA (@var{getc}, @var{ungetc}, @var{name})
8097 This macro is no longer supported.  You must use
8098 @code{REGISTER_TARGET_PRAGMAS} instead.
8099
8100 @findex REGISTER_TARGET_PRAGMAS
8101 @findex #pragma
8102 @findex pragma
8103 @item REGISTER_TARGET_PRAGMAS (@var{pfile})
8104 Define this macro if you want to implement any target-specific pragmas.
8105 If defined, it is a C expression which makes a series of calls to the
8106 @code{cpp_register_pragma} and/or @code{cpp_register_pragma_space}
8107 functions.  The @var{pfile} argument is the first argument to supply to
8108 these functions.  The macro may also do setup required for the pragmas.
8109
8110 The primary reason to define this macro is to provide compatibility with
8111 other compilers for the same target.  In general, we discourage
8112 definition of target-specific pragmas for GCC.
8113
8114 If the pragma can be implemented by attributes then the macro
8115 @samp{INSERT_ATTRIBUTES} might be a useful one to define as well.
8116
8117 Preprocessor macros that appear on pragma lines are not expanded.  All
8118 @samp{#pragma} directives that do not match any registered pragma are
8119 silently ignored, unless the user specifies @option{-Wunknown-pragmas}.
8120
8121 @deftypefun void cpp_register_pragma (cpp_reader *@var{pfile}, const char *@var{space}, const char *@var{name}, void (*@var{callback}) (cpp_reader *))
8122
8123 Each call to @code{cpp_register_pragma} establishes one pragma.  The
8124 @var{callback} routine will be called when the preprocessor encounters a
8125 pragma of the form
8126
8127 @smallexample
8128 #pragma [@var{space}] @var{name} @dots{}
8129 @end smallexample
8130
8131 @var{space} must have been the subject of a previous call to
8132 @code{cpp_register_pragma_space}, or else be a null pointer.  The
8133 callback routine receives @var{pfile} as its first argument, but must
8134 not use it for anything (this may change in the future).  It may read
8135 any text after the @var{name} by making calls to @code{c_lex}.  Text
8136 which is not read by the callback will be silently ignored.
8137
8138 Note that both @var{space} and @var{name} are case sensitive.
8139
8140 For an example use of this routine, see @file{c4x.h} and the callback
8141 routines defined in @file{c4x.c}.
8142
8143 Note that the use of @code{c_lex} is specific to the C and C++
8144 compilers.  It will not work in the Java or Fortran compilers, or any
8145 other language compilers for that matter.  Thus if @code{c_lex} is going
8146 to be called from target-specific code, it must only be done so when
8147 building the C and C++ compilers.  This can be done by defining the
8148 variables @code{c_target_objs} and @code{cxx_target_objs} in the
8149 target entry in the @code{config.gcc} file.  These variables should name
8150 the target-specific, language-specific object file which contains the
8151 code that uses @code{c_lex}.  Note it will also be necessary to add a
8152 rule to the makefile fragment pointed to by @code{tmake_file} that shows
8153 how to build this object file.
8154 @end deftypefun
8155
8156 @deftypefun void cpp_register_pragma_space (cpp_reader *@var{pfile}, const char *@var{space})
8157 This routine establishes a namespace for pragmas, which will be
8158 registered by subsequent calls to @code{cpp_register_pragma}.  For
8159 example, pragmas defined by the C standard are in the @samp{STDC}
8160 namespace, and pragmas specific to GCC are in the @samp{GCC} namespace.
8161
8162 For an example use of this routine in a target header, see @file{v850.h}.
8163 @end deftypefun
8164
8165 @findex HANDLE_SYSV_PRAGMA
8166 @findex #pragma
8167 @findex pragma
8168 @item HANDLE_SYSV_PRAGMA
8169 Define this macro (to a value of 1) if you want the System V style
8170 pragmas @samp{#pragma pack(<n>)} and @samp{#pragma weak <name>
8171 [=<value>]} to be supported by gcc.
8172
8173 The pack pragma specifies the maximum alignment (in bytes) of fields
8174 within a structure, in much the same way as the @samp{__aligned__} and
8175 @samp{__packed__} @code{__attribute__}s do.  A pack value of zero resets
8176 the behaviour to the default.
8177
8178 The weak pragma only works if @code{SUPPORTS_WEAK} and
8179 @code{ASM_WEAKEN_LABEL} are defined.  If enabled it allows the creation
8180 of specifically named weak labels, optionally with a value.
8181
8182 @findex HANDLE_PRAGMA_PACK_PUSH_POP
8183 @findex #pragma
8184 @findex pragma
8185 @item HANDLE_PRAGMA_PACK_PUSH_POP
8186 Define this macro (to a value of 1) if you want to support the Win32
8187 style pragmas @samp{#pragma pack(push,<n>)} and @samp{#pragma
8188 pack(pop)}.  The pack(push,<n>) pragma specifies the maximum alignment
8189 (in bytes) of fields within a structure, in much the same way as the
8190 @samp{__aligned__} and @samp{__packed__} @code{__attribute__}s do.  A
8191 pack value of zero resets the behaviour to the default.  Successive
8192 invocations of this pragma cause the previous values to be stacked, so
8193 that invocations of @samp{#pragma pack(pop)} will return to the previous
8194 value.
8195
8196 @findex VALID_MACHINE_DECL_ATTRIBUTE
8197 @item VALID_MACHINE_DECL_ATTRIBUTE (@var{decl}, @var{attributes}, @var{identifier}, @var{args})
8198 If defined, a C expression whose value is nonzero if @var{identifier} with
8199 arguments @var{args} is a valid machine specific attribute for @var{decl}.
8200 The attributes in @var{attributes} have previously been assigned to @var{decl}.
8201
8202 @findex VALID_MACHINE_TYPE_ATTRIBUTE
8203 @item VALID_MACHINE_TYPE_ATTRIBUTE (@var{type}, @var{attributes}, @var{identifier}, @var{args})
8204 If defined, a C expression whose value is nonzero if @var{identifier} with
8205 arguments @var{args} is a valid machine specific attribute for @var{type}.
8206 The attributes in @var{attributes} have previously been assigned to @var{type}.
8207
8208 @findex COMP_TYPE_ATTRIBUTES
8209 @item COMP_TYPE_ATTRIBUTES (@var{type1}, @var{type2})
8210 If defined, a C expression whose value is zero if the attributes on
8211 @var{type1} and @var{type2} are incompatible, one if they are compatible,
8212 and two if they are nearly compatible (which causes a warning to be
8213 generated).
8214
8215 @findex SET_DEFAULT_TYPE_ATTRIBUTES
8216 @item SET_DEFAULT_TYPE_ATTRIBUTES (@var{type})
8217 If defined, a C statement that assigns default attributes to
8218 newly defined @var{type}.
8219
8220 @findex MERGE_MACHINE_TYPE_ATTRIBUTES
8221 @item MERGE_MACHINE_TYPE_ATTRIBUTES (@var{type1}, @var{type2})
8222 Define this macro if the merging of type attributes needs special handling.
8223 If defined, the result is a list of the combined TYPE_ATTRIBUTES of
8224 @var{type1} and @var{type2}.  It is assumed that comptypes has already been
8225 called and returned 1.
8226
8227 @findex MERGE_MACHINE_DECL_ATTRIBUTES
8228 @item MERGE_MACHINE_DECL_ATTRIBUTES (@var{olddecl}, @var{newdecl})
8229 Define this macro if the merging of decl attributes needs special handling.
8230 If defined, the result is a list of the combined DECL_MACHINE_ATTRIBUTES of
8231 @var{olddecl} and @var{newdecl}.  @var{newdecl} is a duplicate declaration
8232 of @var{olddecl}.  Examples of when this is needed are when one attribute
8233 overrides another, or when an attribute is nullified by a subsequent
8234 definition.
8235
8236 @findex INSERT_ATTRIBUTES
8237 @item INSERT_ATTRIBUTES (@var{node}, @var{attr_ptr}, @var{prefix_ptr})
8238 Define this macro if you want to be able to add attributes to a decl
8239 when it is being created.  This is normally useful for back ends which
8240 wish to implement a pragma by using the attributes which correspond to
8241 the pragma's effect.  The @var{node} argument is the decl which is being
8242 created.  The @var{attr_ptr} argument is a pointer to the attribute list
8243 for this decl.  The @var{prefix_ptr} is a pointer to the list of
8244 attributes that have appeared after the specifiers and modifiers of the
8245 declaration, but before the declaration proper.
8246
8247 @findex SET_DEFAULT_DECL_ATTRIBUTES
8248 @item SET_DEFAULT_DECL_ATTRIBUTES (@var{decl}, @var{attributes})
8249 If defined, a C statement that assigns default attributes to
8250 newly defined @var{decl}.
8251
8252 @findex DOLLARS_IN_IDENTIFIERS
8253 @item DOLLARS_IN_IDENTIFIERS
8254 Define this macro to control use of the character @samp{$} in identifier
8255 names.  0 means @samp{$} is not allowed by default; 1 means it is allowed.
8256 1 is the default; there is no need to define this macro in that case.
8257 This macro controls the compiler proper; it does not affect the preprocessor.
8258
8259 @findex NO_DOLLAR_IN_LABEL
8260 @item NO_DOLLAR_IN_LABEL
8261 Define this macro if the assembler does not accept the character
8262 @samp{$} in label names.  By default constructors and destructors in
8263 G++ have @samp{$} in the identifiers.  If this macro is defined,
8264 @samp{.} is used instead.
8265
8266 @findex NO_DOT_IN_LABEL
8267 @item NO_DOT_IN_LABEL
8268 Define this macro if the assembler does not accept the character
8269 @samp{.} in label names.  By default constructors and destructors in G++
8270 have names that use @samp{.}.  If this macro is defined, these names
8271 are rewritten to avoid @samp{.}.
8272
8273 @findex DEFAULT_MAIN_RETURN
8274 @item DEFAULT_MAIN_RETURN
8275 Define this macro if the target system expects every program's @code{main}
8276 function to return a standard ``success'' value by default (if no other
8277 value is explicitly returned).
8278
8279 The definition should be a C statement (sans semicolon) to generate the
8280 appropriate rtl instructions.  It is used only when compiling the end of
8281 @code{main}.
8282
8283 @item NEED_ATEXIT
8284 @findex NEED_ATEXIT
8285 Define this if the target system lacks the function @code{atexit}
8286 from the ISO C standard.  If this macro is defined, a default definition
8287 will be provided to support C++.  If @code{ON_EXIT} is not defined,
8288 a default @code{exit} function will also be provided.
8289
8290 @item ON_EXIT
8291 @findex ON_EXIT
8292 Define this macro if the target has another way to implement atexit
8293 functionality without replacing @code{exit}.  For instance, SunOS 4 has
8294 a similar @code{on_exit} library function.
8295
8296 The definition should be a functional macro which can be used just like
8297 the @code{atexit} function.
8298
8299 @item EXIT_BODY
8300 @findex EXIT_BODY
8301 Define this if your @code{exit} function needs to do something
8302 besides calling an external function @code{_cleanup} before
8303 terminating with @code{_exit}.  The @code{EXIT_BODY} macro is
8304 only needed if @code{NEED_ATEXIT} is defined and @code{ON_EXIT} is not
8305 defined.
8306
8307 @findex INSN_SETS_ARE_DELAYED
8308 @item INSN_SETS_ARE_DELAYED (@var{insn})
8309 Define this macro as a C expression that is nonzero if it is safe for the
8310 delay slot scheduler to place instructions in the delay slot of @var{insn},
8311 even if they appear to use a resource set or clobbered in @var{insn}.
8312 @var{insn} is always a @code{jump_insn} or an @code{insn}; GCC knows that
8313 every @code{call_insn} has this behavior.  On machines where some @code{insn}
8314 or @code{jump_insn} is really a function call and hence has this behavior,
8315 you should define this macro.
8316
8317 You need not define this macro if it would always return zero.
8318
8319 @findex INSN_REFERENCES_ARE_DELAYED
8320 @item INSN_REFERENCES_ARE_DELAYED (@var{insn})
8321 Define this macro as a C expression that is nonzero if it is safe for the
8322 delay slot scheduler to place instructions in the delay slot of @var{insn},
8323 even if they appear to set or clobber a resource referenced in @var{insn}.
8324 @var{insn} is always a @code{jump_insn} or an @code{insn}.  On machines where
8325 some @code{insn} or @code{jump_insn} is really a function call and its operands
8326 are registers whose use is actually in the subroutine it calls, you should
8327 define this macro.  Doing so allows the delay slot scheduler to move
8328 instructions which copy arguments into the argument registers into the delay
8329 slot of @var{insn}.
8330
8331 You need not define this macro if it would always return zero.
8332
8333 @findex MACHINE_DEPENDENT_REORG
8334 @item MACHINE_DEPENDENT_REORG (@var{insn})
8335 In rare cases, correct code generation requires extra machine
8336 dependent processing between the second jump optimization pass and
8337 delayed branch scheduling.  On those machines, define this macro as a C
8338 statement to act on the code starting at @var{insn}.
8339
8340 @findex MULTIPLE_SYMBOL_SPACES
8341 @item MULTIPLE_SYMBOL_SPACES
8342 Define this macro if in some cases global symbols from one translation
8343 unit may not be bound to undefined symbols in another translation unit
8344 without user intervention.  For instance, under Microsoft Windows
8345 symbols must be explicitly imported from shared libraries (DLLs).
8346
8347 @findex MD_ASM_CLOBBERS
8348 @item MD_ASM_CLOBBERS
8349 A C statement that adds to @var{CLOBBERS} @code{STRING_CST} trees for
8350 any hard regs the port wishes to automatically clobber for all asms.
8351
8352 @findex ISSUE_RATE
8353 @item ISSUE_RATE
8354 A C expression that returns how many instructions can be issued at the
8355 same time if the machine is a superscalar machine.
8356
8357 @findex MD_SCHED_INIT
8358 @item MD_SCHED_INIT (@var{file}, @var{verbose}, @var{max_ready})
8359 A C statement which is executed by the scheduler at the
8360 beginning of each block of instructions that are to be scheduled.
8361 @var{file} is either a null pointer, or a stdio stream to write any
8362 debug output to.  @var{verbose} is the verbose level provided by
8363 @option{-fsched-verbose-@var{n}}.  @var{max_ready} is the maximum number
8364 of insns in the current scheduling region that can be live at the same
8365 time.  This can be used to allocate scratch space if it is needed.
8366
8367 @findex MD_SCHED_FINISH
8368 @item MD_SCHED_FINISH (@var{file}, @var{verbose})
8369 A C statement which is executed by the scheduler at the end of each block
8370 of instructions that are to be scheduled.  It can be used to perform
8371 cleanup of any actions done by the other scheduling macros.
8372 @var{file} is either a null pointer, or a stdio stream to write any
8373 debug output to.  @var{verbose} is the verbose level provided by
8374 @option{-fsched-verbose-@var{n}}.
8375
8376 @findex MD_SCHED_REORDER
8377 @item MD_SCHED_REORDER (@var{file}, @var{verbose}, @var{ready}, @var{n_ready}, @var{clock}, @var{can_issue_more})
8378 A C statement which is executed by the scheduler after it
8379 has scheduled the ready list to allow the machine description to reorder
8380 it (for example to combine two small instructions together on
8381 @samp{VLIW} machines).  @var{file} is either a null pointer, or a stdio
8382 stream to write any debug output to.  @var{verbose} is the verbose level
8383 provided by @option{-fsched-verbose-@var{n}}.  @var{ready} is a pointer to
8384 the ready list of instructions that are ready to be scheduled.
8385 @var{n_ready} is the number of elements in the ready list.  The
8386 scheduler reads the ready list in reverse order, starting with
8387 @var{ready}[@var{n_ready}-1] and going to @var{ready}[0].  @var{clock}
8388 is the timer tick of the scheduler.  @var{can_issue_more} is an output
8389 parameter that is set to the number of insns that can issue this clock;
8390 normally this is just @code{issue_rate}.  See also @samp{MD_SCHED_REORDER2}.
8391
8392 @findex MD_SCHED_REORDER2
8393 @item MD_SCHED_REORDER2 (@var{file}, @var{verbose}, @var{ready}, @var{n_ready}, @var{clock}, @var{can_issue_more})
8394 Like @samp{MD_SCHED_REORDER}, but called at a different time.  While the
8395 @samp{MD_SCHED_REORDER} macro is called whenever the scheduler starts a
8396 new cycle, this macro is used immediately after @samp{MD_SCHED_VARIABLE_ISSUE}
8397 is called; it can reorder the ready list and set @var{can_issue_more} to
8398 determine whether there are more insns to be scheduled in the same cycle.
8399 Defining this macro can be useful if there are frequent situations where
8400 scheduling one insn causes other insns to become ready in the same cycle,
8401 these other insns can then be taken into account properly.
8402
8403 @findex MD_SCHED_VARIABLE_ISSUE
8404 @item MD_SCHED_VARIABLE_ISSUE (@var{file}, @var{verbose}, @var{insn}, @var{more})
8405 A C statement which is executed by the scheduler after it
8406 has scheduled an insn from the ready list.  @var{file} is either a null
8407 pointer, or a stdio stream to write any debug output to.  @var{verbose}
8408 is the verbose level provided by @option{-fsched-verbose-@var{n}}.
8409 @var{insn} is the instruction that was scheduled.  @var{more} is the
8410 number of instructions that can be issued in the current cycle.  The
8411 @samp{MD_SCHED_VARIABLE_ISSUE} macro is responsible for updating the
8412 value of @var{more} (typically by @samp{@var{more}--}).
8413
8414 @findex MAX_INTEGER_COMPUTATION_MODE
8415 @item MAX_INTEGER_COMPUTATION_MODE
8416 Define this to the largest integer machine mode which can be used for
8417 operations other than load, store and copy operations.
8418
8419 You need only define this macro if the target holds values larger than
8420 @code{word_mode} in general purpose registers.  Most targets should not define
8421 this macro.
8422
8423 @findex MATH_LIBRARY
8424 @item MATH_LIBRARY
8425 Define this macro as a C string constant for the linker argument to link
8426 in the system math library, or @samp{""} if the target does not have a
8427 separate math library.
8428
8429 You need only define this macro if the default of @samp{"-lm"} is wrong.
8430
8431 @findex LIBRARY_PATH_ENV
8432 @item LIBRARY_PATH_ENV
8433 Define this macro as a C string constant for the environment variable that
8434 specifies where the linker should look for libraries.
8435
8436 You need only define this macro if the default of @samp{"LIBRARY_PATH"}
8437 is wrong.
8438
8439 @findex TARGET_HAS_F_SETLKW
8440 @item TARGET_HAS_F_SETLKW
8441 Define this macro if the target supports file locking with fcntl / F_SETLKW.
8442 Note that this functionality is part of POSIX.
8443 Defining @code{TARGET_HAS_F_SETLKW} will enable the test coverage code
8444 to use file locking when exiting a program, which avoids race conditions
8445 if the program has forked.
8446
8447 @findex MAX_CONDITIONAL_EXECUTE
8448 @item MAX_CONDITIONAL_EXECUTE
8449
8450 A C expression for the maximum number of instructions to execute via
8451 conditional execution instructions instead of a branch.  A value of
8452 @code{BRANCH_COST}+1 is the default if the machine does not use cc0, and
8453 1 if it does use cc0.
8454
8455 @findex IFCVT_MODIFY_TESTS
8456 @item IFCVT_MODIFY_TESTS
8457 A C expression to modify the tests in @code{TRUE_EXPR}, and
8458 @code{FALSE_EXPR} for use in converting insns in @code{TEST_BB},
8459 @code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB} basic blocks to
8460 conditional execution.  Set either @code{TRUE_EXPR} or @code{FALSE_EXPR}
8461 to a null pointer if the tests cannot be converted.
8462
8463 @findex IFCVT_MODIFY_INSN
8464 @item IFCVT_MODIFY_INSN
8465 A C expression to modify the @code{PATTERN} of an @code{INSN} that is to
8466 be converted to conditional execution format.
8467
8468 @findex IFCVT_MODIFY_FINAL
8469 @item IFCVT_MODIFY_FINAL
8470 A C expression to perform any final machine dependent modifications in
8471 converting code to conditional execution in the basic blocks
8472 @code{TEST_BB}, @code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB}.
8473
8474 @findex IFCVT_MODIFY_CANCEL
8475 @item IFCVT_MODIFY_CANCEL
8476 A C expression to cancel any machine dependent modifications in
8477 converting code to conditional execution in the basic blocks
8478 @code{TEST_BB}, @code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB}.
8479
8480 @findex MD_INIT_BUILTINS
8481 @item MD_INIT_BUILTINS
8482 Define this macro if you have any machine-specific built-in functions that
8483 need to be defined.  It should be a C expression that performs the
8484 necessary setup.
8485
8486 Machine specific built-in functions can be useful to expand special machine
8487 instructions that would otherwise not normally be generated because
8488 they have no equivalent in the source language (for example, SIMD vector
8489 instructions or prefetch instructions).
8490
8491 To create a built-in function, call the function @code{builtin_function}
8492 which is defined by the language front end.  You can use any type nodes set
8493 up by @code{build_common_tree_nodes} and @code{build_common_tree_nodes_2};
8494 only language front ends that use these two functions will use
8495 @samp{MD_INIT_BUILTINS}.
8496
8497 @findex MD_EXPAND_BUILTIN
8498 @item MD_EXPAND_BUILTIN(@var{exp}, @var{target}, @var{subtarget}, @var{mode}, @var{ignore})
8499
8500 Expand a call to a machine specific built-in function that was set up by
8501 @samp{MD_INIT_BUILTINS}.  @var{exp} is the expression for the function call;
8502 the result should go to @var{target} if that is convenient, and have mode
8503 @var{mode} if that is convenient.  @var{subtarget} may be used as the target
8504 for computing one of @var{exp}'s operands. @var{ignore} is nonzero if the value
8505 is to be ignored.
8506 This macro should return the result of the call to the built-in function.
8507
8508 @end table