1 This is doc/gccint.info, produced by makeinfo version 4.2 from
2 ../../gcc/gcc/doc/gccint.texi.
4 Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
5 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
7 Permission is granted to copy, distribute and/or modify this document
8 under the terms of the GNU Free Documentation License, Version 1.2 or
9 any later version published by the Free Software Foundation; with the
10 Invariant Sections being "GNU General Public License" and "Funding Free
11 Software", the Front-Cover texts being (a) (see below), and with the
12 Back-Cover Texts being (b) (see below). A copy of the license is
13 included in the section entitled "GNU Free Documentation License".
15 (a) The FSF's Front-Cover Text is:
19 (b) The FSF's Back-Cover Text is:
21 You have freedom to copy and modify this GNU Manual, like GNU
22 software. Copies published by the Free Software Foundation raise
23 funds for GNU development.
24 INFO-DIR-SECTION Programming
26 * gccint: (gccint). Internals of the GNU Compiler Collection.
28 This file documents the internals of the GNU compilers.
30 Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
31 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
33 Permission is granted to copy, distribute and/or modify this document
34 under the terms of the GNU Free Documentation License, Version 1.2 or
35 any later version published by the Free Software Foundation; with the
36 Invariant Sections being "GNU General Public License" and "Funding Free
37 Software", the Front-Cover texts being (a) (see below), and with the
38 Back-Cover Texts being (b) (see below). A copy of the license is
39 included in the section entitled "GNU Free Documentation License".
41 (a) The FSF's Front-Cover Text is:
45 (b) The FSF's Back-Cover Text is:
47 You have freedom to copy and modify this GNU Manual, like GNU
48 software. Copies published by the Free Software Foundation raise
49 funds for GNU development.
51 File: gccint.info, Node: Top, Next: Contributing, Up: (DIR)
56 This manual documents the internals of the GNU compilers, including
57 how to port them to new targets and some information about how to write
58 front ends for new languages. It corresponds to GCC version 3.4.2.
59 The use of the GNU compilers is documented in a separate manual. *Note
60 Introduction: (gcc)Top.
62 This manual is mainly a reference manual rather than a tutorial. It
63 discusses how to contribute to GCC (*note Contributing::), the
64 characteristics of the machines supported by GCC as hosts and targets
65 (*note Portability::), how GCC relates to the ABIs on such systems
66 (*note Interface::), and the characteristics of the languages for which
67 GCC front ends are written (*note Languages::). It then describes the
68 GCC source tree structure and build system, some of the interfaces to
69 GCC front ends, and how support for a target system is implemented in
72 Additional tutorial information is linked to from
73 `http://gcc.gnu.org/readings.html'.
77 * Contributing:: How to contribute to testing and developing GCC.
78 * Portability:: Goals of GCC's portability features.
79 * Interface:: Function-call interface of GCC output.
80 * Libgcc:: Low-level runtime library used by GCC.
81 * Languages:: Languages for which GCC front ends are written.
82 * Source Tree:: GCC source tree structure and build system.
83 * Passes:: Order of passes, what they do, and what each file is for.
84 * Trees:: The source representation used by the C and C++ front ends.
85 * RTL:: The intermediate representation that most passes work on.
86 * Machine Desc:: How to write machine description instruction patterns.
87 * Target Macros:: How to write the machine description C macros and functions.
88 * Host Config:: Writing the `xm-MACHINE.h' file.
89 * Fragments:: Writing the `t-TARGET' and `x-HOST' files.
90 * Collect2:: How `collect2' works; how it finds `ld'.
91 * Header Dirs:: Understanding the standard header file directories.
92 * Type Information:: GCC's memory management; generating type information.
94 * Funding:: How to help assure funding for free software.
95 * GNU Project:: The GNU Project and GNU/Linux.
97 * Copying:: GNU General Public License says
98 how you can copy and share GCC.
99 * GNU Free Documentation License:: How you can copy and share this manual.
100 * Contributors:: People who have contributed to GCC.
102 * Option Index:: Index to command line options.
103 * Index:: Index of concepts and symbol names.
106 File: gccint.info, Node: Contributing, Next: Portability, Prev: Top, Up: Top
108 Contributing to GCC Development
109 *******************************
111 If you would like to help pretest GCC releases to assure they work
112 well, current development sources are available by CVS (see
113 `http://gcc.gnu.org/cvs.html'). Source and binary snapshots are also
114 available for FTP; see `http://gcc.gnu.org/snapshots.html'.
116 If you would like to work on improvements to GCC, please read the
117 advice at these URLs:
119 `http://gcc.gnu.org/contribute.html'
120 `http://gcc.gnu.org/contributewhy.html'
122 for information on how to make useful contributions and avoid
123 duplication of effort. Suggested projects are listed at
124 `http://gcc.gnu.org/projects/'.
127 File: gccint.info, Node: Portability, Next: Interface, Prev: Contributing, Up: Top
132 GCC itself aims to be portable to any machine where `int' is at least
133 a 32-bit type. It aims to target machines with a flat (non-segmented)
134 byte addressed data address space (the code address space can be
135 separate). Target ABIs may have 8, 16, 32 or 64-bit `int' type. `char'
136 can be wider than 8 bits.
138 GCC gets most of the information about the target machine from a
139 machine description which gives an algebraic formula for each of the
140 machine's instructions. This is a very clean way to describe the
141 target. But when the compiler needs information that is difficult to
142 express in this fashion, ad-hoc parameters have been defined for
143 machine descriptions. The purpose of portability is to reduce the
144 total work needed on the compiler; it was not of interest for its own
147 GCC does not contain machine dependent code, but it does contain code
148 that depends on machine parameters such as endianness (whether the most
149 significant byte has the highest or lowest address of the bytes in a
150 word) and the availability of autoincrement addressing. In the
151 RTL-generation pass, it is often necessary to have multiple strategies
152 for generating code for a particular kind of syntax tree, strategies
153 that are usable for different combinations of parameters. Often, not
154 all possible cases have been addressed, but only the common ones or
155 only the ones that have been encountered. As a result, a new target
156 may require additional strategies. You will know if this happens
157 because the compiler will call `abort'. Fortunately, the new
158 strategies can be added in a machine-independent fashion, and will
159 affect only the target machines that need them.
162 File: gccint.info, Node: Interface, Next: Libgcc, Prev: Portability, Up: Top
164 Interfacing to GCC Output
165 *************************
167 GCC is normally configured to use the same function calling
168 convention normally in use on the target system. This is done with the
169 machine-description macros described (*note Target Macros::).
171 However, returning of structure and union values is done differently
172 on some target machines. As a result, functions compiled with PCC
173 returning such types cannot be called from code compiled with GCC, and
174 vice versa. This does not cause trouble often because few Unix library
175 routines return structures or unions.
177 GCC code returns structures and unions that are 1, 2, 4 or 8 bytes
178 long in the same registers used for `int' or `double' return values.
179 (GCC typically allocates variables of such types in registers also.)
180 Structures and unions of other sizes are returned by storing them into
181 an address passed by the caller (usually in a register). The target
182 hook `TARGET_STRUCT_VALUE_RTX' tells GCC where to pass this address.
184 By contrast, PCC on most target machines returns structures and
185 unions of any size by copying the data into an area of static storage,
186 and then returning the address of that storage as if it were a pointer
187 value. The caller must copy the data from that memory area to the
188 place where the value is wanted. This is slower than the method used
189 by GCC, and fails to be reentrant.
191 On some target machines, such as RISC machines and the 80386, the
192 standard system convention is to pass to the subroutine the address of
193 where to return the value. On these machines, GCC has been configured
194 to be compatible with the standard compiler, when this method is used.
195 It may not be compatible for structures of 1, 2, 4 or 8 bytes.
197 GCC uses the system's standard convention for passing arguments. On
198 some machines, the first few arguments are passed in registers; in
199 others, all are passed on the stack. It would be possible to use
200 registers for argument passing on any machine, and this would probably
201 result in a significant speedup. But the result would be complete
202 incompatibility with code that follows the standard convention. So this
203 change is practical only if you are switching to GCC as the sole C
204 compiler for the system. We may implement register argument passing on
205 certain machines once we have a complete GNU system so that we can
206 compile the libraries with GCC.
208 On some machines (particularly the SPARC), certain types of arguments
209 are passed "by invisible reference". This means that the value is
210 stored in memory, and the address of the memory location is passed to
213 If you use `longjmp', beware of automatic variables. ISO C says that
214 automatic variables that are not declared `volatile' have undefined
215 values after a `longjmp'. And this is all GCC promises to do, because
216 it is very difficult to restore register variables correctly, and one
217 of GCC's features is that it can put variables in registers without
220 If you want a variable to be unaltered by `longjmp', and you don't
221 want to write `volatile' because old C compilers don't accept it, just
222 take the address of the variable. If a variable's address is ever
223 taken, even if just to compute it and ignore it, then the variable
224 cannot go in a register:
233 File: gccint.info, Node: Libgcc, Next: Languages, Prev: Interface, Up: Top
235 The GCC low-level runtime library
236 *********************************
238 GCC provides a low-level runtime library, `libgcc.a' or
239 `libgcc_s.so.1' on some platforms. GCC generates calls to routines in
240 this library automatically, whenever it needs to perform some operation
241 that is too complicated to emit inline code for.
243 Most of the routines in `libgcc' handle arithmetic operations that
244 the target processor cannot perform directly. This includes integer
245 multiply and divide on some machines, and all floating-point operations
246 on other machines. `libgcc' also includes routines for exception
247 handling, and a handful of miscellaneous operations.
249 Some of these routines can be defined in mostly machine-independent
250 C. Others must be hand-written in assembly language for each processor
253 GCC will also generate calls to C library routines, such as `memcpy'
254 and `memset', in some cases. The set of routines that GCC may possibly
255 use is documented in *Note Other Builtins: (gcc)Other Builtins.
257 These routines take arguments and return values of a specific machine
258 mode, not a specific C type. *Note Machine Modes::, for an explanation
259 of this concept. For illustrative purposes, in this chapter the
260 floating point type `float' is assumed to correspond to `SFmode';
261 `double' to `DFmode'; and `long double' to both `TFmode' and `XFmode'.
262 Similarly, the integer types `int' and `unsigned int' correspond to
263 `SImode'; `long' and `unsigned long' to `DImode'; and `long long' and
264 `unsigned long long' to `TImode'.
268 * Integer library routines::
269 * Soft float library routines::
270 * Exception handling routines::
271 * Miscellaneous routines::
274 File: gccint.info, Node: Integer library routines, Next: Soft float library routines, Up: Libgcc
276 Routines for integer arithmetic
277 ===============================
279 The integer arithmetic routines are used on platforms that don't
280 provide hardware support for arithmetic operations on some modes.
285 - Runtime Function: int __ashlsi3 (int A, int B)
286 - Runtime Function: long __ashldi3 (long A, int B)
287 - Runtime Function: long long __ashlti3 (long long A, int B)
288 These functions return the result of shifting A left by B bits.
290 - Runtime Function: int __ashrsi3 (int A, int B)
291 - Runtime Function: long __ashrdi3 (long A, int B)
292 - Runtime Function: long long __ashrti3 (long long A, int B)
293 These functions return the result of arithmetically shifting A
296 - Runtime Function: int __divsi3 (int A, int B)
297 - Runtime Function: long __divdi3 (long A, long B)
298 - Runtime Function: long long __divti3 (long long A, long long B)
299 These functions return the quotient of the signed division of A and
302 - Runtime Function: int __lshrsi3 (int A, int B)
303 - Runtime Function: long __lshrdi3 (long A, int B)
304 - Runtime Function: long long __lshrti3 (long long A, int B)
305 These functions return the result of logically shifting A right by
308 - Runtime Function: int __modsi3 (int A, int B)
309 - Runtime Function: long __moddi3 (long A, long B)
310 - Runtime Function: long long __modti3 (long long A, long long B)
311 These functions return the remainder of the signed division of A
314 - Runtime Function: int __mulsi3 (int A, int B)
315 - Runtime Function: long __muldi3 (long A, long B)
316 - Runtime Function: long long __multi3 (long long A, long long B)
317 These functions return the product of A and B.
319 - Runtime Function: long __negdi2 (long A)
320 - Runtime Function: long long __negti2 (long long A)
321 These functions return the negation of A.
323 - Runtime Function: unsigned int __udivsi3 (unsigned int A, unsigned
325 - Runtime Function: unsigned long __udivdi3 (unsigned long A, unsigned
327 - Runtime Function: unsigned long long __udivti3 (unsigned long long
328 A, unsigned long long B)
329 These functions return the quotient of the unsigned division of A
332 - Runtime Function: unsigned long __udivmoddi3 (unsigned long A,
333 unsigned long B, unsigned long *C)
334 - Runtime Function: unsigned long long __udivti3 (unsigned long long
335 A, unsigned long long B, unsigned long long *C)
336 These functions calculate both the quotient and remainder of the
337 unsigned division of A and B. The return value is the quotient,
338 and the remainder is placed in variable pointed to by C.
340 - Runtime Function: unsigned int __umodsi3 (unsigned int A, unsigned
342 - Runtime Function: unsigned long __umoddi3 (unsigned long A, unsigned
344 - Runtime Function: unsigned long long __umodti3 (unsigned long long
345 A, unsigned long long B)
346 These functions return the remainder of the unsigned division of A
352 The following functions implement integral comparisons. These
353 functions implement a low-level compare, upon which the higher level
354 comparison operators (such as less than and greater than or equal to)
355 can be constructed. The returned values lie in the range zero to two,
356 to allow the high-level operators to be implemented by testing the
357 returned result using either signed or unsigned comparison.
359 - Runtime Function: int __cmpdi2 (long A, long B)
360 - Runtime Function: int __cmpti2 (long long A, long long B)
361 These functions perform a signed comparison of A and B. If A is
362 less than B, they return 0; if A is greater than B, they return 2;
363 and if A and B are equal they return 1.
365 - Runtime Function: int __ucmpdi2 (unsigned long A, unsigned long B)
366 - Runtime Function: int __ucmpti2 (unsigned long long A, unsigned long
368 These functions perform an unsigned comparison of A and B. If A
369 is less than B, they return 0; if A is greater than B, they return
370 2; and if A and B are equal they return 1.
372 Trapping arithmetic functions
373 -----------------------------
375 The following functions implement trapping arithmetic. These
376 functions call the libc function `abort' upon signed arithmetic
379 - Runtime Function: int __absvsi2 (int A)
380 - Runtime Function: long __absvdi2 (long A)
381 These functions return the absolute value of A.
383 - Runtime Function: int __addvsi3 (int A, int B)
384 - Runtime Function: long __addvdi3 (long A, long B)
385 These functions return the sum of A and B; that is `A + B'.
387 - Runtime Function: int __mulvsi3 (int A, int B)
388 - Runtime Function: long __mulvdi3 (long A, long B)
389 The functions return the product of A and B; that is `A * B'.
391 - Runtime Function: int __negvsi2 (int A)
392 - Runtime Function: long __negvdi2 (long A)
393 These functions return the negation of A; that is `-A'.
395 - Runtime Function: int __subvsi3 (int A, int B)
396 - Runtime Function: long __subvdi3 (long A, long B)
397 These functions return the difference between B and A; that is `A
403 - Runtime Function: int __clzsi2 (int A)
404 - Runtime Function: int __clzdi2 (long A)
405 - Runtime Function: int __clzti2 (long long A)
406 These functions return the number of leading 0-bits in A, starting
407 at the most significant bit position. If A is zero, the result is
410 - Runtime Function: int __ctzsi2 (int A)
411 - Runtime Function: int __ctzdi2 (long A)
412 - Runtime Function: int __ctzti2 (long long A)
413 These functions return the number of trailing 0-bits in A, starting
414 at the least significant bit position. If A is zero, the result is
417 - Runtime Function: int __ffsdi2 (long A)
418 - Runtime Function: int __ffsti2 (long long A)
419 These functions return the index of the least significant 1-bit in
420 A, or the value zero if A is zero. The least significant bit is
423 - Runtime Function: int __paritysi2 (int A)
424 - Runtime Function: int __paritydi2 (long A)
425 - Runtime Function: int __parityti2 (long long A)
426 These functions return the value zero if the number of bits set in
427 A is even, and the value one otherwise.
429 - Runtime Function: int __popcountsi2 (int A)
430 - Runtime Function: int __popcountdi2 (long A)
431 - Runtime Function: int __popcountti2 (long long A)
432 These functions return the number of bits set in A.
435 File: gccint.info, Node: Soft float library routines, Next: Exception handling routines, Prev: Integer library routines, Up: Libgcc
437 Routines for floating point emulation
438 =====================================
440 The software floating point library is used on machines which do not
441 have hardware support for floating point. It is also used whenever
442 `-msoft-float' is used to disable generation of floating point
443 instructions. (Not all targets support this switch.)
445 For compatibility with other compilers, the floating point emulation
446 routines can be renamed with the `DECLARE_LIBRARY_RENAMES' macro (*note
447 Library Calls::). In this section, the default names are used.
449 Presently the library does not support `XFmode', which is used for
450 `long double' on some architectures.
455 - Runtime Function: float __addsf3 (float A, float B)
456 - Runtime Function: double __adddf3 (double A, double B)
457 - Runtime Function: long double __addtf3 (long double A, long double B)
458 - Runtime Function: long double __addxf3 (long double A, long double B)
459 These functions return the sum of A and B.
461 - Runtime Function: float __subsf3 (float A, float B)
462 - Runtime Function: double __subdf3 (double A, double B)
463 - Runtime Function: long double __subtf3 (long double A, long double B)
464 - Runtime Function: long double __subxf3 (long double A, long double B)
465 These functions return the difference between B and A; that is,
468 - Runtime Function: float __mulsf3 (float A, float B)
469 - Runtime Function: double __muldf3 (double A, double B)
470 - Runtime Function: long double __multf3 (long double A, long double B)
471 - Runtime Function: long double __mulxf3 (long double A, long double B)
472 These functions return the product of A and B.
474 - Runtime Function: float __divsf3 (float A, float B)
475 - Runtime Function: double __divdf3 (double A, double B)
476 - Runtime Function: long double __divtf3 (long double A, long double B)
477 - Runtime Function: long double __divxf3 (long double A, long double B)
478 These functions return the quotient of A and B; that is, A / B.
480 - Runtime Function: float __negsf2 (float A)
481 - Runtime Function: double __negdf2 (double A)
482 - Runtime Function: long double __negtf2 (long double A)
483 - Runtime Function: long double __negxf2 (long double A)
484 These functions return the negation of A. They simply flip the
485 sign bit, so they can produce negative zero and negative NaN.
490 - Runtime Function: double __extendsfdf2 (float A)
491 - Runtime Function: long double __extendsftf2 (float A)
492 - Runtime Function: long double __extendsfxf2 (float A)
493 - Runtime Function: long double __extenddftf2 (double A)
494 - Runtime Function: long double __extenddfxf2 (double A)
495 These functions extend A to the wider mode of their return type.
497 - Runtime Function: double __truncxfdf2 (long double A)
498 - Runtime Function: double __trunctfdf2 (long double A)
499 - Runtime Function: float __truncxfsf2 (long double A)
500 - Runtime Function: float __trunctfsf2 (long double A)
501 - Runtime Function: float __truncdfsf2 (double A)
502 These functions truncate A to the narrower mode of their return
503 type, rounding toward zero.
505 - Runtime Function: int __fixsfsi (float A)
506 - Runtime Function: int __fixdfsi (double A)
507 - Runtime Function: int __fixtfsi (long double A)
508 - Runtime Function: int __fixxfsi (long double A)
509 These functions convert A to a signed integer, rounding toward
512 - Runtime Function: long __fixsfdi (float A)
513 - Runtime Function: long __fixdfdi (double A)
514 - Runtime Function: long __fixtfdi (long double A)
515 - Runtime Function: long __fixxfdi (long double A)
516 These functions convert A to a signed long, rounding toward zero.
518 - Runtime Function: long long __fixsfti (float A)
519 - Runtime Function: long long __fixdfti (double A)
520 - Runtime Function: long long __fixtfti (long double A)
521 - Runtime Function: long long __fixxfti (long double A)
522 These functions convert A to a signed long long, rounding toward
525 - Runtime Function: unsigned int __fixunssfsi (float A)
526 - Runtime Function: unsigned int __fixunsdfsi (double A)
527 - Runtime Function: unsigned int __fixunstfsi (long double A)
528 - Runtime Function: unsigned int __fixunsxfsi (long double A)
529 These functions convert A to an unsigned integer, rounding toward
530 zero. Negative values all become zero.
532 - Runtime Function: unsigned long __fixunssfdi (float A)
533 - Runtime Function: unsigned long __fixunsdfdi (double A)
534 - Runtime Function: unsigned long __fixunstfdi (long double A)
535 - Runtime Function: unsigned long __fixunsxfdi (long double A)
536 These functions convert A to an unsigned long, rounding toward
537 zero. Negative values all become zero.
539 - Runtime Function: unsigned long long __fixunssfti (float A)
540 - Runtime Function: unsigned long long __fixunsdfti (double A)
541 - Runtime Function: unsigned long long __fixunstfti (long double A)
542 - Runtime Function: unsigned long long __fixunsxfti (long double A)
543 These functions convert A to an unsigned long long, rounding
544 toward zero. Negative values all become zero.
546 - Runtime Function: float __floatsisf (int I)
547 - Runtime Function: double __floatsidf (int I)
548 - Runtime Function: long double __floatsitf (int I)
549 - Runtime Function: long double __floatsixf (int I)
550 These functions convert I, a signed integer, to floating point.
552 - Runtime Function: float __floatdisf (long I)
553 - Runtime Function: double __floatdidf (long I)
554 - Runtime Function: long double __floatditf (long I)
555 - Runtime Function: long double __floatdixf (long I)
556 These functions convert I, a signed long, to floating point.
558 - Runtime Function: float __floattisf (long long I)
559 - Runtime Function: double __floattidf (long long I)
560 - Runtime Function: long double __floattitf (long long I)
561 - Runtime Function: long double __floattixf (long long I)
562 These functions convert I, a signed long long, to floating point.
567 There are two sets of basic comparison functions.
569 - Runtime Function: int __cmpsf2 (float A, float B)
570 - Runtime Function: int __cmpdf2 (double A, double B)
571 - Runtime Function: int __cmptf2 (long double A, long double B)
572 These functions calculate a <=> b. That is, if A is less than B,
573 they return -1; if A is greater than B, they return 1; and if A
574 and B are equal they return 0. If either argument is NaN they
575 return 1, but you should not rely on this; if NaN is a
576 possibility, use one of the higher-level comparison functions.
578 - Runtime Function: int __unordsf2 (float A, float B)
579 - Runtime Function: int __unorddf2 (double A, double B)
580 - Runtime Function: int __unordtf2 (long double A, long double B)
581 These functions return a nonzero value if either argument is NaN,
584 There is also a complete group of higher level functions which
585 correspond directly to comparison operators. They implement the ISO C
586 semantics for floating-point comparisons, taking NaN into account. Pay
587 careful attention to the return values defined for each set. Under the
588 hood, all of these routines are implemented as
590 if (__unordXf2 (a, b))
592 return __cmpXf2 (a, b);
594 where E is a constant chosen to give the proper behavior for NaN.
595 Thus, the meaning of the return value is different for each set. Do
596 not rely on this implementation; only the semantics documented below
599 - Runtime Function: int __eqsf2 (float A, float B)
600 - Runtime Function: int __eqdf2 (double A, double B)
601 - Runtime Function: int __eqtf2 (long double A, long double B)
602 These functions return zero if neither argument is NaN, and A and
605 - Runtime Function: int __nesf2 (float A, float B)
606 - Runtime Function: int __nedf2 (double A, double B)
607 - Runtime Function: int __netf2 (long double A, long double B)
608 These functions return a nonzero value if either argument is NaN,
609 or if A and B are unequal.
611 - Runtime Function: int __gesf2 (float A, float B)
612 - Runtime Function: int __gedf2 (double A, double B)
613 - Runtime Function: int __getf2 (long double A, long double B)
614 These functions return a value greater than or equal to zero if
615 neither argument is NaN, and A is greater than or equal to B.
617 - Runtime Function: int __ltsf2 (float A, float B)
618 - Runtime Function: int __ltdf2 (double A, double B)
619 - Runtime Function: int __lttf2 (long double A, long double B)
620 These functions return a value less than zero if neither argument
621 is NaN, and A is strictly less than B.
623 - Runtime Function: int __lesf2 (float A, float B)
624 - Runtime Function: int __ledf2 (double A, double B)
625 - Runtime Function: int __letf2 (long double A, long double B)
626 These functions return a value less than or equal to zero if
627 neither argument is NaN, and A is less than or equal to B.
629 - Runtime Function: int __gtsf2 (float A, float B)
630 - Runtime Function: int __gtdf2 (double A, double B)
631 - Runtime Function: int __gttf2 (long double A, long double B)
632 These functions return a value greater than zero if neither
633 argument is NaN, and A is strictly greater than B.
636 File: gccint.info, Node: Exception handling routines, Next: Miscellaneous routines, Prev: Soft float library routines, Up: Libgcc
638 Language-independent routines for exception handling
639 ====================================================
643 _Unwind_DeleteException
648 _Unwind_GetLanguageSpecificData
649 _Unwind_GetRegionStart
650 _Unwind_GetTextRelBase
651 _Unwind_GetDataRelBase
652 _Unwind_RaiseException
656 _Unwind_FindEnclosingFunction
657 _Unwind_SjLj_Register
658 _Unwind_SjLj_Unregister
659 _Unwind_SjLj_RaiseException
660 _Unwind_SjLj_ForcedUnwind
663 __deregister_frame_info
664 __deregister_frame_info_bases
666 __register_frame_info
667 __register_frame_info_bases
668 __register_frame_info_table
669 __register_frame_info_table_bases
670 __register_frame_table
673 File: gccint.info, Node: Miscellaneous routines, Prev: Exception handling routines, Up: Libgcc
675 Miscellaneous runtime library routines
676 ======================================
678 Cache control functions
679 -----------------------
681 - Runtime Function: void __clear_cache (char *BEG, char *END)
682 This function clears the instruction cache between BEG and END.
685 File: gccint.info, Node: Languages, Next: Source Tree, Prev: Libgcc, Up: Top
687 Language Front Ends in GCC
688 **************************
690 The interface to front ends for languages in GCC, and in particular
691 the `tree' structure (*note Trees::), was initially designed for C, and
692 many aspects of it are still somewhat biased towards C and C-like
693 languages. It is, however, reasonably well suited to other procedural
694 languages, and front ends for many such languages have been written for
697 Writing a compiler as a front end for GCC, rather than compiling
698 directly to assembler or generating C code which is then compiled by
699 GCC, has several advantages:
701 * GCC front ends benefit from the support for many different target
702 machines already present in GCC.
704 * GCC front ends benefit from all the optimizations in GCC. Some of
705 these, such as alias analysis, may work better when GCC is
706 compiling directly from source code then when it is compiling from
709 * Better debugging information is generated when compiling directly
710 from source code than when going via intermediate generated C code.
712 Because of the advantages of writing a compiler as a GCC front end,
713 GCC front ends have also been created for languages very different from
714 those for which GCC was designed, such as the declarative
715 logic/functional language Mercury. For these reasons, it may also be
716 useful to implement compilers created for specialized purposes (for
717 example, as part of a research project) as GCC front ends.
720 File: gccint.info, Node: Source Tree, Next: Passes, Prev: Languages, Up: Top
722 Source Tree Structure and Build System
723 **************************************
725 This chapter describes the structure of the GCC source tree, and how
726 GCC is built. The user documentation for building and installing GCC
727 is in a separate manual (`http://gcc.gnu.org/install/'), with which it
728 is presumed that you are familiar.
732 * Configure Terms:: Configuration terminology and history.
733 * Top Level:: The top level source directory.
734 * gcc Directory:: The `gcc' subdirectory.
735 * Testsuites:: The GCC testsuites.
738 File: gccint.info, Node: Configure Terms, Next: Top Level, Up: Source Tree
740 Configure Terms and History
741 ===========================
743 The configure and build process has a long and colorful history, and
744 can be confusing to anyone who doesn't know why things are the way they
745 are. While there are other documents which describe the configuration
746 process in detail, here are a few things that everyone working on GCC
749 There are three system names that the build knows about: the machine
750 you are building on ("build"), the machine that you are building for
751 ("host"), and the machine that GCC will produce code for ("target").
752 When you configure GCC, you specify these with `--build=', `--host=',
755 Specifying the host without specifying the build should be avoided,
756 as `configure' may (and once did) assume that the host you specify is
757 also the build, which may not be true.
759 If build, host, and target are all the same, this is called a
760 "native". If build and host are the same but target is different, this
761 is called a "cross". If build, host, and target are all different this
762 is called a "canadian" (for obscure reasons dealing with Canada's
763 political party and the background of the person working on the build
764 at that time). If host and target are the same, but build is
765 different, you are using a cross-compiler to build a native for a
766 different system. Some people call this a "host-x-host", "crossed
767 native", or "cross-built native". If build and target are the same,
768 but host is different, you are using a cross compiler to build a cross
769 compiler that produces code for the machine you're building on. This
770 is rare, so there is no common way of describing it. There is a
771 proposal to call this a "crossback".
773 If build and host are the same, the GCC you are building will also be
774 used to build the target libraries (like `libstdc++'). If build and
775 host are different, you must have already build and installed a cross
776 compiler that will be used to build the target libraries (if you
777 configured with `--target=foo-bar', this compiler will be called
780 In the case of target libraries, the machine you're building for is
781 the machine you specified with `--target'. So, build is the machine
782 you're building on (no change there), host is the machine you're
783 building for (the target libraries are built for the target, so host is
784 the target you specified), and target doesn't apply (because you're not
785 building a compiler, you're building libraries). The configure/make
786 process will adjust these variables as needed. It also sets
787 `$with_cross_host' to the original `--host' value in case you need it.
789 The `libiberty' support library is built up to three times: once for
790 the host, once for the target (even if they are the same), and once for
791 the build if build and host are different. This allows it to be used
792 by all programs which are generated in the course of the build process.
795 File: gccint.info, Node: Top Level, Next: gcc Directory, Prev: Configure Terms, Up: Source Tree
797 Top Level Source Directory
798 ==========================
800 The top level source directory in a GCC distribution contains several
801 files and directories that are shared with other software distributions
802 such as that of GNU Binutils. It also contains several subdirectories
803 that contain parts of GCC and its runtime libraries:
806 The Boehm conservative garbage collector, used as part of the Java
810 Contributed scripts that may be found useful in conjunction with
811 GCC. One of these, `contrib/texi2pod.pl', is used to generate man
812 pages from Texinfo manuals as part of the GCC build process.
815 An implementation of the `jar' command, used with the Java front
819 The main sources of GCC itself (except for runtime libraries),
820 including optimizers, support for different target architectures,
821 language front ends, and testsuites. *Note The `gcc'
822 Subdirectory: gcc Directory, for details.
825 Headers for the `libiberty' library.
828 The Fortran runtime library.
831 The `libffi' library, used as part of the Java runtime library.
834 The `libiberty' library, used for portability and for some
835 generally useful data structures and algorithms. *Note
836 Introduction: (libiberty)Top, for more information about this
840 The Java runtime library.
843 The Objective-C runtime library.
846 The C++ runtime library.
849 Scripts used by the `gccadmin' account on `gcc.gnu.org'.
852 The `zlib' compression library, used by the Java front end and as
853 part of the Java runtime library.
855 The build system in the top level directory, including how recursion
856 into subdirectories works and how building runtime libraries for
857 multilibs is handled, is documented in a separate manual, included with
858 GNU Binutils. *Note GNU configure and build system: (configure)Top,
862 File: gccint.info, Node: gcc Directory, Next: Testsuites, Prev: Top Level, Up: Source Tree
864 The `gcc' Subdirectory
865 ======================
867 The `gcc' directory contains many files that are part of the C
868 sources of GCC, other files used as part of the configuration and build
869 process, and subdirectories including documentation and a testsuite.
870 The files that are sources of GCC are documented in a separate chapter.
871 *Note Passes and Files of the Compiler: Passes.
875 * Subdirectories:: Subdirectories of `gcc'.
876 * Configuration:: The configuration process, and the files it uses.
877 * Build:: The build system in the `gcc' directory.
878 * Makefile:: Targets in `gcc/Makefile'.
879 * Library Files:: Library source files and headers under `gcc/'.
880 * Headers:: Headers installed by GCC.
881 * Documentation:: Building documentation in GCC.
882 * Front End:: Anatomy of a language front end.
883 * Back End:: Anatomy of a target back end.
886 File: gccint.info, Node: Subdirectories, Next: Configuration, Up: gcc Directory
888 Subdirectories of `gcc'
889 -----------------------
891 The `gcc' directory contains the following subdirectories:
894 Subdirectories for various languages. Directories containing a
895 file `config-lang.in' are language subdirectories. The contents of
896 the subdirectories `cp' (for C++) and `objc' (for Objective-C) are
897 documented in this manual (*note Passes and Files of the Compiler:
898 Passes.); those for other languages are not. *Note Anatomy of a
899 Language Front End: Front End, for details of the files in these
903 Configuration files for supported architectures and operating
904 systems. *Note Anatomy of a Target Back End: Back End, for
905 details of the files in this directory.
908 Texinfo documentation for GCC, together with automatically
909 generated man pages and support for converting the installation
910 manual to HTML. *Note Documentation::.
913 The support for fixing system headers to work with GCC. See
914 `fixinc/README' for more information. The headers fixed by this
915 mechanism are installed in `LIBSUBDIR/include'. Along with those
916 headers, `README-fixinc' is also installed, as
917 `LIBSUBDIR/include/README'.
920 System headers installed by GCC, mainly those required by the C
921 standard of freestanding implementations. *Note Headers Installed
922 by GCC: Headers, for details of when these and other headers are
926 GNU `libintl', from GNU `gettext', for systems which do not
927 include it in libc. Properly, this directory should be at top
928 level, parallel to the `gcc' directory.
931 Message catalogs with translations of messages produced by GCC into
932 various languages, `LANGUAGE.po'. This directory also contains
933 `gcc.pot', the template for these message catalogues, `exgettext',
934 a wrapper around `gettext' to extract the messages from the GCC
935 sources and create `gcc.pot', which is run by `make gcc.pot', and
936 `EXCLUDES', a list of files from which messages should not be
940 The GCC testsuites (except for those for runtime libraries).
944 File: gccint.info, Node: Configuration, Next: Build, Prev: Subdirectories, Up: gcc Directory
946 Configuration in the `gcc' Directory
947 ------------------------------------
949 The `gcc' directory is configured with an Autoconf-generated script
950 `configure'. The `configure' script is generated from `configure.ac'
951 and `aclocal.m4'. From the files `configure.ac' and `acconfig.h',
952 Autoheader generates the file `config.in'. The file `cstamp-h.in' is
957 * Config Fragments:: Scripts used by `configure'.
958 * System Config:: The `config.build', `config.host', and
960 * Configuration Files:: Files created by running `configure'.
963 File: gccint.info, Node: Config Fragments, Next: System Config, Up: Configuration
965 Scripts Used by `configure'
966 ...........................
968 `configure' uses some other scripts to help in its work:
970 * The standard GNU `config.sub' and `config.guess' files, kept in
971 the top level directory, are used. FIXME: when is the
972 `config.guess' file in the `gcc' directory (that just calls the
975 * The file `config.gcc' is used to handle configuration specific to
976 the particular target machine. The file `config.build' is used to
977 handle configuration specific to the particular build machine.
978 The file `config.host' is used to handle configuration specific to
979 the particular host machine. (In general, these should only be
980 used for features that cannot reasonably be tested in Autoconf
981 feature tests.) *Note The `config.build'; `config.host'; and
982 `config.gcc' Files: System Config, for details of the contents of
985 * Each language subdirectory has a file `LANGUAGE/config-lang.in'
986 that is used for front-end-specific configuration. *Note The
987 Front End `config-lang.in' File: Front End Config, for details of
990 * A helper script `configure.frag' is used as part of creating the
991 output of `configure'.
994 File: gccint.info, Node: System Config, Next: Configuration Files, Prev: Config Fragments, Up: Configuration
996 The `config.build'; `config.host'; and `config.gcc' Files
997 .........................................................
999 The `config.build' file contains specific rules for particular
1000 systems which GCC is built on. This should be used as rarely as
1001 possible, as the behavior of the build system can always be detected by
1004 The `config.host' file contains specific rules for particular systems
1005 which GCC will run on. This is rarely needed.
1007 The `config.gcc' file contains specific rules for particular systems
1008 which GCC will generate code for. This is usually needed.
1010 Each file has a list of the shell variables it sets, with
1011 descriptions, at the top of the file.
1013 FIXME: document the contents of these files, and what variables
1014 should be set to control build, host and target configuration.
1017 File: gccint.info, Node: Configuration Files, Prev: System Config, Up: Configuration
1019 Files Created by `configure'
1020 ............................
1022 Here we spell out what files will be set up by `configure' in the
1023 `gcc' directory. Some other files are created as temporary files in
1024 the configuration process, and are not used in the subsequent build;
1025 these are not documented.
1027 * `Makefile' is constructed from `Makefile.in', together with the
1028 host and target fragments (*note Makefile Fragments: Fragments.)
1029 `t-TARGET' and `x-HOST' from `config', if any, and language
1030 Makefile fragments `LANGUAGE/Make-lang.in'.
1032 * `auto-host.h' contains information about the host machine
1033 determined by `configure'. If the host machine is different from
1034 the build machine, then `auto-build.h' is also created, containing
1035 such information about the build machine.
1037 * `config.status' is a script that may be run to recreate the
1038 current configuration.
1040 * `configargs.h' is a header containing details of the arguments
1041 passed to `configure' to configure GCC, and of the thread model
1044 * `cstamp-h' is used as a timestamp.
1046 * `fixinc/Makefile' is constructed from `fixinc/Makefile.in'.
1048 * `gccbug', a script for reporting bugs in GCC, is constructed from
1051 * `intl/Makefile' is constructed from `intl/Makefile.in'.
1053 * `mklibgcc', a shell script to create a Makefile to build libgcc,
1054 is constructed from `mklibgcc.in'.
1056 * If a language `config-lang.in' file (*note The Front End
1057 `config-lang.in' File: Front End Config.) sets `outputs', then the
1058 files listed in `outputs' there are also generated.
1060 The following configuration headers are created from the Makefile,
1061 using `mkconfig.sh', rather than directly by `configure'. `config.h',
1062 `bconfig.h' and `tconfig.h' all contain the `xm-MACHINE.h' header, if
1063 any, appropriate to the host, build and target machines respectively,
1064 the configuration headers for the target, and some definitions; for the
1065 host and build machines, these include the autoconfigured headers
1066 generated by `configure'. The other configuration headers are
1067 determined by `config.gcc'. They also contain the typedefs for `rtx',
1070 * `config.h', for use in programs that run on the host machine.
1072 * `bconfig.h', for use in programs that run on the build machine.
1074 * `tconfig.h', for use in programs and libraries for the target
1077 * `tm_p.h', which includes the header `MACHINE-protos.h' that
1078 contains prototypes for functions in the target `.c' file. FIXME:
1079 why is such a separate header necessary?
1082 File: gccint.info, Node: Build, Next: Makefile, Prev: Configuration, Up: gcc Directory
1084 Build System in the `gcc' Directory
1085 -----------------------------------
1087 FIXME: describe the build system, including what is built in what
1088 stages. Also list the various source files that are used in the build
1089 process but aren't source files of GCC itself and so aren't documented
1090 below (*note Passes::).
1093 File: gccint.info, Node: Makefile, Next: Library Files, Prev: Build, Up: gcc Directory
1099 This is the default target. Depending on what your
1100 build/host/target configuration is, it coordinates all the things
1101 that need to be built.
1104 Produce info-formatted documentation and man pages. Essentially it
1105 calls `make man' and `make info'.
1108 Produce DVI-formatted documentation.
1114 Generate info-formatted pages.
1117 Delete the files made while building the compiler.
1120 That, and all the other files built by `make all'.
1123 That, and all the files created by `configure'.
1126 Distclean plus any file that can be generated from other files.
1127 Note that additional tools may be required beyond what is normally
1128 needed to build gcc.
1131 Generates files in the source directory that do not exist in CVS
1132 but should go into a release tarball. One example is
1133 `gcc/c-parse.c' which is generated from the CVS source file
1138 Copies the info-formatted and manpage documentation into the source
1139 directory usually for the purpose of generating a release tarball.
1145 Deletes installed files.
1148 Run the testsuite. This creates a `testsuite' subdirectory that
1149 has various `.sum' and `.log' files containing the results of the
1150 testing. You can run subsets with, for example, `make check-gcc'.
1151 You can specify specific tests by setting RUNTESTFLAGS to be the
1152 name of the `.exp' file, optionally followed by (for some tests)
1153 an equals and a file wildcard, like:
1155 make check-gcc RUNTESTFLAGS="execute.exp=19980413-*"
1157 Note that running the testsuite may require additional tools be
1158 installed, such as TCL or dejagnu.
1161 Builds GCC three times--once with the native compiler, once with
1162 the native-built compiler it just built, and once with the
1163 compiler it built the second time. In theory, the last two should
1164 produce the same results, which `make compare' can check. Each
1165 step of this process is called a "stage", and the results of each
1166 stage N (N = 1...3) are copied to a subdirectory `stageN/'.
1169 Like `bootstrap', except that the various stages are removed once
1170 they're no longer needed. This saves disk space.
1173 This incrementally rebuilds each of the three stages, one at a
1174 time. It does this by "bubbling" the stages up from their
1175 subdirectories (if they had been built previously), rebuilding
1176 them, and copying them back to their subdirectories. This will
1177 allow you to, for example, continue a bootstrap after fixing a bug
1178 which causes the stage2 build to crash.
1181 Rebuilds the most recently built stage. Since each stage requires
1182 special invocation, using this target means you don't have to keep
1183 track of which stage you're on or what invocation that stage needs.
1186 Removed everything (`make clean') and rebuilds (`make bootstrap').
1189 Like `cleanstrap', except that the process starts from the first
1190 stage build, not from scratch.
1192 `stageN (N = 1...4)'
1193 For each stage, moves the appropriate files to the `stageN'
1196 `unstageN (N = 1...4)'
1197 Undoes the corresponding `stageN'.
1199 `restageN (N = 1...4)'
1200 Undoes the corresponding `stageN' and rebuilds it with the
1204 Compares the results of stages 2 and 3. This ensures that the
1205 compiler is running properly, since it should produce the same
1206 object files regardless of how it itself was compiled.
1209 Builds a compiler with profiling feedback information. For more
1210 information, see *Note Building with profile feedback:
1211 (gccinstall)Building. This is actually a target in the top-level
1212 directory, which then recurses into the `gcc' subdirectory
1216 File: gccint.info, Node: Library Files, Next: Headers, Prev: Makefile, Up: gcc Directory
1218 Library Source Files and Headers under the `gcc' Directory
1219 ----------------------------------------------------------
1221 FIXME: list here, with explanation, all the C source files and
1222 headers under the `gcc' directory that aren't built into the GCC
1223 executable but rather are part of runtime libraries and object files,
1224 such as `crtstuff.c' and `unwind-dw2.c'. *Note Headers Installed by
1225 GCC: Headers, for more information about the `ginclude' directory.
1228 File: gccint.info, Node: Headers, Next: Documentation, Prev: Library Files, Up: gcc Directory
1230 Headers Installed by GCC
1231 ------------------------
1233 In general, GCC expects the system C library to provide most of the
1234 headers to be used with it. However, GCC will fix those headers if
1235 necessary to make them work with GCC, and will install some headers
1236 required of freestanding implementations. These headers are installed
1237 in `LIBSUBDIR/include'. Headers for non-C runtime libraries are also
1238 installed by GCC; these are not documented here. (FIXME: document them
1241 Several of the headers GCC installs are in the `ginclude' directory.
1242 These headers, `iso646.h', `stdarg.h', `stdbool.h', and `stddef.h',
1243 are installed in `LIBSUBDIR/include', unless the target Makefile
1244 fragment (*note Target Fragment::) overrides this by setting `USER_H'.
1246 In addition to these headers and those generated by fixing system
1247 headers to work with GCC, some other headers may also be installed in
1248 `LIBSUBDIR/include'. `config.gcc' may set `extra_headers'; this
1249 specifies additional headers under `config' to be installed on some
1252 GCC installs its own version of `<float.h>', from `ginclude/float.h'.
1253 This is done to cope with command-line options that change the
1254 representation of floating point numbers.
1256 GCC also installs its own version of `<limits.h>'; this is generated
1257 from `glimits.h', together with `limitx.h' and `limity.h' if the system
1258 also has its own version of `<limits.h>'. (GCC provides its own header
1259 because it is required of ISO C freestanding implementations, but needs
1260 to include the system header from its own header as well because other
1261 standards such as POSIX specify additional values to be defined in
1262 `<limits.h>'.) The system's `<limits.h>' header is used via
1263 `LIBSUBDIR/include/syslimits.h', which is copied from `gsyslimits.h' if
1264 it does not need fixing to work with GCC; if it needs fixing,
1265 `syslimits.h' is the fixed copy.
1268 File: gccint.info, Node: Documentation, Next: Front End, Prev: Headers, Up: gcc Directory
1270 Building Documentation
1271 ----------------------
1273 The main GCC documentation is in the form of manuals in Texinfo
1274 format. These are installed in Info format, and DVI versions may be
1275 generated by `make dvi'. In addition, some man pages are generated
1276 from the Texinfo manuals, there are some other text files with
1277 miscellaneous documentation, and runtime libraries have their own
1278 documentation outside the `gcc' directory. FIXME: document the
1279 documentation for runtime libraries somewhere.
1283 * Texinfo Manuals:: GCC manuals in Texinfo format.
1284 * Man Page Generation:: Generating man pages from Texinfo manuals.
1285 * Miscellaneous Docs:: Miscellaneous text files with documentation.
1288 File: gccint.info, Node: Texinfo Manuals, Next: Man Page Generation, Up: Documentation
1293 The manuals for GCC as a whole, and the C and C++ front ends, are in
1294 files `doc/*.texi'. Other front ends have their own manuals in files
1295 `LANGUAGE/*.texi'. Common files `doc/include/*.texi' are provided
1296 which may be included in multiple manuals; the following files are in
1300 The GNU Free Documentation License.
1303 The section "Funding Free Software".
1306 Common definitions for manuals.
1309 The GNU General Public License.
1312 A copy of `texinfo.tex' known to work with the GCC manuals.
1314 DVI formatted manuals are generated by `make dvi', which uses
1315 `texi2dvi' (via the Makefile macro `$(TEXI2DVI)'). Info manuals are
1316 generated by `make info' (which is run as part of a bootstrap); this
1317 generates the manuals in the source directory, using `makeinfo' via the
1318 Makefile macro `$(MAKEINFO)', and they are included in release
1321 Manuals are also provided on the GCC web site, in both HTML and
1322 PostScript forms. This is done via the script
1323 `maintainer-scripts/update_web_docs'. Each manual to be provided
1324 online must be listed in the definition of `MANUALS' in that file; a
1325 file `NAME.texi' must only appear once in the source tree, and the
1326 output manual must have the same name as the source file. (However,
1327 other Texinfo files, included in manuals but not themselves the root
1328 files of manuals, may have names that appear more than once in the
1329 source tree.) The manual file `NAME.texi' should only include other
1330 files in its own directory or in `doc/include'. HTML manuals will be
1331 generated by `makeinfo --html' and PostScript manuals by `texi2dvi' and
1332 `dvips'. All Texinfo files that are parts of manuals must be checked
1333 into CVS, even if they are generated files, for the generation of
1334 online manuals to work.
1336 The installation manual, `doc/install.texi', is also provided on the
1337 GCC web site. The HTML version is generated by the script
1338 `doc/install.texi2html'.
1341 File: gccint.info, Node: Man Page Generation, Next: Miscellaneous Docs, Prev: Texinfo Manuals, Up: Documentation
1346 Because of user demand, in addition to full Texinfo manuals, man
1347 pages are provided which contain extracts from those manuals. These man
1348 pages are generated from the Texinfo manuals using
1349 `contrib/texi2pod.pl' and `pod2man'. (The man page for `g++',
1350 `cp/g++.1', just contains a `.so' reference to `gcc.1', but all the
1351 other man pages are generated from Texinfo manuals.)
1353 Because many systems may not have the necessary tools installed to
1354 generate the man pages, they are only generated if the `configure'
1355 script detects that recent enough tools are installed, and the
1356 Makefiles allow generating man pages to fail without aborting the
1357 build. Man pages are also included in release distributions. They are
1358 generated in the source directory.
1360 Magic comments in Texinfo files starting `@c man' control what parts
1361 of a Texinfo file go into a man page. Only a subset of Texinfo is
1362 supported by `texi2pod.pl', and it may be necessary to add support for
1363 more Texinfo features to this script when generating new man pages. To
1364 improve the man page output, some special Texinfo macros are provided
1365 in `doc/include/gcc-common.texi' which `texi2pod.pl' understands:
1368 Use in the form `@table @gcctabopt' for tables of options, where
1369 for printed output the effect of `@code' is better than that of
1370 `@option' but for man page output a different effect is wanted.
1373 Use for summary lists of options in manuals.
1376 Use at the end of each line inside `@gccoptlist'. This is
1377 necessary to avoid problems with differences in how the
1378 `@gccoptlist' macro is handled by different Texinfo formatters.
1380 FIXME: describe the `texi2pod.pl' input language and magic comments
1384 File: gccint.info, Node: Miscellaneous Docs, Prev: Man Page Generation, Up: Documentation
1386 Miscellaneous Documentation
1387 ...........................
1389 In addition to the formal documentation that is installed by GCC,
1390 there are several other text files with miscellaneous documentation:
1393 Notes on GCC's Native Language Support. FIXME: this should be
1394 part of this manual rather than a separate file.
1397 Notes on the Free Translation Project.
1400 The GNU General Public License.
1403 The GNU Lesser General Public License.
1407 Change log files for various parts of GCC.
1410 Details of a few changes to the GCC front-end interface. FIXME:
1411 the information in this file should be part of general
1412 documentation of the front-end interface in this manual.
1415 Information about new features in old versions of GCC. (For recent
1416 versions, the information is on the GCC web site.)
1418 `README.Portability'
1419 Information about portability issues when writing code in GCC.
1420 FIXME: why isn't this part of this manual or of the GCC Coding
1424 A pointer to the GNU Service Directory.
1426 FIXME: document such files in subdirectories, at least `config',
1427 `cp', `objc', `testsuite'.
1430 File: gccint.info, Node: Front End, Next: Back End, Prev: Documentation, Up: gcc Directory
1432 Anatomy of a Language Front End
1433 -------------------------------
1435 A front end for a language in GCC has the following parts:
1437 * A directory `LANGUAGE' under `gcc' containing source files for
1438 that front end. *Note The Front End `LANGUAGE' Directory: Front
1439 End Directory, for details.
1441 * A mention of the language in the list of supported languages in
1442 `gcc/doc/install.texi'.
1444 * A mention of the name under which the language's runtime library is
1445 recognized by `--enable-shared=PACKAGE' in the documentation of
1446 that option in `gcc/doc/install.texi'.
1448 * A mention of any special prerequisites for building the front end
1449 in the documentation of prerequisites in `gcc/doc/install.texi'.
1451 * Details of contributors to that front end in
1452 `gcc/doc/contrib.texi'. If the details are in that front end's
1453 own manual then there should be a link to that manual's list in
1456 * Information about support for that language in
1457 `gcc/doc/frontends.texi'.
1459 * Information about standards for that language, and the front end's
1460 support for them, in `gcc/doc/standards.texi'. This may be a link
1461 to such information in the front end's own manual.
1463 * Details of source file suffixes for that language and `-x LANG'
1464 options supported, in `gcc/doc/invoke.texi'.
1466 * Entries in `default_compilers' in `gcc.c' for source file suffixes
1469 * Preferably testsuites, which may be under `gcc/testsuite' or
1470 runtime library directories. FIXME: document somewhere how to
1471 write testsuite harnesses.
1473 * Probably a runtime library for the language, outside the `gcc'
1474 directory. FIXME: document this further.
1476 * Details of the directories of any runtime libraries in
1477 `gcc/doc/sourcebuild.texi'.
1479 If the front end is added to the official GCC CVS repository, the
1480 following are also necessary:
1482 * At least one Bugzilla component for bugs in that front end and
1483 runtime libraries. This category needs to be mentioned in
1484 `gcc/gccbug.in', as well as being added to the Bugzilla database.
1486 * Normally, one or more maintainers of that front end listed in
1489 * Mentions on the GCC web site in `index.html' and `frontends.html',
1490 with any relevant links on `readings.html'. (Front ends that are
1491 not an official part of GCC may also be listed on
1492 `frontends.html', with relevant links.)
1494 * A news item on `index.html', and possibly an announcement on the
1495 <gcc-announce@gcc.gnu.org> mailing list.
1497 * The front end's manuals should be mentioned in
1498 `maintainer-scripts/update_web_docs' (*note Texinfo Manuals::) and
1499 the online manuals should be linked to from
1500 `onlinedocs/index.html'.
1502 * Any old releases or CVS repositories of the front end, before its
1503 inclusion in GCC, should be made available on the GCC FTP site
1504 `ftp://gcc.gnu.org/pub/gcc/old-releases/'.
1506 * The release and snapshot script `maintainer-scripts/gcc_release'
1507 should be updated to generate appropriate tarballs for this front
1508 end. The associated `maintainer-scripts/snapshot-README' and
1509 `maintainer-scripts/snapshot-index.html' files should be updated
1510 to list the tarballs and diffs for this front end.
1512 * If this front end includes its own version files that include the
1513 current date, `maintainer-scripts/update_version' should be
1514 updated accordingly.
1516 * `CVSROOT/modules' in the GCC CVS repository should be updated.
1520 * Front End Directory:: The front end `LANGUAGE' directory.
1521 * Front End Config:: The front end `config-lang.in' file.
1524 File: gccint.info, Node: Front End Directory, Next: Front End Config, Up: Front End
1526 The Front End `LANGUAGE' Directory
1527 ..................................
1529 A front end `LANGUAGE' directory contains the source files of that
1530 front end (but not of any runtime libraries, which should be outside
1531 the `gcc' directory). This includes documentation, and possibly some
1532 subsidiary programs build alongside the front end. Certain files are
1533 special and other parts of the compiler depend on their names:
1536 This file is required in all language subdirectories. *Note The
1537 Front End `config-lang.in' File: Front End Config, for details of
1541 This file is required in all language subdirectories. It contains
1542 targets `LANG.HOOK' (where `LANG' is the setting of `language' in
1543 `config-lang.in') for the following values of `HOOK', and any
1544 other Makefile rules required to build those targets (which may if
1545 necessary use other Makefiles specified in `outputs' in
1546 `config-lang.in', although this is deprecated). Some hooks are
1547 defined by using a double-colon rule for `HOOK', rather than by
1548 using a target of form `LANG.HOOK'. These hooks are called
1549 "double-colon hooks" below. It also adds any testsuite targets
1550 that can use the standard rule in `gcc/Makefile.in' to the variable
1557 FIXME: exactly what goes in each of these targets?
1560 Build an `etags' `TAGS' file in the language subdirectory in
1564 Build info documentation for the front end, in the build
1565 directory. This target is only called by `make bootstrap' if
1566 a suitable version of `makeinfo' is available, so does not
1567 need to check for this, and should fail if an error occurs.
1570 Build DVI documentation for the front end, in the build
1571 directory. This should be done using `$(TEXI2DVI)', with
1572 appropriate `-I' arguments pointing to directories of
1573 included files. This hook is a double-colon hook.
1576 Build generated man pages for the front end from Texinfo
1577 manuals (*note Man Page Generation::), in the build
1578 directory. This target is only called if the necessary tools
1579 are available, but should ignore errors so as not to stop the
1580 build if errors occur; man pages are optional and the tools
1581 involved may be installed in a broken way.
1584 FIXME: what is this target for?
1587 Install everything that is part of the front end, apart from
1588 the compiler executables listed in `compilers' in
1592 Install info documentation for the front end, if it is
1593 present in the source directory. This target should have
1594 dependencies on info files that should be installed. This
1595 hook is a double-colon hook.
1598 Install man pages for the front end. This target should
1602 Copies its dependencies into the source directory. This
1603 generally should be used for generated files such as
1604 `gcc/c-parse.c' which are not present in CVS, but should be
1605 included in any release tarballs. This target will be
1606 executed during a bootstrap if
1607 `--enable-generated-files-in-srcdir' was specified as a
1612 Copies its dependencies into the source directory. These
1613 targets will be executed during a bootstrap if
1614 `--enable-generated-files-in-srcdir' was specified as a
1618 Uninstall files installed by installing the compiler. This is
1619 currently documented not to be supported, so the hook need
1626 The language parts of the standard GNU `*clean' targets.
1627 *Note Standard Targets for Users: (standards)Standard
1628 Targets, for details of the standard targets. For GCC,
1629 `maintainer-clean' should delete all generated files in the
1630 source directory that are not checked into CVS, but should
1631 not delete anything checked into CVS.
1639 Move to the stage directory files not included in
1640 `stagestuff' in `config-lang.in' or otherwise moved by the
1644 This file registers the set of switches that the front end accepts
1645 on the command line, and their -help text. The file format is
1646 documented in the file `c.opt'. These files are processed by the
1650 This file provides entries for `default_compilers' in `gcc.c'
1651 which override the default of giving an error that a compiler for
1652 that language is not installed.
1655 This file, which need not exist, defines any language-specific tree
1659 File: gccint.info, Node: Front End Config, Prev: Front End Directory, Up: Front End
1661 The Front End `config-lang.in' File
1662 ...................................
1664 Each language subdirectory contains a `config-lang.in' file. In
1665 addition the main directory contains `c-config-lang.in', which contains
1666 limited information for the C language. This file is a shell script
1667 that may define some variables describing the language:
1670 This definition must be present, and gives the name of the language
1671 for some purposes such as arguments to `--enable-languages'.
1674 If defined, this variable lists (space-separated) language front
1675 ends other than C that this front end requires to be enabled (with
1676 the names given being their `language' settings). For example, the
1677 Java front end depends on the C++ front end, so sets
1678 `lang_requires=c++'.
1681 If defined, this variable lists (space-separated) targets in the
1682 top level `Makefile' to build the runtime libraries for this
1683 language, such as `target-libobjc'.
1686 If defined, this variable lists (space-separated) top level
1687 directories (parallel to `gcc'), apart from the runtime libraries,
1688 that should not be configured if this front end is not built.
1691 If defined to `no', this language front end is not built unless
1692 enabled in a `--enable-languages' argument. Otherwise, front ends
1693 are built by default, subject to any special logic in
1694 `configure.ac' (as is present to disable the Ada front end if the
1695 Ada compiler is not already installed).
1698 If defined to `yes', this front end is built in stage 1 of the
1699 bootstrap. This is only relevant to front ends written in their
1703 If defined, a space-separated list of compiler executables that
1704 will be run by the driver. The names here will each end with
1708 If defined, a space-separated list of files that should be moved to
1709 the `stageN' directories in each stage of bootstrap.
1712 If defined, a space-separated list of files that should be
1713 generated by `configure' substituting values in them. This
1714 mechanism can be used to create a file `LANGUAGE/Makefile' from
1715 `LANGUAGE/Makefile.in', but this is deprecated, building
1716 everything from the single `gcc/Makefile' is preferred.
1719 If defined, a space-separated list of files that should be scanned
1720 by gengtype.c to generate the garbage collection tables and
1721 routines for this language. This excludes the files that are
1722 common to all front ends. *Note Type Information::.
1725 File: gccint.info, Node: Back End, Prev: Front End, Up: gcc Directory
1727 Anatomy of a Target Back End
1728 ----------------------------
1730 A back end for a target architecture in GCC has the following parts:
1732 * A directory `MACHINE' under `gcc/config', containing a machine
1733 description `MACHINE.md' file (*note Machine Descriptions: Machine
1734 Desc.), header files `MACHINE.h' and `MACHINE-protos.h' and a
1735 source file `MACHINE.c' (*note Target Description Macros and
1736 Functions: Target Macros.), possibly a target Makefile fragment
1737 `t-MACHINE' (*note The Target Makefile Fragment: Target
1738 Fragment.), and maybe some other files. The names of these files
1739 may be changed from the defaults given by explicit specifications
1742 * If necessary, a file `MACHINE-modes.def' in the `MACHINE'
1743 directory, containing additional machine modes to represent
1744 condition codes. *Note Condition Code::, for further details.
1746 * Entries in `config.gcc' (*note The `config.gcc' File: System
1747 Config.) for the systems with this target architecture.
1749 * Documentation in `gcc/doc/invoke.texi' for any command-line
1750 options supported by this target (*note Run-time Target
1751 Specification: Run-time Target.). This means both entries in the
1752 summary table of options and details of the individual options.
1754 * Documentation in `gcc/doc/extend.texi' for any target-specific
1755 attributes supported (*note Defining target-specific uses of
1756 `__attribute__': Target Attributes.), including where the same
1757 attribute is already supported on some targets, which are
1758 enumerated in the manual.
1760 * Documentation in `gcc/doc/extend.texi' for any target-specific
1763 * Documentation in `gcc/doc/extend.texi' of any target-specific
1764 built-in functions supported.
1766 * Documentation in `gcc/doc/md.texi' of any target-specific
1767 constraint letters (*note Constraints for Particular Machines:
1768 Machine Constraints.).
1770 * A note in `gcc/doc/contrib.texi' under the person or people who
1771 contributed the target support.
1773 * Entries in `gcc/doc/install.texi' for all target triplets
1774 supported with this target architecture, giving details of any
1775 special notes about installation for this target, or saying that
1776 there are no special notes if there are none.
1778 * Possibly other support outside the `gcc' directory for runtime
1779 libraries. FIXME: reference docs for this. The libstdc++ porting
1780 manual needs to be installed as info for this to work, or to be a
1781 chapter of this manual.
1783 If the back end is added to the official GCC CVS repository, the
1784 following are also necessary:
1786 * An entry for the target architecture in `readings.html' on the GCC
1787 web site, with any relevant links.
1789 * Details of the properties of the back end and target architecture
1790 in `backends.html' on the GCC web site.
1792 * A news item about the contribution of support for that target
1793 architecture, in `index.html' on the GCC web site.
1795 * Normally, one or more maintainers of that target listed in
1796 `MAINTAINERS'. Some existing architectures may be unmaintained,
1797 but it would be unusual to add support for a target that does not
1798 have a maintainer when support is added.
1801 File: gccint.info, Node: Testsuites, Prev: gcc Directory, Up: Source Tree
1806 GCC contains several testsuites to help maintain compiler quality.
1807 Most of the runtime libraries and language front ends in GCC have
1808 testsuites. Currently only the C language testsuites are documented
1809 here; FIXME: document the others.
1813 * Test Idioms:: Idioms used in testsuite code.
1814 * Ada Tests:: The Ada language testsuites.
1815 * C Tests:: The C language testsuites.
1816 * libgcj Tests:: The Java library testsuites.
1817 * gcov Testing:: Support for testing gcov.
1818 * profopt Testing:: Support for testing profile-directed optimizations.
1819 * compat Testing:: Support for testing binary compatibility.
1822 File: gccint.info, Node: Test Idioms, Next: Ada Tests, Up: Testsuites
1824 Idioms Used in Testsuite Code
1825 -----------------------------
1827 In general C testcases have a trailing `-N.c', starting with `-1.c',
1828 in case other testcases with similar names are added later. If the
1829 test is a test of some well-defined feature, it should have a name
1830 referring to that feature such as `FEATURE-1.c'. If it does not test a
1831 well-defined feature but just happens to exercise a bug somewhere in
1832 the compiler, and a bug report has been filed for this bug in the GCC
1833 bug database, `prBUG-NUMBER-1.c' is the appropriate form of name.
1834 Otherwise (for miscellaneous bugs not filed in the GCC bug database),
1835 and previously more generally, test cases are named after the date on
1836 which they were added. This allows people to tell at a glance whether
1837 a test failure is because of a recently found bug that has not yet been
1838 fixed, or whether it may be a regression, but does not give any other
1839 information about the bug or where discussion of it may be found. Some
1840 other language testsuites follow similar conventions.
1842 Test cases should use `abort ()' to indicate failure and `exit (0)'
1843 for success; on some targets these may be redefined to indicate failure
1844 and success in other ways.
1846 In the `gcc.dg' testsuite, it is often necessary to test that an
1847 error is indeed a hard error and not just a warning--for example, where
1848 it is a constraint violation in the C standard, which must become an
1849 error with `-pedantic-errors'. The following idiom, where the first
1850 line shown is line LINE of the file and the line that generates the
1851 error, is used for this:
1853 /* { dg-bogus "warning" "warning in place of error" } */
1854 /* { dg-error "REGEXP" "MESSAGE" { target *-*-* } LINE } */
1856 It may be necessary to check that an expression is an integer
1857 constant expression and has a certain value. To check that `E' has
1858 value `V', an idiom similar to the following is used:
1860 char x[((E) == (V) ? 1 : -1)];
1862 In `gcc.dg' tests, `__typeof__' is sometimes used to make assertions
1863 about the types of expressions. See, for example,
1864 `gcc.dg/c99-condexpr-1.c'. The more subtle uses depend on the exact
1865 rules for the types of conditional expressions in the C standard; see,
1866 for example, `gcc.dg/c99-intconst-1.c'.
1868 It is useful to be able to test that optimizations are being made
1869 properly. This cannot be done in all cases, but it can be done where
1870 the optimization will lead to code being optimized away (for example,
1871 where flow analysis or alias analysis should show that certain code
1872 cannot be called) or to functions not being called because they have
1873 been expanded as built-in functions. Such tests go in
1874 `gcc.c-torture/execute'. Where code should be optimized away, a call
1875 to a nonexistent function such as `link_failure ()' may be inserted; a
1878 #ifndef __OPTIMIZE__
1886 will also be needed so that linking still succeeds when the test is run
1887 without optimization. When all calls to a built-in function should
1888 have been optimized and no calls to the non-built-in version of the
1889 function should remain, that function may be defined as `static' to
1890 call `abort ()' (although redeclaring a function as static may not work
1893 All testcases must be portable. Target-specific testcases must have
1894 appropriate code to avoid causing failures on unsupported systems;
1895 unfortunately, the mechanisms for this differ by directory.
1897 FIXME: discuss non-C testsuites here.
1900 File: gccint.info, Node: Ada Tests, Next: C Tests, Prev: Test Idioms, Up: Testsuites
1902 Ada Language Testsuites
1903 -----------------------
1905 The Ada testsuite includes executable tests from the ACATS 2.5
1906 testsuite, publicly available at
1907 `http://www.adaic.org/compilers/acats/2.5'
1909 These tests are integrated in the GCC testsuite in the
1910 `gcc/testsuite/ada/acats' directory, and enabled automatically when
1911 running `make check', assuming the Ada language has been enabled when
1914 You can also run the Ada testsuite independently, using `make
1915 check-ada', or run a subset of the tests by specifying which chapter to
1918 $ make check-ada CHAPTERS="c3 c9"
1920 The tests are organized by directory, each directory corresponding to
1921 a chapter of the Ada Reference Manual. So for example, c9 corresponds
1922 to chapter 9, which deals with tasking features of the language.
1924 There is also an extra chapter called `gcc' containing a template for
1925 creating new executable tests.
1927 The tests are run using two 'sh' scripts: run_acats and run_all.sh
1928 To run the tests using a simulator or a cross target, see the small
1929 customization section at the top of run_all.sh
1931 These tests are run using the build tree: they can be run without
1932 doing a `make install'.
1935 File: gccint.info, Node: C Tests, Next: libgcj Tests, Prev: Ada Tests, Up: Testsuites
1937 C Language Testsuites
1938 ---------------------
1940 GCC contains the following C language testsuites, in the
1941 `gcc/testsuite' directory:
1944 This contains tests of particular features of the C compiler,
1945 using the more modern `dg' harness. Correctness tests for various
1946 compiler features should go here if possible.
1948 Magic comments determine whether the file is preprocessed,
1949 compiled, linked or run. In these tests, error and warning
1950 message texts are compared against expected texts or regular
1951 expressions given in comments. These tests are run with the
1952 options `-ansi -pedantic' unless other options are given in the
1953 test. Except as noted below they are not run with multiple
1954 optimization options.
1957 This subdirectory contains tests for binary compatibility using
1958 `compat.exp', which in turn uses the language-independent support
1959 (*note Support for testing binary compatibility: compat Testing.).
1962 This subdirectory contains tests of the preprocessor.
1965 This subdirectory contains tests for debug formats. Tests in this
1966 subdirectory are run for each debug format that the compiler
1970 This subdirectory contains tests of the `-Wformat' format
1971 checking. Tests in this directory are run with and without
1975 This subdirectory contains tests of code that should not compile
1976 and does not need any special compilation options. They are run
1977 with multiple optimization options, since sometimes invalid code
1978 crashes the compiler with optimization.
1981 FIXME: describe this.
1984 This contains particular code fragments which have historically
1985 broken easily. These tests are run with multiple optimization
1986 options, so tests for features which only break at some
1987 optimization levels belong here. This also contains tests to
1988 check that certain optimizations occur. It might be worthwhile to
1989 separate the correctness tests cleanly from the code quality
1990 tests, but it hasn't been done yet.
1992 `gcc.c-torture/compat'
1993 FIXME: describe this.
1995 This directory should probably not be used for new tests.
1997 `gcc.c-torture/compile'
1998 This testsuite contains test cases that should compile, but do not
1999 need to link or run. These test cases are compiled with several
2000 different combinations of optimization options. All warnings are
2001 disabled for these test cases, so this directory is not suitable if
2002 you wish to test for the presence or absence of compiler warnings.
2003 While special options can be set, and tests disabled on specific
2004 platforms, by the use of `.x' files, mostly these test cases
2005 should not contain platform dependencies. FIXME: discuss how
2006 defines such as `NO_LABEL_VALUES' and `STACK_SIZE' are used.
2008 `gcc.c-torture/execute'
2009 This testsuite contains test cases that should compile, link and
2010 run; otherwise the same comments as for `gcc.c-torture/compile'
2013 `gcc.c-torture/execute/ieee'
2014 This contains tests which are specific to IEEE floating point.
2016 `gcc.c-torture/unsorted'
2017 FIXME: describe this.
2019 This directory should probably not be used for new tests.
2021 `gcc.c-torture/misc-tests'
2022 This directory contains C tests that require special handling.
2023 Some of these tests have individual expect files, and others share
2024 special-purpose expect files:
2027 Test `-fbranch-probabilities' using `bprob.exp', which in
2028 turn uses the generic, language-independent framework (*note
2029 Support for testing profile-directed optimizations: profopt
2033 Test the testsuite itself using `dg-test.exp'.
2036 Test `gcov' output using `gcov.exp', which in turn uses the
2037 language-independent support (*note Support for testing gcov:
2041 Test i386-specific support for data prefetch using
2042 `i386-prefetch.exp'.
2044 FIXME: merge in `testsuite/README.gcc' and discuss the format of
2045 test cases and magic comments more.
2048 File: gccint.info, Node: libgcj Tests, Next: gcov Testing, Prev: C Tests, Up: Testsuites
2050 The Java library testsuites.
2051 ----------------------------
2053 Runtime tests are executed via `make check' in the
2054 `TARGET/libjava/testsuite' directory in the build tree. Additional
2055 runtime tests can be checked into this testsuite.
2057 Regression testing of the core packages in libgcj is also covered by
2058 the Mauve testsuite. The Mauve Project develops tests for the Java
2059 Class Libraries. These tests are run as part of libgcj testing by
2060 placing the Mauve tree within the libjava testsuite sources at
2061 `libjava/testsuite/libjava.mauve/mauve', or by specifying the location
2062 of that tree when invoking `make', as in `make MAUVEDIR=~/mauve check'.
2064 To detect regressions, a mechanism in `mauve.exp' compares the
2065 failures for a test run against the list of expected failures in
2066 `libjava/testsuite/libjava.mauve/xfails' from the source hierarchy.
2067 Update this file when adding new failing tests to Mauve, or when fixing
2068 bugs in libgcj that had caused Mauve test failures.
2070 The Jacks project provides a testsuite for Java compilers that can
2071 be used to test changes that affect the GCJ front end. This testsuite
2072 is run as part of Java testing by placing the Jacks tree within the the
2073 libjava testsuite sources at `libjava/testsuite/libjava.jacks/jacks'.
2075 We encourage developers to contribute test cases to Mauve and Jacks.
2078 File: gccint.info, Node: gcov Testing, Next: profopt Testing, Prev: libgcj Tests, Up: Testsuites
2080 Support for testing `gcov'
2081 --------------------------
2083 Language-independent support for testing `gcov', and for checking
2084 that branch profiling produces expected values, is provided by the
2085 expect file `gcov.exp'. `gcov' tests also rely on procedures in
2086 `gcc.dg.exp' to compile and run the test program. A typical `gcov'
2087 test contains the following DejaGNU commands within comments:
2089 { dg-options "-fprofile-arcs -ftest-coverage" }
2090 { dg-do run { target native } }
2091 { dg-final { run-gcov sourcefile } }
2093 Checks of `gcov' output can include line counts, branch percentages,
2094 and call return percentages. All of these checks are requested via
2095 commands that appear in comments in the test's source file. Commands
2096 to check line counts are processed by default. Commands to check
2097 branch percentages and call return percentages are processed if the
2098 `run-gcov' command has arguments `branches' or `calls', respectively.
2099 For example, the following specifies checking both, as well as passing
2102 { dg-final { run-gcov branches calls { -b sourcefile } } }
2104 A line count command appears within a comment on the source line
2105 that is expected to get the specified count and has the form
2106 `count(CNT)'. A test should only check line counts for lines that will
2107 get the same count for any architecture.
2109 Commands to check branch percentages (`branch') and call return
2110 percentages (`returns') are very similar to each other. A beginning
2111 command appears on or before the first of a range of lines that will
2112 report the percentage, and the ending command follows that range of
2113 lines. The beginning command can include a list of percentages, all of
2114 which are expected to be found within the range. A range is terminated
2115 by the next command of the same kind. A command `branch(end)' or
2116 `returns(end)' marks the end of a range without starting a new one.
2119 if (i > 10 && j > i && j < 20) /* branch(27 50 75) */
2123 For a call return percentage, the value specified is the percentage
2124 of calls reported to return. For a branch percentage, the value is
2125 either the expected percentage or 100 minus that value, since the
2126 direction of a branch can differ depending on the target or the
2129 Not all branches and calls need to be checked. A test should not
2130 check for branches that might be optimized away or replaced with
2131 predicated instructions. Don't check for calls inserted by the
2132 compiler or ones that might be inlined or optimized away.
2134 A single test can check for combinations of line counts, branch
2135 percentages, and call return percentages. The command to check a line
2136 count must appear on the line that will report that count, but commands
2137 to check branch percentages and call return percentages can bracket the
2138 lines that report them.
2141 File: gccint.info, Node: profopt Testing, Next: compat Testing, Prev: gcov Testing, Up: Testsuites
2143 Support for testing profile-directed optimizations
2144 --------------------------------------------------
2146 The file `profopt.exp' provides language-independent support for
2147 checking correct execution of a test built with profile-directed
2148 optimization. This testing requires that a test program be built and
2149 executed twice. The first time it is compiled to generate profile
2150 data, and the second time it is compiled to use the data that was
2151 generated during the first execution. The second execution is to
2152 verify that the test produces the expected results.
2154 To check that the optimization actually generated better code, a
2155 test can be built and run a third time with normal optimizations to
2156 verify that the performance is better with the profile-directed
2157 optimizations. `profopt.exp' has the beginnings of this kind of
2160 `profopt.exp' provides generic support for profile-directed
2161 optimizations. Each set of tests that uses it provides information
2162 about a specific optimization:
2165 tool being tested, e.g., `gcc'
2168 options used to generate profile data
2171 options used to optimize using that profile data
2174 suffix of profile data files
2177 list of options with which to run each test, similar to the lists
2181 File: gccint.info, Node: compat Testing, Prev: profopt Testing, Up: Testsuites
2183 Support for testing binary compatibility
2184 ----------------------------------------
2186 The file `compat.exp' provides language-independent support for
2187 binary compatibility testing. It supports testing interoperability of
2188 two compilers that follow the same ABI, or of multiple sets of compiler
2189 options that should not affect binary compatibility. It is intended to
2190 be used for testsuites that complement ABI testsuites.
2192 A test supported by this framework has three parts, each in a
2193 separate source file: a main program and two pieces that interact with
2194 each other to split up the functionality being tested.
2196 `TESTNAME_main.SUFFIX'
2197 Contains the main program, which calls a function in file
2198 `TESTNAME_x.SUFFIX'.
2201 Contains at least one call to a function in `TESTNAME_y.SUFFIX'.
2204 Shares data with, or gets arguments from, `TESTNAME_x.SUFFIX'.
2206 Within each test, the main program and one functional piece are
2207 compiled by the GCC under test. The other piece can be compiled by an
2208 alternate compiler. If no alternate compiler is specified, then all
2209 three source files are all compiled by the GCC under test. It's also
2210 possible to specify a pair of lists of compiler options, one list for
2211 each compiler, so that each test will be compiled with each pair of
2214 `compat.exp' defines default pairs of compiler options. These can
2215 be overridden by defining the environment variable `COMPAT_OPTIONS' as:
2217 COMPAT_OPTIONS="[list [list {TST1} {ALT1}]
2218 ...[list {TSTN} {ALTN}]]"
2220 where TSTI and ALTI are lists of options, with TSTI used by the
2221 compiler under test and ALTI used by the alternate compiler. For
2222 example, with `[list [list {-g -O0} {-O3}] [list {-fpic} {-fPIC -O2}]]',
2223 the test is first built with `-g -O0' by the compiler under test and
2224 with `-O3' by the alternate compiler. The test is built a second time
2225 using `-fpic' by the compiler under test and `-fPIC -O2' by the
2228 An alternate compiler is specified by defining an environment
2229 variable; for C++ define `ALT_CXX_UNDER_TEST' to be the full pathname
2230 of an installed compiler. That will be written to the `site.exp' file
2231 used by DejaGNU. The default is to build each test with the compiler
2232 under test using the first of each pair of compiler options from
2233 `COMPAT_OPTIONS'. When `ALT_CXX_UNDER_TEST' is `same', each test is
2234 built using the compiler under test but with combinations of the
2235 options from `COMPAT_OPTIONS'.
2237 To run only the C++ compatibility suite using the compiler under test
2238 and another version of GCC using specific compiler options, do the
2239 following from `OBJDIR/gcc':
2243 ALT_CXX_UNDER_TEST=${alt_prefix}/bin/g++ \
2244 COMPAT_OPTIONS="lists as shown above" \
2246 RUNTESTFLAGS="compat.exp"
2248 A test that fails when the source files are compiled with different
2249 compilers, but passes when the files are compiled with the same
2250 compiler, demonstrates incompatibility of the generated code or runtime
2251 support. A test that fails for the alternate compiler but passes for
2252 the compiler under test probably tests for a bug that was fixed in the
2253 compiler under test but is present in the alternate compiler.
2256 File: gccint.info, Node: Passes, Next: Trees, Prev: Source Tree, Up: Top
2258 Passes and Files of the Compiler
2259 ********************************
2261 The overall control structure of the compiler is in `toplev.c'. This
2262 file is responsible for initialization, decoding arguments, opening and
2263 closing files, and sequencing the passes. Routines for emitting
2264 diagnostic messages are defined in `diagnostic.c'. The files
2265 `pretty-print.h' and `pretty-print.c' provide basic support for
2266 language-independent pretty-printing.
2268 The parsing pass is invoked only once, to parse the entire input. A
2269 high level tree representation is then generated from the input, one
2270 function at a time. This tree code is then transformed into RTL
2271 intermediate code, and processed. The files involved in transforming
2272 the trees into RTL are `expr.c', `expmed.c', and `stmt.c'. The order
2273 of trees that are processed, is not necessarily the same order they are
2274 generated from the input, due to deferred inlining, and other
2277 Each time the parsing pass reads a complete function definition or
2278 top-level declaration, it calls either the function
2279 `rest_of_compilation', or the function `rest_of_decl_compilation' in
2280 `toplev.c', which are responsible for all further processing necessary,
2281 ending with output of the assembler language. All other compiler
2282 passes run, in sequence, within `rest_of_compilation'. When that
2283 function returns from compiling a function definition, the storage used
2284 for that function definition's compilation is entirely freed, unless it
2285 is an inline function, or was deferred for some reason (this can occur
2286 in templates, for example). (*note An Inline Function is As Fast As a
2287 Macro: (gcc)Inline.).
2289 Here is a list of all the passes of the compiler and their source
2290 files. Also included is a description of where debugging dumps can be
2291 requested with `-d' options.
2293 * Parsing. This pass reads the entire text of a function definition,
2294 constructing a high level tree representation. (Because of the
2295 semantic analysis that takes place during this pass, it does more
2296 than is formally considered to be parsing.)
2298 The tree representation does not entirely follow C syntax, because
2299 it is intended to support other languages as well.
2301 Language-specific data type analysis is also done in this pass,
2302 and every tree node that represents an expression has a data type
2303 attached. Variables are represented as declaration nodes.
2305 The language-independent source files for parsing are `tree.c',
2306 `fold-const.c', and `stor-layout.c'. There are also header files
2307 `tree.h' and `tree.def' which define the format of the tree
2310 C preprocessing, for language front ends, that want or require it,
2311 is performed by cpplib, which is covered in separate
2312 documentation. In particular, the internals are covered in *Note
2313 Cpplib internals: (cppinternals)Top.
2315 The source files to parse C are found in the toplevel directory,
2316 and by convention are named `c-*'. Some of these are also used by
2317 the other C-like languages: `c-common.c', `c-common.def',
2318 `c-format.c', `c-opts.c', `c-pragma.c', `c-semantics.c', `c-lex.c',
2319 `c-incpath.c', `c-ppoutput.c', `c-cppbuiltin.c', `c-common.h',
2320 `c-dump.h', `c.opt', `c-incpath.h' and `c-pragma.h',
2322 Files specific to each language are in subdirectories named after
2323 the language in question, like `ada', `objc', `cp' (for C++).
2325 * Tree optimization. This is the optimization of the tree
2326 representation, before converting into RTL code.
2328 Currently, the main optimization performed here is tree-based
2329 inlining. This is implemented in `tree-inline.c' and used by both
2330 C and C++. Note that tree based inlining turns off rtx based
2331 inlining (since it's more powerful, it would be a waste of time to
2332 do rtx based inlining in addition).
2334 Constant folding and some arithmetic simplifications are also done
2335 during this pass, on the tree representation. The routines that
2336 perform these tasks are located in `fold-const.c'.
2338 * RTL generation. This is the conversion of syntax tree into RTL
2341 This is where the bulk of target-parameter-dependent code is found,
2342 since often it is necessary for strategies to apply only when
2343 certain standard kinds of instructions are available. The purpose
2344 of named instruction patterns is to provide this information to
2345 the RTL generation pass.
2347 Optimization is done in this pass for `if'-conditions that are
2348 comparisons, boolean operations or conditional expressions. Tail
2349 recursion is detected at this time also. Decisions are made about
2350 how best to arrange loops and how to output `switch' statements.
2352 The source files for RTL generation include `stmt.c', `calls.c',
2353 `expr.c', `explow.c', `expmed.c', `function.c', `optabs.c' and
2354 `emit-rtl.c'. Also, the file `insn-emit.c', generated from the
2355 machine description by the program `genemit', is used in this
2356 pass. The header file `expr.h' is used for communication within
2359 The header files `insn-flags.h' and `insn-codes.h', generated from
2360 the machine description by the programs `genflags' and `gencodes',
2361 tell this pass which standard names are available for use and
2362 which patterns correspond to them.
2364 Aside from debugging information output, none of the following
2365 passes refers to the tree structure representation of the function
2366 (only part of which is saved).
2368 The decision of whether the function can and should be expanded
2369 inline in its subsequent callers is made at the end of rtl
2370 generation. The function must meet certain criteria, currently
2371 related to the size of the function and the types and number of
2372 parameters it has. Note that this function may contain loops,
2373 recursive calls to itself (tail-recursive functions can be
2374 inlined!), gotos, in short, all constructs supported by GCC. The
2375 file `integrate.c' contains the code to save a function's rtl for
2376 later inlining and to inline that rtl when the function is called.
2377 The header file `integrate.h' is also used for this purpose.
2379 The option `-dr' causes a debugging dump of the RTL code after
2380 this pass. This dump file's name is made by appending `.rtl' to
2381 the input file name.
2383 * Sibling call optimization. This pass performs tail recursion
2384 elimination, and tail and sibling call optimizations. The purpose
2385 of these optimizations is to reduce the overhead of function calls,
2388 The source file of this pass is `sibcall.c'
2390 The option `-di' causes a debugging dump of the RTL code after
2391 this pass is run. This dump file's name is made by appending
2392 `.sibling' to the input file name.
2394 * Jump optimization. This pass simplifies jumps to the following
2395 instruction, jumps across jumps, and jumps to jumps. It deletes
2396 unreferenced labels and unreachable code, except that unreachable
2397 code that contains a loop is not recognized as unreachable in this
2398 pass. (Such loops are deleted later in the basic block analysis.)
2399 It also converts some code originally written with jumps into
2400 sequences of instructions that directly set values from the
2401 results of comparisons, if the machine has such instructions.
2403 Jump optimization is performed two or three times. The first time
2404 is immediately following RTL generation. The second time is after
2405 CSE, but only if CSE says repeated jump optimization is needed.
2406 The last time is right before the final pass. That time,
2407 cross-jumping and deletion of no-op move instructions are done
2408 together with the optimizations described above.
2410 The source file of this pass is `jump.c'.
2412 The option `-dj' causes a debugging dump of the RTL code after
2413 this pass is run for the first time. This dump file's name is
2414 made by appending `.jump' to the input file name.
2416 * Register scan. This pass finds the first and last use of each
2417 register, as a guide for common subexpression elimination. Its
2418 source is in `regclass.c'.
2420 * Jump threading. This pass detects a condition jump that branches
2421 to an identical or inverse test. Such jumps can be `threaded'
2422 through the second conditional test. The source code for this
2423 pass is in `jump.c'. This optimization is only performed if
2424 `-fthread-jumps' is enabled.
2426 * Common subexpression elimination. This pass also does constant
2427 propagation. Its source files are `cse.c', and `cselib.c'. If
2428 constant propagation causes conditional jumps to become
2429 unconditional or to become no-ops, jump optimization is run again
2430 when CSE is finished.
2432 The option `-ds' causes a debugging dump of the RTL code after
2433 this pass. This dump file's name is made by appending `.cse' to
2434 the input file name.
2436 * Global common subexpression elimination. This pass performs two
2437 different types of GCSE depending on whether you are optimizing
2438 for size or not (LCM based GCSE tends to increase code size for a
2439 gain in speed, while Morel-Renvoise based GCSE does not). When
2440 optimizing for size, GCSE is done using Morel-Renvoise Partial
2441 Redundancy Elimination, with the exception that it does not try to
2442 move invariants out of loops--that is left to the loop
2443 optimization pass. If MR PRE GCSE is done, code hoisting (aka
2444 unification) is also done, as well as load motion. If you are
2445 optimizing for speed, LCM (lazy code motion) based GCSE is done.
2446 LCM is based on the work of Knoop, Ruthing, and Steffen. LCM
2447 based GCSE also does loop invariant code motion. We also perform
2448 load and store motion when optimizing for speed. Regardless of
2449 which type of GCSE is used, the GCSE pass also performs global
2450 constant and copy propagation.
2452 The source file for this pass is `gcse.c', and the LCM routines
2455 The option `-dG' causes a debugging dump of the RTL code after
2456 this pass. This dump file's name is made by appending `.gcse' to
2457 the input file name.
2459 * Loop optimization. This pass moves constant expressions out of
2460 loops, and optionally does strength-reduction and loop unrolling
2461 as well. Its source files are `loop.c' and `unroll.c', plus the
2462 header `loop.h' used for communication between them. Loop
2463 unrolling uses some functions in `integrate.c' and the header
2464 `integrate.h'. Loop dependency analysis routines are contained in
2467 Second loop optimization pass takes care of basic block level
2468 optimizations - unrolling, peeling and unswitching loops. The
2469 source files are `cfgloopanal.c' and `cfgloopmanip.c' containing
2470 generic loop analysis and manipulation code, `loop-init.c' with
2471 initialization and finalization code, `loop-unswitch.c' for loop
2472 unswitching and `loop-unroll.c' for loop unrolling and peeling.
2474 The option `-dL' causes a debugging dump of the RTL code after
2475 these passes. The dump file names are made by appending `.loop'
2476 and `.loop2' to the input file name.
2478 * Jump bypassing. This pass is an aggressive form of GCSE that
2479 transforms the control flow graph of a function by propagating
2480 constants into conditional branch instructions.
2482 The source file for this pass is `gcse.c'.
2484 The option `-dG' causes a debugging dump of the RTL code after
2485 this pass. This dump file's name is made by appending `.bypass'
2486 to the input file name.
2488 * Simple optimization pass that splits independent uses of each
2489 pseudo increasing effect of other optimizations. This can improve
2490 effect of the other transformation, such as CSE or register
2491 allocation. Its source files are `web.c'.
2493 The option `-dZ' causes a debugging dump of the RTL code after
2494 this pass. This dump file's name is made by appending `.web' to
2495 the input file name.
2497 * If `-frerun-cse-after-loop' was enabled, a second common
2498 subexpression elimination pass is performed after the loop
2499 optimization pass. Jump threading is also done again at this time
2500 if it was specified.
2502 The option `-dt' causes a debugging dump of the RTL code after
2503 this pass. This dump file's name is made by appending `.cse2' to
2504 the input file name.
2506 * Data flow analysis (`flow.c'). This pass divides the program into
2507 basic blocks (and in the process deletes unreachable loops); then
2508 it computes which pseudo-registers are live at each point in the
2509 program, and makes the first instruction that uses a value point at
2510 the instruction that computed the value.
2512 This pass also deletes computations whose results are never used,
2513 and combines memory references with add or subtract instructions
2514 to make autoincrement or autodecrement addressing.
2516 The option `-df' causes a debugging dump of the RTL code after
2517 this pass. This dump file's name is made by appending `.flow' to
2518 the input file name. If stupid register allocation is in use, this
2519 dump file reflects the full results of such allocation.
2521 * Instruction combination (`combine.c'). This pass attempts to
2522 combine groups of two or three instructions that are related by
2523 data flow into single instructions. It combines the RTL
2524 expressions for the instructions by substitution, simplifies the
2525 result using algebra, and then attempts to match the result
2526 against the machine description.
2528 The option `-dc' causes a debugging dump of the RTL code after
2529 this pass. This dump file's name is made by appending `.combine'
2530 to the input file name.
2532 * If-conversion is a transformation that transforms control
2533 dependencies into data dependencies (IE it transforms conditional
2534 code into a single control stream). It is implemented in the file
2537 The option `-dE' causes a debugging dump of the RTL code after
2538 this pass. This dump file's name is made by appending `.ce' to
2539 the input file name.
2541 * Register movement (`regmove.c'). This pass looks for cases where
2542 matching constraints would force an instruction to need a reload,
2543 and this reload would be a register-to-register move. It then
2544 attempts to change the registers used by the instruction to avoid
2545 the move instruction.
2547 The option `-dN' causes a debugging dump of the RTL code after
2548 this pass. This dump file's name is made by appending `.regmove'
2549 to the input file name.
2551 * Instruction scheduling (`sched.c'). This pass looks for
2552 instructions whose output will not be available by the time that
2553 it is used in subsequent instructions. (Memory loads and floating
2554 point instructions often have this behavior on RISC machines). It
2555 re-orders instructions within a basic block to try to separate the
2556 definition and use of items that otherwise would cause pipeline
2559 Instruction scheduling is performed twice. The first time is
2560 immediately after instruction combination and the second is
2561 immediately after reload.
2563 The option `-dS' causes a debugging dump of the RTL code after this
2564 pass is run for the first time. The dump file's name is made by
2565 appending `.sched' to the input file name.
2567 * Register allocation. These passes make sure that all occurrences
2568 of pseudo registers are eliminated, either by allocating them to a
2569 hard register, replacing them by an equivalent expression (e.g. a
2570 constant) or by placing them on the stack. This is done in
2573 * Register class preferencing. The RTL code is scanned to find
2574 out which register class is best for each pseudo register.
2575 The source file is `regclass.c'.
2577 * Local register allocation (`local-alloc.c'). This pass
2578 allocates hard registers to pseudo registers that are used
2579 only within one basic block. Because the basic block is
2580 linear, it can use fast and powerful techniques to do a very
2583 The option `-dl' causes a debugging dump of the RTL code after
2584 this pass. This dump file's name is made by appending
2585 `.lreg' to the input file name.
2587 * Global register allocation (`global.c'). This pass allocates
2588 hard registers for the remaining pseudo registers (those
2589 whose life spans are not contained in one basic block).
2591 * Graph coloring register allocator. The files `ra.c',
2592 `ra-build.c', `ra-colorize.c', `ra-debug.c', `ra-rewrite.c'
2593 together with the header `ra.h' contain another register
2594 allocator, which is used when the option `-fnew-ra' is given.
2595 In that case it is run instead of the above mentioned local
2596 and global register allocation passes, and the option `-dl'
2597 causes a debugging dump of its work.
2599 * Reloading. This pass renumbers pseudo registers with the
2600 hardware registers numbers they were allocated. Pseudo
2601 registers that did not get hard registers are replaced with
2602 stack slots. Then it finds instructions that are invalid
2603 because a value has failed to end up in a register, or has
2604 ended up in a register of the wrong kind. It fixes up these
2605 instructions by reloading the problematical values
2606 temporarily into registers. Additional instructions are
2607 generated to do the copying.
2609 The reload pass also optionally eliminates the frame pointer
2610 and inserts instructions to save and restore call-clobbered
2611 registers around calls.
2613 Source files are `reload.c' and `reload1.c', plus the header
2614 `reload.h' used for communication between them.
2616 The option `-dg' causes a debugging dump of the RTL code after
2617 this pass. This dump file's name is made by appending
2618 `.greg' to the input file name.
2620 * Instruction scheduling is repeated here to try to avoid pipeline
2621 stalls due to memory loads generated for spilled pseudo registers.
2623 The option `-dR' causes a debugging dump of the RTL code after
2624 this pass. This dump file's name is made by appending `.sched2'
2625 to the input file name.
2627 * Basic block reordering. This pass implements profile guided code
2628 positioning. If profile information is not available, various
2629 types of static analysis are performed to make the predictions
2630 normally coming from the profile feedback (IE execution frequency,
2631 branch probability, etc). It is implemented in the file
2632 `bb-reorder.c', and the various prediction routines are in
2635 The option `-dB' causes a debugging dump of the RTL code after
2636 this pass. This dump file's name is made by appending `.bbro' to
2637 the input file name.
2639 * Delayed branch scheduling. This optional pass attempts to find
2640 instructions that can go into the delay slots of other
2641 instructions, usually jumps and calls. The source file name is
2644 The option `-dd' causes a debugging dump of the RTL code after
2645 this pass. This dump file's name is made by appending `.dbr' to
2646 the input file name.
2648 * Branch shortening. On many RISC machines, branch instructions
2649 have a limited range. Thus, longer sequences of instructions must
2650 be used for long branches. In this pass, the compiler figures out
2651 what how far each instruction will be from each other instruction,
2652 and therefore whether the usual instructions, or the longer
2653 sequences, must be used for each branch.
2655 * Conversion from usage of some hard registers to usage of a register
2656 stack may be done at this point. Currently, this is supported only
2657 for the floating-point registers of the Intel 80387 coprocessor.
2658 The source file name is `reg-stack.c'.
2660 The options `-dk' causes a debugging dump of the RTL code after
2661 this pass. This dump file's name is made by appending `.stack' to
2662 the input file name.
2664 * Final. This pass outputs the assembler code for the function. It
2665 is also responsible for identifying spurious test and compare
2666 instructions. Machine-specific peephole optimizations are
2667 performed at the same time. The function entry and exit sequences
2668 are generated directly as assembler code in this pass; they never
2671 The source files are `final.c' plus `insn-output.c'; the latter is
2672 generated automatically from the machine description by the tool
2673 `genoutput'. The header file `conditions.h' is used for
2674 communication between these files.
2676 * Debugging information output. This is run after final because it
2677 must output the stack slot offsets for pseudo registers that did
2678 not get hard registers. Source files are `dbxout.c' for DBX
2679 symbol table format, `sdbout.c' for SDB symbol table format,
2680 `dwarfout.c' for DWARF symbol table format, files `dwarf2out.c' and
2681 `dwarf2asm.c' for DWARF2 symbol table format, and `vmsdbgout.c'
2682 for VMS debug symbol table format.
2684 Some additional files are used by all or many passes:
2686 * Every pass uses `machmode.def' and `machmode.h' which define the
2689 * Several passes use `real.h', which defines the default
2690 representation of floating point constants and how to operate on
2693 * All the passes that work with RTL use the header files `rtl.h' and
2694 `rtl.def', and subroutines in file `rtl.c'. The tools `gen*' also
2695 use these files to read and work with the machine description RTL.
2697 * All the tools that read the machine description use support
2698 routines found in `gensupport.c', `errors.c', and `read-rtl.c'.
2700 * Several passes refer to the header file `insn-config.h' which
2701 contains a few parameters (C macro definitions) generated
2702 automatically from the machine description RTL by the tool
2705 * Several passes use the instruction recognizer, which consists of
2706 `recog.c' and `recog.h', plus the files `insn-recog.c' and
2707 `insn-extract.c' that are generated automatically from the machine
2708 description by the tools `genrecog' and `genextract'.
2710 * Several passes use the header files `regs.h' which defines the
2711 information recorded about pseudo register usage, and
2712 `basic-block.h' which defines the information recorded about basic
2715 * `hard-reg-set.h' defines the type `HARD_REG_SET', a bit-vector
2716 with a bit for each hard register, and some macros to manipulate
2717 it. This type is just `int' if the machine has few enough hard
2718 registers; otherwise it is an array of `int' and some of the
2719 macros expand into loops.
2721 * Several passes use instruction attributes. A definition of the
2722 attributes defined for a particular machine is in file
2723 `insn-attr.h', which is generated from the machine description by
2724 the program `genattr'. The file `insn-attrtab.c' contains
2725 subroutines to obtain the attribute values for insns and
2726 information about processor pipeline characteristics for the
2727 instruction scheduler. It is generated from the machine
2728 description by the program `genattrtab'.
2731 File: gccint.info, Node: Trees, Next: RTL, Prev: Passes, Up: Top
2733 Trees: The intermediate representation used by the C and C++ front ends
2734 ***********************************************************************
2736 This chapter documents the internal representation used by GCC to
2737 represent C and C++ source programs. When presented with a C or C++
2738 source program, GCC parses the program, performs semantic analysis
2739 (including the generation of error messages), and then produces the
2740 internal representation described here. This representation contains a
2741 complete representation for the entire translation unit provided as
2742 input to the front end. This representation is then typically processed
2743 by a code-generator in order to produce machine code, but could also be
2744 used in the creation of source browsers, intelligent editors, automatic
2745 documentation generators, interpreters, and any other programs needing
2746 the ability to process C or C++ code.
2748 This chapter explains the internal representation. In particular, it
2749 documents the internal representation for C and C++ source constructs,
2750 and the macros, functions, and variables that can be used to access
2751 these constructs. The C++ representation is largely a superset of the
2752 representation used in the C front end. There is only one construct
2753 used in C that does not appear in the C++ front end and that is the GNU
2754 "nested function" extension. Many of the macros documented here do not
2755 apply in C because the corresponding language constructs do not appear
2758 If you are developing a "back end", be it is a code-generator or some
2759 other tool, that uses this representation, you may occasionally find
2760 that you need to ask questions not easily answered by the functions and
2761 macros available here. If that situation occurs, it is quite likely
2762 that GCC already supports the functionality you desire, but that the
2763 interface is simply not documented here. In that case, you should ask
2764 the GCC maintainers (via mail to <gcc@gcc.gnu.org>) about documenting
2765 the functionality you require. Similarly, if you find yourself writing
2766 functions that do not deal directly with your back end, but instead
2767 might be useful to other people using the GCC front end, you should
2768 submit your patches for inclusion in GCC.
2772 * Deficiencies:: Topics net yet covered in this document.
2773 * Tree overview:: All about `tree's.
2774 * Types:: Fundamental and aggregate types.
2775 * Scopes:: Namespaces and classes.
2776 * Functions:: Overloading, function bodies, and linkage.
2777 * Declarations:: Type declarations and variables.
2778 * Attributes:: Declaration and type attributes.
2779 * Expression trees:: From `typeid' to `throw'.
2782 File: gccint.info, Node: Deficiencies, Next: Tree overview, Up: Trees
2787 There are many places in which this document is incomplet and
2788 incorrekt. It is, as of yet, only _preliminary_ documentation.
2791 File: gccint.info, Node: Tree overview, Next: Types, Prev: Deficiencies, Up: Trees
2796 The central data structure used by the internal representation is the
2797 `tree'. These nodes, while all of the C type `tree', are of many
2798 varieties. A `tree' is a pointer type, but the object to which it
2799 points may be of a variety of types. From this point forward, we will
2800 refer to trees in ordinary type, rather than in `this font', except
2801 when talking about the actual C type `tree'.
2803 You can tell what kind of node a particular tree is by using the
2804 `TREE_CODE' macro. Many, many macros take trees as input and return
2805 trees as output. However, most macros require a certain kind of tree
2806 node as input. In other words, there is a type-system for trees, but
2807 it is not reflected in the C type-system.
2809 For safety, it is useful to configure GCC with `--enable-checking'.
2810 Although this results in a significant performance penalty (since all
2811 tree types are checked at run-time), and is therefore inappropriate in a
2812 release version, it is extremely helpful during the development process.
2814 Many macros behave as predicates. Many, although not all, of these
2815 predicates end in `_P'. Do not rely on the result type of these macros
2816 being of any particular type. You may, however, rely on the fact that
2817 the type can be compared to `0', so that statements like
2818 if (TEST_P (t) && !TEST_P (y))
2822 int i = (TEST_P (t) != 0);
2824 are legal. Macros that return `int' values now may be changed to
2825 return `tree' values, or other pointers in the future. Even those that
2826 continue to return `int' may return multiple nonzero codes where
2827 previously they returned only zero and one. Therefore, you should not
2829 if (TEST_P (t) == 1)
2831 as this code is not guaranteed to work correctly in the future.
2833 You should not take the address of values returned by the macros or
2834 functions described here. In particular, no guarantee is given that the
2837 In general, the names of macros are all in uppercase, while the
2838 names of functions are entirely in lowercase. There are rare
2839 exceptions to this rule. You should assume that any macro or function
2840 whose name is made up entirely of uppercase letters may evaluate its
2841 arguments more than once. You may assume that a macro or function
2842 whose name is made up entirely of lowercase letters will evaluate its
2843 arguments only once.
2845 The `error_mark_node' is a special tree. Its tree code is
2846 `ERROR_MARK', but since there is only ever one node with that code, the
2847 usual practice is to compare the tree against `error_mark_node'. (This
2848 test is just a test for pointer equality.) If an error has occurred
2849 during front-end processing the flag `errorcount' will be set. If the
2850 front end has encountered code it cannot handle, it will issue a
2851 message to the user and set `sorrycount'. When these flags are set,
2852 any macro or function which normally returns a tree of a particular
2853 kind may instead return the `error_mark_node'. Thus, if you intend to
2854 do any processing of erroneous code, you must be prepared to deal with
2855 the `error_mark_node'.
2857 Occasionally, a particular tree slot (like an operand to an
2858 expression, or a particular field in a declaration) will be referred to
2859 as "reserved for the back end." These slots are used to store RTL when
2860 the tree is converted to RTL for use by the GCC back end. However, if
2861 that process is not taking place (e.g., if the front end is being hooked
2862 up to an intelligent editor), then those slots may be used by the back
2863 end presently in use.
2865 If you encounter situations that do not match this documentation,
2866 such as tree nodes of types not mentioned here, or macros documented to
2867 return entities of a particular kind that instead return entities of
2868 some different kind, you have found a bug, either in the front end or in
2869 the documentation. Please report these bugs as you would any other bug.
2873 * Macros and Functions::Macros and functions that can be used with all trees.
2874 * Identifiers:: The names of things.
2875 * Containers:: Lists and vectors.
2878 File: gccint.info, Node: Macros and Functions, Next: Identifiers, Up: Tree overview
2883 This section is not here yet.
2886 File: gccint.info, Node: Identifiers, Next: Containers, Prev: Macros and Functions, Up: Tree overview
2891 An `IDENTIFIER_NODE' represents a slightly more general concept that
2892 the standard C or C++ concept of identifier. In particular, an
2893 `IDENTIFIER_NODE' may contain a `$', or other extraordinary characters.
2895 There are never two distinct `IDENTIFIER_NODE's representing the
2896 same identifier. Therefore, you may use pointer equality to compare
2897 `IDENTIFIER_NODE's, rather than using a routine like `strcmp'.
2899 You can use the following macros to access identifiers:
2900 `IDENTIFIER_POINTER'
2901 The string represented by the identifier, represented as a
2902 `char*'. This string is always `NUL'-terminated, and contains no
2903 embedded `NUL' characters.
2906 The length of the string returned by `IDENTIFIER_POINTER', not
2907 including the trailing `NUL'. This value of `IDENTIFIER_LENGTH
2908 (x)' is always the same as `strlen (IDENTIFIER_POINTER (x))'.
2910 `IDENTIFIER_OPNAME_P'
2911 This predicate holds if the identifier represents the name of an
2912 overloaded operator. In this case, you should not depend on the
2913 contents of either the `IDENTIFIER_POINTER' or the
2914 `IDENTIFIER_LENGTH'.
2916 `IDENTIFIER_TYPENAME_P'
2917 This predicate holds if the identifier represents the name of a
2918 user-defined conversion operator. In this case, the `TREE_TYPE' of
2919 the `IDENTIFIER_NODE' holds the type to which the conversion
2923 File: gccint.info, Node: Containers, Prev: Identifiers, Up: Tree overview
2928 Two common container data structures can be represented directly with
2929 tree nodes. A `TREE_LIST' is a singly linked list containing two trees
2930 per node. These are the `TREE_PURPOSE' and `TREE_VALUE' of each node.
2931 (Often, the `TREE_PURPOSE' contains some kind of tag, or additional
2932 information, while the `TREE_VALUE' contains the majority of the
2933 payload. In other cases, the `TREE_PURPOSE' is simply `NULL_TREE',
2934 while in still others both the `TREE_PURPOSE' and `TREE_VALUE' are of
2935 equal stature.) Given one `TREE_LIST' node, the next node is found by
2936 following the `TREE_CHAIN'. If the `TREE_CHAIN' is `NULL_TREE', then
2937 you have reached the end of the list.
2939 A `TREE_VEC' is a simple vector. The `TREE_VEC_LENGTH' is an
2940 integer (not a tree) giving the number of nodes in the vector. The
2941 nodes themselves are accessed using the `TREE_VEC_ELT' macro, which
2942 takes two arguments. The first is the `TREE_VEC' in question; the
2943 second is an integer indicating which element in the vector is desired.
2944 The elements are indexed from zero.
2947 File: gccint.info, Node: Types, Next: Scopes, Prev: Tree overview, Up: Trees
2952 All types have corresponding tree nodes. However, you should not
2953 assume that there is exactly one tree node corresponding to each type.
2954 There are often several nodes each of which correspond to the same type.
2956 For the most part, different kinds of types have different tree
2957 codes. (For example, pointer types use a `POINTER_TYPE' code while
2958 arrays use an `ARRAY_TYPE' code.) However, pointers to member functions
2959 use the `RECORD_TYPE' code. Therefore, when writing a `switch'
2960 statement that depends on the code associated with a particular type,
2961 you should take care to handle pointers to member functions under the
2962 `RECORD_TYPE' case label.
2964 In C++, an array type is not qualified; rather the type of the array
2965 elements is qualified. This situation is reflected in the intermediate
2966 representation. The macros described here will always examine the
2967 qualification of the underlying element type when applied to an array
2968 type. (If the element type is itself an array, then the recursion
2969 continues until a non-array type is found, and the qualification of this
2970 type is examined.) So, for example, `CP_TYPE_CONST_P' will hold of the
2971 type `const int ()[7]', denoting an array of seven `int's.
2973 The following functions and macros deal with cv-qualification of
2976 This macro returns the set of type qualifiers applied to this type.
2977 This value is `TYPE_UNQUALIFIED' if no qualifiers have been
2978 applied. The `TYPE_QUAL_CONST' bit is set if the type is
2979 `const'-qualified. The `TYPE_QUAL_VOLATILE' bit is set if the
2980 type is `volatile'-qualified. The `TYPE_QUAL_RESTRICT' bit is set
2981 if the type is `restrict'-qualified.
2984 This macro holds if the type is `const'-qualified.
2986 `CP_TYPE_VOLATILE_P'
2987 This macro holds if the type is `volatile'-qualified.
2989 `CP_TYPE_RESTRICT_P'
2990 This macro holds if the type is `restrict'-qualified.
2992 `CP_TYPE_CONST_NON_VOLATILE_P'
2993 This predicate holds for a type that is `const'-qualified, but
2994 _not_ `volatile'-qualified; other cv-qualifiers are ignored as
2995 well: only the `const'-ness is tested.
2998 This macro returns the unqualified version of a type. It may be
2999 applied to an unqualified type, but it is not always the identity
3000 function in that case.
3002 A few other macros and functions are usable with all types:
3004 The number of bits required to represent the type, represented as
3005 an `INTEGER_CST'. For an incomplete type, `TYPE_SIZE' will be
3009 The alignment of the type, in bits, represented as an `int'.
3012 This macro returns a declaration (in the form of a `TYPE_DECL') for
3013 the type. (Note this macro does _not_ return a `IDENTIFIER_NODE',
3014 as you might expect, given its name!) You can look at the
3015 `DECL_NAME' of the `TYPE_DECL' to obtain the actual name of the
3016 type. The `TYPE_NAME' will be `NULL_TREE' for a type that is not
3017 a built-in type, the result of a typedef, or a named class type.
3020 This predicate holds if the type is an integral type. Notice that
3021 in C++, enumerations are _not_ integral types.
3024 This predicate holds if the type is an integral type (in the C++
3025 sense) or a floating point type.
3028 This predicate holds for a class-type.
3031 This predicate holds for a built-in type.
3034 This predicate holds if the type is a pointer to data member.
3037 This predicate holds if the type is a pointer type, and the
3038 pointee is not a data member.
3041 This predicate holds for a pointer to function type.
3044 This predicate holds for a pointer to object type. Note however
3045 that it does not hold for the generic pointer to object type `void
3046 *'. You may use `TYPE_PTROBV_P' to test for a pointer to object
3047 type as well as `void *'.
3050 This predicate takes two types as input, and holds if they are the
3051 same type. For example, if one type is a `typedef' for the other,
3052 or both are `typedef's for the same type. This predicate also
3053 holds if the two trees given as input are simply copies of one
3054 another; i.e., there is no difference between them at the source
3055 level, but, for whatever reason, a duplicate has been made in the
3056 representation. You should never use `==' (pointer equality) to
3057 compare types; always use `same_type_p' instead.
3059 Detailed below are the various kinds of types, and the macros that
3060 can be used to access them. Although other kinds of types are used
3061 elsewhere in G++, the types described here are the only ones that you
3062 will encounter while examining the intermediate representation.
3065 Used to represent the `void' type.
3068 Used to represent the various integral types, including `char',
3069 `short', `int', `long', and `long long'. This code is not used
3070 for enumeration types, nor for the `bool' type. Note that GCC's
3071 `CHAR_TYPE' node is _not_ used to represent `char'. The
3072 `TYPE_PRECISION' is the number of bits used in the representation,
3073 represented as an `unsigned int'. (Note that in the general case
3074 this is not the same value as `TYPE_SIZE'; suppose that there were
3075 a 24-bit integer type, but that alignment requirements for the ABI
3076 required 32-bit alignment. Then, `TYPE_SIZE' would be an
3077 `INTEGER_CST' for 32, while `TYPE_PRECISION' would be 24.) The
3078 integer type is unsigned if `TREE_UNSIGNED' holds; otherwise, it
3081 The `TYPE_MIN_VALUE' is an `INTEGER_CST' for the smallest integer
3082 that may be represented by this type. Similarly, the
3083 `TYPE_MAX_VALUE' is an `INTEGER_CST' for the largest integer that
3084 may be represented by this type.
3087 Used to represent the `float', `double', and `long double' types.
3088 The number of bits in the floating-point representation is given
3089 by `TYPE_PRECISION', as in the `INTEGER_TYPE' case.
3092 Used to represent GCC built-in `__complex__' data types. The
3093 `TREE_TYPE' is the type of the real and imaginary parts.
3096 Used to represent an enumeration type. The `TYPE_PRECISION' gives
3097 (as an `int'), the number of bits used to represent the type. If
3098 there are no negative enumeration constants, `TREE_UNSIGNED' will
3099 hold. The minimum and maximum enumeration constants may be
3100 obtained with `TYPE_MIN_VALUE' and `TYPE_MAX_VALUE', respectively;
3101 each of these macros returns an `INTEGER_CST'.
3103 The actual enumeration constants themselves may be obtained by
3104 looking at the `TYPE_VALUES'. This macro will return a
3105 `TREE_LIST', containing the constants. The `TREE_PURPOSE' of each
3106 node will be an `IDENTIFIER_NODE' giving the name of the constant;
3107 the `TREE_VALUE' will be an `INTEGER_CST' giving the value
3108 assigned to that constant. These constants will appear in the
3109 order in which they were declared. The `TREE_TYPE' of each of
3110 these constants will be the type of enumeration type itself.
3113 Used to represent the `bool' type.
3116 Used to represent pointer types, and pointer to data member types.
3117 The `TREE_TYPE' gives the type to which this type points. If the
3118 type is a pointer to data member type, then `TYPE_PTRMEM_P' will
3119 hold. For a pointer to data member type of the form `T X::*',
3120 `TYPE_PTRMEM_CLASS_TYPE' will be the type `X', while
3121 `TYPE_PTRMEM_POINTED_TO_TYPE' will be the type `T'.
3124 Used to represent reference types. The `TREE_TYPE' gives the type
3125 to which this type refers.
3128 Used to represent the type of non-member functions and of static
3129 member functions. The `TREE_TYPE' gives the return type of the
3130 function. The `TYPE_ARG_TYPES' are a `TREE_LIST' of the argument
3131 types. The `TREE_VALUE' of each node in this list is the type of
3132 the corresponding argument; the `TREE_PURPOSE' is an expression
3133 for the default argument value, if any. If the last node in the
3134 list is `void_list_node' (a `TREE_LIST' node whose `TREE_VALUE' is
3135 the `void_type_node'), then functions of this type do not take
3136 variable arguments. Otherwise, they do take a variable number of
3139 Note that in C (but not in C++) a function declared like `void f()'
3140 is an unprototyped function taking a variable number of arguments;
3141 the `TYPE_ARG_TYPES' of such a function will be `NULL'.
3144 Used to represent the type of a non-static member function. Like a
3145 `FUNCTION_TYPE', the return type is given by the `TREE_TYPE'. The
3146 type of `*this', i.e., the class of which functions of this type
3147 are a member, is given by the `TYPE_METHOD_BASETYPE'. The
3148 `TYPE_ARG_TYPES' is the parameter list, as for a `FUNCTION_TYPE',
3149 and includes the `this' argument.
3152 Used to represent array types. The `TREE_TYPE' gives the type of
3153 the elements in the array. If the array-bound is present in the
3154 type, the `TYPE_DOMAIN' is an `INTEGER_TYPE' whose
3155 `TYPE_MIN_VALUE' and `TYPE_MAX_VALUE' will be the lower and upper
3156 bounds of the array, respectively. The `TYPE_MIN_VALUE' will
3157 always be an `INTEGER_CST' for zero, while the `TYPE_MAX_VALUE'
3158 will be one less than the number of elements in the array, i.e.,
3159 the highest value which may be used to index an element in the
3163 Used to represent `struct' and `class' types, as well as pointers
3164 to member functions and similar constructs in other languages.
3165 `TYPE_FIELDS' contains the items contained in this type, each of
3166 which can be a `FIELD_DECL', `VAR_DECL', `CONST_DECL', or
3167 `TYPE_DECL'. You may not make any assumptions about the ordering
3168 of the fields in the type or whether one or more of them overlap.
3169 If `TYPE_PTRMEMFUNC_P' holds, then this type is a pointer-to-member
3170 type. In that case, the `TYPE_PTRMEMFUNC_FN_TYPE' is a
3171 `POINTER_TYPE' pointing to a `METHOD_TYPE'. The `METHOD_TYPE' is
3172 the type of a function pointed to by the pointer-to-member
3173 function. If `TYPE_PTRMEMFUNC_P' does not hold, this type is a
3174 class type. For more information, see *note Classes::.
3177 Used to represent `union' types. Similar to `RECORD_TYPE' except
3178 that all `FIELD_DECL' nodes in `TYPE_FIELD' start at bit position
3182 Used to represent part of a variant record in Ada. Similar to
3183 `UNION_TYPE' except that each `FIELD_DECL' has a `DECL_QUALIFIER'
3184 field, which contains a boolean expression that indicates whether
3185 the field is present in the object. The type will only have one
3186 field, so each field's `DECL_QUALIFIER' is only evaluated if none
3187 of the expressions in the previous fields in `TYPE_FIELDS' are
3188 nonzero. Normally these expressions will reference a field in the
3189 outer object using a `PLACEHOLDER_EXPR'.
3192 This node is used to represent a type the knowledge of which is
3193 insufficient for a sound processing.
3196 This node is used to represent a pointer-to-data member. For a
3197 data member `X::m' the `TYPE_OFFSET_BASETYPE' is `X' and the
3198 `TREE_TYPE' is the type of `m'.
3201 Used to represent a construct of the form `typename T::A'. The
3202 `TYPE_CONTEXT' is `T'; the `TYPE_NAME' is an `IDENTIFIER_NODE' for
3203 `A'. If the type is specified via a template-id, then
3204 `TYPENAME_TYPE_FULLNAME' yields a `TEMPLATE_ID_EXPR'. The
3205 `TREE_TYPE' is non-`NULL' if the node is implicitly generated in
3206 support for the implicit typename extension; in which case the
3207 `TREE_TYPE' is a type node for the base-class.
3210 Used to represent the `__typeof__' extension. The `TYPE_FIELDS'
3211 is the expression the type of which is being represented.
3213 There are variables whose values represent some of the basic types.
3221 `unsigned_type_node.'
3222 A node for `unsigned int'.
3227 It may sometimes be useful to compare one of these variables with a type
3228 in hand, using `same_type_p'.
3231 File: gccint.info, Node: Scopes, Next: Functions, Prev: Types, Up: Trees
3236 The root of the entire intermediate representation is the variable
3237 `global_namespace'. This is the namespace specified with `::' in C++
3238 source code. All other namespaces, types, variables, functions, and so
3239 forth can be found starting with this namespace.
3241 Besides namespaces, the other high-level scoping construct in C++ is
3242 the class. (Throughout this manual the term "class" is used to mean the
3243 types referred to in the ANSI/ISO C++ Standard as classes; these include
3244 types defined with the `class', `struct', and `union' keywords.)
3248 * Namespaces:: Member functions, types, etc.
3249 * Classes:: Members, bases, friends, etc.
3252 File: gccint.info, Node: Namespaces, Next: Classes, Up: Scopes
3257 A namespace is represented by a `NAMESPACE_DECL' node.
3259 However, except for the fact that it is distinguished as the root of
3260 the representation, the global namespace is no different from any other
3261 namespace. Thus, in what follows, we describe namespaces generally,
3262 rather than the global namespace in particular.
3264 The following macros and functions can be used on a `NAMESPACE_DECL':
3267 This macro is used to obtain the `IDENTIFIER_NODE' corresponding to
3268 the unqualified name of the name of the namespace (*note
3269 Identifiers::). The name of the global namespace is `::', even
3270 though in C++ the global namespace is unnamed. However, you
3271 should use comparison with `global_namespace', rather than
3272 `DECL_NAME' to determine whether or not a namespace is the global
3273 one. An unnamed namespace will have a `DECL_NAME' equal to
3274 `anonymous_namespace_name'. Within a single translation unit, all
3275 unnamed namespaces will have the same name.
3278 This macro returns the enclosing namespace. The `DECL_CONTEXT' for
3279 the `global_namespace' is `NULL_TREE'.
3281 `DECL_NAMESPACE_ALIAS'
3282 If this declaration is for a namespace alias, then
3283 `DECL_NAMESPACE_ALIAS' is the namespace for which this one is an
3286 Do not attempt to use `cp_namespace_decls' for a namespace which is
3287 an alias. Instead, follow `DECL_NAMESPACE_ALIAS' links until you
3288 reach an ordinary, non-alias, namespace, and call
3289 `cp_namespace_decls' there.
3291 `DECL_NAMESPACE_STD_P'
3292 This predicate holds if the namespace is the special `::std'
3295 `cp_namespace_decls'
3296 This function will return the declarations contained in the
3297 namespace, including types, overloaded functions, other
3298 namespaces, and so forth. If there are no declarations, this
3299 function will return `NULL_TREE'. The declarations are connected
3300 through their `TREE_CHAIN' fields.
3302 Although most entries on this list will be declarations,
3303 `TREE_LIST' nodes may also appear. In this case, the `TREE_VALUE'
3304 will be an `OVERLOAD'. The value of the `TREE_PURPOSE' is
3305 unspecified; back ends should ignore this value. As with the
3306 other kinds of declarations returned by `cp_namespace_decls', the
3307 `TREE_CHAIN' will point to the next declaration in this list.
3309 For more information on the kinds of declarations that can occur
3310 on this list, *Note Declarations::. Some declarations will not
3311 appear on this list. In particular, no `FIELD_DECL',
3312 `LABEL_DECL', or `PARM_DECL' nodes will appear here.
3314 This function cannot be used with namespaces that have
3315 `DECL_NAMESPACE_ALIAS' set.
3318 File: gccint.info, Node: Classes, Prev: Namespaces, Up: Scopes
3323 A class type is represented by either a `RECORD_TYPE' or a
3324 `UNION_TYPE'. A class declared with the `union' tag is represented by
3325 a `UNION_TYPE', while classes declared with either the `struct' or the
3326 `class' tag are represented by `RECORD_TYPE's. You can use the
3327 `CLASSTYPE_DECLARED_CLASS' macro to discern whether or not a particular
3328 type is a `class' as opposed to a `struct'. This macro will be true
3329 only for classes declared with the `class' tag.
3331 Almost all non-function members are available on the `TYPE_FIELDS'
3332 list. Given one member, the next can be found by following the
3333 `TREE_CHAIN'. You should not depend in any way on the order in which
3334 fields appear on this list. All nodes on this list will be `DECL'
3335 nodes. A `FIELD_DECL' is used to represent a non-static data member, a
3336 `VAR_DECL' is used to represent a static data member, and a `TYPE_DECL'
3337 is used to represent a type. Note that the `CONST_DECL' for an
3338 enumeration constant will appear on this list, if the enumeration type
3339 was declared in the class. (Of course, the `TYPE_DECL' for the
3340 enumeration type will appear here as well.) There are no entries for
3341 base classes on this list. In particular, there is no `FIELD_DECL' for
3342 the "base-class portion" of an object.
3344 The `TYPE_VFIELD' is a compiler-generated field used to point to
3345 virtual function tables. It may or may not appear on the `TYPE_FIELDS'
3346 list. However, back ends should handle the `TYPE_VFIELD' just like all
3347 the entries on the `TYPE_FIELDS' list.
3349 The function members are available on the `TYPE_METHODS' list.
3350 Again, subsequent members are found by following the `TREE_CHAIN'
3351 field. If a function is overloaded, each of the overloaded functions
3352 appears; no `OVERLOAD' nodes appear on the `TYPE_METHODS' list.
3353 Implicitly declared functions (including default constructors, copy
3354 constructors, assignment operators, and destructors) will appear on
3357 Every class has an associated "binfo", which can be obtained with
3358 `TYPE_BINFO'. Binfos are used to represent base-classes. The binfo
3359 given by `TYPE_BINFO' is the degenerate case, whereby every class is
3360 considered to be its own base-class. The base classes for a particular
3361 binfo can be obtained with `BINFO_BASETYPES'. These base-classes are
3362 themselves binfos. The class type associated with a binfo is given by
3363 `BINFO_TYPE'. It is always the case that `BINFO_TYPE (TYPE_BINFO (x))'
3364 is the same type as `x', up to qualifiers. However, it is not always
3365 the case that `TYPE_BINFO (BINFO_TYPE (y))' is always the same binfo as
3366 `y'. The reason is that if `y' is a binfo representing a base-class
3367 `B' of a derived class `D', then `BINFO_TYPE (y)' will be `B', and
3368 `TYPE_BINFO (BINFO_TYPE (y))' will be `B' as its own base-class, rather
3369 than as a base-class of `D'.
3371 The `BINFO_BASETYPES' is a `TREE_VEC' (*note Containers::). Base
3372 types appear in left-to-right order in this vector. You can tell
3373 whether or `public', `protected', or `private' inheritance was used by
3374 using the `TREE_VIA_PUBLIC', `TREE_VIA_PROTECTED', and
3375 `TREE_VIA_PRIVATE' macros. Each of these macros takes a `BINFO' and is
3376 true if and only if the indicated kind of inheritance was used. If
3377 `TREE_VIA_VIRTUAL' holds of a binfo, then its `BINFO_TYPE' was
3378 inherited from virtually.
3380 The following macros can be used on a tree node representing a
3384 This predicate holds if the class is local class _i.e._ declared
3385 inside a function body.
3387 `TYPE_POLYMORPHIC_P'
3388 This predicate holds if the class has at least one virtual function
3389 (declared or inherited).
3391 `TYPE_HAS_DEFAULT_CONSTRUCTOR'
3392 This predicate holds whenever its argument represents a class-type
3393 with default constructor.
3395 `CLASSTYPE_HAS_MUTABLE'
3396 `TYPE_HAS_MUTABLE_P'
3397 These predicates hold for a class-type having a mutable data
3400 `CLASSTYPE_NON_POD_P'
3401 This predicate holds only for class-types that are not PODs.
3403 `TYPE_HAS_NEW_OPERATOR'
3404 This predicate holds for a class-type that defines `operator new'.
3406 `TYPE_HAS_ARRAY_NEW_OPERATOR'
3407 This predicate holds for a class-type for which `operator new[]'
3410 `TYPE_OVERLOADS_CALL_EXPR'
3411 This predicate holds for class-type for which the function call
3412 `operator()' is overloaded.
3414 `TYPE_OVERLOADS_ARRAY_REF'
3415 This predicate holds for a class-type that overloads `operator[]'
3417 `TYPE_OVERLOADS_ARROW'
3418 This predicate holds for a class-type for which `operator->' is
3422 File: gccint.info, Node: Declarations, Next: Attributes, Prev: Functions, Up: Trees
3427 This section covers the various kinds of declarations that appear in
3428 the internal representation, except for declarations of functions
3429 (represented by `FUNCTION_DECL' nodes), which are described in *Note
3432 Some macros can be used with any kind of declaration. These include:
3434 This macro returns an `IDENTIFIER_NODE' giving the name of the
3438 This macro returns the type of the entity declared.
3441 This macro returns the name of the file in which the entity was
3442 declared, as a `char*'. For an entity declared implicitly by the
3443 compiler (like `__builtin_memcpy'), this will be the string
3447 This macro returns the line number at which the entity was
3448 declared, as an `int'.
3451 This predicate holds if the declaration was implicitly generated
3452 by the compiler. For example, this predicate will hold of an
3453 implicitly declared member function, or of the `TYPE_DECL'
3454 implicitly generated for a class type. Recall that in C++ code
3458 is roughly equivalent to C code like:
3461 The implicitly generated `typedef' declaration is represented by a
3462 `TYPE_DECL' for which `DECL_ARTIFICIAL' holds.
3464 `DECL_NAMESPACE_SCOPE_P'
3465 This predicate holds if the entity was declared at a namespace
3468 `DECL_CLASS_SCOPE_P'
3469 This predicate holds if the entity was declared at a class scope.
3471 `DECL_FUNCTION_SCOPE_P'
3472 This predicate holds if the entity was declared inside a function
3475 The various kinds of declarations include:
3477 These nodes are used to represent labels in function bodies. For
3478 more information, see *Note Functions::. These nodes only appear
3482 These nodes are used to represent enumeration constants. The
3483 value of the constant is given by `DECL_INITIAL' which will be an
3484 `INTEGER_CST' with the same type as the `TREE_TYPE' of the
3485 `CONST_DECL', i.e., an `ENUMERAL_TYPE'.
3488 These nodes represent the value returned by a function. When a
3489 value is assigned to a `RESULT_DECL', that indicates that the
3490 value should be returned, via bitwise copy, by the function. You
3491 can use `DECL_SIZE' and `DECL_ALIGN' on a `RESULT_DECL', just as
3495 These nodes represent `typedef' declarations. The `TREE_TYPE' is
3496 the type declared to have the name given by `DECL_NAME'. In some
3497 cases, there is no associated name.
3500 These nodes represent variables with namespace or block scope, as
3501 well as static data members. The `DECL_SIZE' and `DECL_ALIGN' are
3502 analogous to `TYPE_SIZE' and `TYPE_ALIGN'. For a declaration, you
3503 should always use the `DECL_SIZE' and `DECL_ALIGN' rather than the
3504 `TYPE_SIZE' and `TYPE_ALIGN' given by the `TREE_TYPE', since
3505 special attributes may have been applied to the variable to give
3506 it a particular size and alignment. You may use the predicates
3507 `DECL_THIS_STATIC' or `DECL_THIS_EXTERN' to test whether the
3508 storage class specifiers `static' or `extern' were used to declare
3511 If this variable is initialized (but does not require a
3512 constructor), the `DECL_INITIAL' will be an expression for the
3513 initializer. The initializer should be evaluated, and a bitwise
3514 copy into the variable performed. If the `DECL_INITIAL' is the
3515 `error_mark_node', there is an initializer, but it is given by an
3516 explicit statement later in the code; no bitwise copy is required.
3518 GCC provides an extension that allows either automatic variables,
3519 or global variables, to be placed in particular registers. This
3520 extension is being used for a particular `VAR_DECL' if
3521 `DECL_REGISTER' holds for the `VAR_DECL', and if
3522 `DECL_ASSEMBLER_NAME' is not equal to `DECL_NAME'. In that case,
3523 `DECL_ASSEMBLER_NAME' is the name of the register into which the
3524 variable will be placed.
3527 Used to represent a parameter to a function. Treat these nodes
3528 similarly to `VAR_DECL' nodes. These nodes only appear in the
3529 `DECL_ARGUMENTS' for a `FUNCTION_DECL'.
3531 The `DECL_ARG_TYPE' for a `PARM_DECL' is the type that will
3532 actually be used when a value is passed to this function. It may
3533 be a wider type than the `TREE_TYPE' of the parameter; for
3534 example, the ordinary type might be `short' while the
3535 `DECL_ARG_TYPE' is `int'.
3538 These nodes represent non-static data members. The `DECL_SIZE' and
3539 `DECL_ALIGN' behave as for `VAR_DECL' nodes. The
3540 `DECL_FIELD_BITPOS' gives the first bit used for this field, as an
3541 `INTEGER_CST'. These values are indexed from zero, where zero
3542 indicates the first bit in the object.
3544 If `DECL_C_BIT_FIELD' holds, this field is a bit-field.
3550 These nodes are used to represent class, function, and variable
3551 (static data member) templates. The
3552 `DECL_TEMPLATE_SPECIALIZATIONS' are a `TREE_LIST'. The
3553 `TREE_VALUE' of each node in the list is a `TEMPLATE_DECL's or
3554 `FUNCTION_DECL's representing specializations (including
3555 instantiations) of this template. Back ends can safely ignore
3556 `TEMPLATE_DECL's, but should examine `FUNCTION_DECL' nodes on the
3557 specializations list just as they would ordinary `FUNCTION_DECL'
3560 For a class template, the `DECL_TEMPLATE_INSTANTIATIONS' list
3561 contains the instantiations. The `TREE_VALUE' of each node is an
3562 instantiation of the class. The `DECL_TEMPLATE_SPECIALIZATIONS'
3563 contains partial specializations of the class.
3566 Back ends can safely ignore these nodes.
3569 File: gccint.info, Node: Functions, Next: Declarations, Prev: Scopes, Up: Trees
3574 A function is represented by a `FUNCTION_DECL' node. A set of
3575 overloaded functions is sometimes represented by a `OVERLOAD' node.
3577 An `OVERLOAD' node is not a declaration, so none of the `DECL_'
3578 macros should be used on an `OVERLOAD'. An `OVERLOAD' node is similar
3579 to a `TREE_LIST'. Use `OVL_CURRENT' to get the function associated
3580 with an `OVERLOAD' node; use `OVL_NEXT' to get the next `OVERLOAD' node
3581 in the list of overloaded functions. The macros `OVL_CURRENT' and
3582 `OVL_NEXT' are actually polymorphic; you can use them to work with
3583 `FUNCTION_DECL' nodes as well as with overloads. In the case of a
3584 `FUNCTION_DECL', `OVL_CURRENT' will always return the function itself,
3585 and `OVL_NEXT' will always be `NULL_TREE'.
3587 To determine the scope of a function, you can use the `DECL_CONTEXT'
3588 macro. This macro will return the class (either a `RECORD_TYPE' or a
3589 `UNION_TYPE') or namespace (a `NAMESPACE_DECL') of which the function
3590 is a member. For a virtual function, this macro returns the class in
3591 which the function was actually defined, not the base class in which
3592 the virtual declaration occurred.
3594 If a friend function is defined in a class scope, the
3595 `DECL_FRIEND_CONTEXT' macro can be used to determine the class in which
3596 it was defined. For example, in
3597 class C { friend void f() {} };
3599 the `DECL_CONTEXT' for `f' will be the `global_namespace', but the
3600 `DECL_FRIEND_CONTEXT' will be the `RECORD_TYPE' for `C'.
3602 In C, the `DECL_CONTEXT' for a function maybe another function.
3603 This representation indicates that the GNU nested function extension is
3604 in use. For details on the semantics of nested functions, see the GCC
3605 Manual. The nested function can refer to local variables in its
3606 containing function. Such references are not explicitly marked in the
3607 tree structure; back ends must look at the `DECL_CONTEXT' for the
3608 referenced `VAR_DECL'. If the `DECL_CONTEXT' for the referenced
3609 `VAR_DECL' is not the same as the function currently being processed,
3610 and neither `DECL_EXTERNAL' nor `DECL_STATIC' hold, then the reference
3611 is to a local variable in a containing function, and the back end must
3612 take appropriate action.
3616 * Function Basics:: Function names, linkage, and so forth.
3617 * Function Bodies:: The statements that make up a function body.
3620 File: gccint.info, Node: Function Basics, Next: Function Bodies, Up: Functions
3625 The following macros and functions can be used on a `FUNCTION_DECL':
3627 This predicate holds for a function that is the program entry point
3631 This macro returns the unqualified name of the function, as an
3632 `IDENTIFIER_NODE'. For an instantiation of a function template,
3633 the `DECL_NAME' is the unqualified name of the template, not
3634 something like `f<int>'. The value of `DECL_NAME' is undefined
3635 when used on a constructor, destructor, overloaded operator, or
3636 type-conversion operator, or any function that is implicitly
3637 generated by the compiler. See below for macros that can be used
3638 to distinguish these cases.
3640 `DECL_ASSEMBLER_NAME'
3641 This macro returns the mangled name of the function, also an
3642 `IDENTIFIER_NODE'. This name does not contain leading underscores
3643 on systems that prefix all identifiers with underscores. The
3644 mangled name is computed in the same way on all platforms; if
3645 special processing is required to deal with the object file format
3646 used on a particular platform, it is the responsibility of the
3647 back end to perform those modifications. (Of course, the back end
3648 should not modify `DECL_ASSEMBLER_NAME' itself.)
3651 This predicate holds if the function is undefined.
3654 This predicate holds if the function has external linkage.
3656 `DECL_LOCAL_FUNCTION_P'
3657 This predicate holds if the function was declared at block scope,
3658 even though it has a global scope.
3661 This predicate holds if the function is a built-in function but its
3662 prototype is not yet explicitly declared.
3664 `DECL_EXTERN_C_FUNCTION_P'
3665 This predicate holds if the function is declared as an ``extern
3669 This macro holds if multiple copies of this function may be
3670 emitted in various translation units. It is the responsibility of
3671 the linker to merge the various copies. Template instantiations
3672 are the most common example of functions for which
3673 `DECL_LINKONCE_P' holds; G++ instantiates needed templates in all
3674 translation units which require them, and then relies on the
3675 linker to remove duplicate instantiations.
3677 FIXME: This macro is not yet implemented.
3679 `DECL_FUNCTION_MEMBER_P'
3680 This macro holds if the function is a member of a class, rather
3681 than a member of a namespace.
3683 `DECL_STATIC_FUNCTION_P'
3684 This predicate holds if the function a static member function.
3686 `DECL_NONSTATIC_MEMBER_FUNCTION_P'
3687 This macro holds for a non-static member function.
3689 `DECL_CONST_MEMFUNC_P'
3690 This predicate holds for a `const'-member function.
3692 `DECL_VOLATILE_MEMFUNC_P'
3693 This predicate holds for a `volatile'-member function.
3695 `DECL_CONSTRUCTOR_P'
3696 This macro holds if the function is a constructor.
3698 `DECL_NONCONVERTING_P'
3699 This predicate holds if the constructor is a non-converting
3702 `DECL_COMPLETE_CONSTRUCTOR_P'
3703 This predicate holds for a function which is a constructor for an
3704 object of a complete type.
3706 `DECL_BASE_CONSTRUCTOR_P'
3707 This predicate holds for a function which is a constructor for a
3708 base class sub-object.
3710 `DECL_COPY_CONSTRUCTOR_P'
3711 This predicate holds for a function which is a copy-constructor.
3714 This macro holds if the function is a destructor.
3716 `DECL_COMPLETE_DESTRUCTOR_P'
3717 This predicate holds if the function is the destructor for an
3718 object a complete type.
3720 `DECL_OVERLOADED_OPERATOR_P'
3721 This macro holds if the function is an overloaded operator.
3724 This macro holds if the function is a type-conversion operator.
3726 `DECL_GLOBAL_CTOR_P'
3727 This predicate holds if the function is a file-scope initialization
3730 `DECL_GLOBAL_DTOR_P'
3731 This predicate holds if the function is a file-scope finalization
3735 This predicate holds if the function is a thunk.
3737 These functions represent stub code that adjusts the `this' pointer
3738 and then jumps to another function. When the jumped-to function
3739 returns, control is transferred directly to the caller, without
3740 returning to the thunk. The first parameter to the thunk is
3741 always the `this' pointer; the thunk should add `THUNK_DELTA' to
3742 this value. (The `THUNK_DELTA' is an `int', not an `INTEGER_CST'.)
3744 Then, if `THUNK_VCALL_OFFSET' (an `INTEGER_CST') is nonzero the
3745 adjusted `this' pointer must be adjusted again. The complete
3746 calculation is given by the following pseudo-code:
3749 if (THUNK_VCALL_OFFSET)
3750 this += (*((ptrdiff_t **) this))[THUNK_VCALL_OFFSET]
3752 Finally, the thunk should jump to the location given by
3753 `DECL_INITIAL'; this will always be an expression for the address
3756 `DECL_NON_THUNK_FUNCTION_P'
3757 This predicate holds if the function is _not_ a thunk function.
3759 `GLOBAL_INIT_PRIORITY'
3760 If either `DECL_GLOBAL_CTOR_P' or `DECL_GLOBAL_DTOR_P' holds, then
3761 this gives the initialization priority for the function. The
3762 linker will arrange that all functions for which
3763 `DECL_GLOBAL_CTOR_P' holds are run in increasing order of priority
3764 before `main' is called. When the program exits, all functions for
3765 which `DECL_GLOBAL_DTOR_P' holds are run in the reverse order.
3768 This macro holds if the function was implicitly generated by the
3769 compiler, rather than explicitly declared. In addition to
3770 implicitly generated class member functions, this macro holds for
3771 the special functions created to implement static initialization
3772 and destruction, to compute run-time type information, and so
3776 This macro returns the `PARM_DECL' for the first argument to the
3777 function. Subsequent `PARM_DECL' nodes can be obtained by
3778 following the `TREE_CHAIN' links.
3781 This macro returns the `RESULT_DECL' for the function.
3784 This macro returns the `FUNCTION_TYPE' or `METHOD_TYPE' for the
3787 `TYPE_RAISES_EXCEPTIONS'
3788 This macro returns the list of exceptions that a (member-)function
3789 can raise. The returned list, if non `NULL', is comprised of nodes
3790 whose `TREE_VALUE' represents a type.
3793 This predicate holds when the exception-specification of its
3794 arguments if of the form ``()''.
3796 `DECL_ARRAY_DELETE_OPERATOR_P'
3797 This predicate holds if the function an overloaded `operator
3801 File: gccint.info, Node: Function Bodies, Prev: Function Basics, Up: Functions
3806 A function that has a definition in the current translation unit will
3807 have a non-`NULL' `DECL_INITIAL'. However, back ends should not make
3808 use of the particular value given by `DECL_INITIAL'.
3810 The `DECL_SAVED_TREE' macro will give the complete body of the
3811 function. This node will usually be a `COMPOUND_STMT' representing the
3812 outermost block of the function, but it may also be a `TRY_BLOCK', a
3813 `RETURN_INIT', or any other valid statement.
3818 There are tree nodes corresponding to all of the source-level
3819 statement constructs. These are enumerated here, together with a list
3820 of the various macros that can be used to obtain information about
3821 them. There are a few macros that can be used with all statements:
3824 This macro returns the line number for the statement. If the
3825 statement spans multiple lines, this value will be the number of
3826 the first line on which the statement occurs. Although we mention
3827 `CASE_LABEL' below as if it were a statement, they do not allow
3828 the use of `STMT_LINENO'. There is no way to obtain the line
3829 number for a `CASE_LABEL'.
3831 Statements do not contain information about the file from which
3832 they came; that information is implicit in the `FUNCTION_DECL'
3833 from which the statements originate.
3835 `STMT_IS_FULL_EXPR_P'
3836 In C++, statements normally constitute "full expressions";
3837 temporaries created during a statement are destroyed when the
3838 statement is complete. However, G++ sometimes represents
3839 expressions by statements; these statements will not have
3840 `STMT_IS_FULL_EXPR_P' set. Temporaries created during such
3841 statements should be destroyed when the innermost enclosing
3842 statement with `STMT_IS_FULL_EXPR_P' set is exited.
3844 Here is the list of the various statement nodes, and the macros used
3845 to access them. This documentation describes the use of these nodes in
3846 non-template functions (including instantiations of template functions).
3847 In template functions, the same nodes are used, but sometimes in
3848 slightly different ways.
3850 Many of the statements have substatements. For example, a `while'
3851 loop will have a body, which is itself a statement. If the substatement
3852 is `NULL_TREE', it is considered equivalent to a statement consisting
3853 of a single `;', i.e., an expression statement in which the expression
3854 has been omitted. A substatement may in fact be a list of statements,
3855 connected via their `TREE_CHAIN's. So, you should always process the
3856 statement tree by looping over substatements, like this:
3857 void process_stmt (stmt)
3862 switch (TREE_CODE (stmt))
3865 process_stmt (THEN_CLAUSE (stmt));
3866 /* More processing here. */
3872 stmt = TREE_CHAIN (stmt);
3875 In other words, while the `then' clause of an `if' statement in C++
3876 can be only one statement (although that one statement may be a
3877 compound statement), the intermediate representation will sometimes use
3878 several statements chained together.
3881 Used to represent an inline assembly statement. For an inline
3882 assembly statement like:
3884 The `ASM_STRING' macro will return a `STRING_CST' node for `"mov
3885 x, y"'. If the original statement made use of the
3886 extended-assembly syntax, then `ASM_OUTPUTS', `ASM_INPUTS', and
3887 `ASM_CLOBBERS' will be the outputs, inputs, and clobbers for the
3888 statement, represented as `STRING_CST' nodes. The
3889 extended-assembly syntax looks like:
3890 asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));
3891 The first string is the `ASM_STRING', containing the instruction
3892 template. The next two strings are the output and inputs,
3893 respectively; this statement has no clobbers. As this example
3894 indicates, "plain" assembly statements are merely a special case
3895 of extended assembly statements; they have no cv-qualifiers,
3896 outputs, inputs, or clobbers. All of the strings will be
3897 `NUL'-terminated, and will contain no embedded `NUL'-characters.
3899 If the assembly statement is declared `volatile', or if the
3900 statement was not an extended assembly statement, and is therefore
3901 implicitly volatile, then the predicate `ASM_VOLATILE_P' will hold
3905 Used to represent a `break' statement. There are no additional
3909 Use to represent a `case' label, range of `case' labels, or a
3910 `default' label. If `CASE_LOW' is `NULL_TREE', then this is a
3911 `default' label. Otherwise, if `CASE_HIGH' is `NULL_TREE', then
3912 this is an ordinary `case' label. In this case, `CASE_LOW' is an
3913 expression giving the value of the label. Both `CASE_LOW' and
3914 `CASE_HIGH' are `INTEGER_CST' nodes. These values will have the
3915 same type as the condition expression in the switch statement.
3917 Otherwise, if both `CASE_LOW' and `CASE_HIGH' are defined, the
3918 statement is a range of case labels. Such statements originate
3919 with the extension that allows users to write things of the form:
3921 The first value will be `CASE_LOW', while the second will be
3925 Used to represent an action that should take place upon exit from
3926 the enclosing scope. Typically, these actions are calls to
3927 destructors for local objects, but back ends cannot rely on this
3928 fact. If these nodes are in fact representing such destructors,
3929 `CLEANUP_DECL' will be the `VAR_DECL' destroyed. Otherwise,
3930 `CLEANUP_DECL' will be `NULL_TREE'. In any case, the
3931 `CLEANUP_EXPR' is the expression to execute. The cleanups
3932 executed on exit from a scope should be run in the reverse order
3933 of the order in which the associated `CLEANUP_STMT's were
3937 Used to represent a brace-enclosed block. The first substatement
3938 is given by `COMPOUND_BODY'. Subsequent substatements are found by
3939 following the `TREE_CHAIN' link from one substatement to the next.
3940 The `COMPOUND_BODY' will be `NULL_TREE' if there are no
3944 Used to represent a `continue' statement. There are no additional
3948 Used to mark the beginning (if `CTOR_BEGIN_P' holds) or end (if
3949 `CTOR_END_P' holds of the main body of a constructor. See also
3950 `SUBOBJECT' for more information on how to use these nodes.
3953 Used to represent a local declaration. The `DECL_STMT_DECL' macro
3954 can be used to obtain the entity declared. This declaration may
3955 be a `LABEL_DECL', indicating that the label declared is a local
3956 label. (As an extension, GCC allows the declaration of labels
3957 with scope.) In C, this declaration may be a `FUNCTION_DECL',
3958 indicating the use of the GCC nested function extension. For more
3959 information, *note Functions::.
3962 Used to represent a `do' loop. The body of the loop is given by
3963 `DO_BODY' while the termination condition for the loop is given by
3964 `DO_COND'. The condition for a `do'-statement is always an
3968 Used to represent a temporary object of a class with no data whose
3969 address is never taken. (All such objects are interchangeable.)
3970 The `TREE_TYPE' represents the type of the object.
3973 Used to represent an expression statement. Use `EXPR_STMT_EXPR' to
3974 obtain the expression.
3977 Used to record a change in filename within the body of a function.
3978 Use `FILE_STMT_FILENAME' to obtain the new filename.
3981 Used to represent a `for' statement. The `FOR_INIT_STMT' is the
3982 initialization statement for the loop. The `FOR_COND' is the
3983 termination condition. The `FOR_EXPR' is the expression executed
3984 right before the `FOR_COND' on each loop iteration; often, this
3985 expression increments a counter. The body of the loop is given by
3986 `FOR_BODY'. Note that `FOR_INIT_STMT' and `FOR_BODY' return
3987 statements, while `FOR_COND' and `FOR_EXPR' return expressions.
3990 Used to represent a `goto' statement. The `GOTO_DESTINATION' will
3991 usually be a `LABEL_DECL'. However, if the "computed goto"
3992 extension has been used, the `GOTO_DESTINATION' will be an
3993 arbitrary expression indicating the destination. This expression
3994 will always have pointer type. Additionally the `GOTO_FAKE_P'
3995 flag is set whenever the goto statement does not come from source
3996 code, but it is generated implicitly by the compiler. This is
3997 used for branch prediction.
4000 Used to represent a C++ `catch' block. The `HANDLER_TYPE' is the
4001 type of exception that will be caught by this handler; it is equal
4002 (by pointer equality) to `NULL' if this handler is for all types.
4003 `HANDLER_PARMS' is the `DECL_STMT' for the catch parameter, and
4004 `HANDLER_BODY' is the `COMPOUND_STMT' for the block itself.
4007 Used to represent an `if' statement. The `IF_COND' is the
4010 If the condition is a `TREE_LIST', then the `TREE_PURPOSE' is a
4011 statement (usually a `DECL_STMT'). Each time the condition is
4012 evaluated, the statement should be executed. Then, the
4013 `TREE_VALUE' should be used as the conditional expression itself.
4014 This representation is used to handle C++ code like this:
4018 where there is a new local variable (or variables) declared within
4021 The `THEN_CLAUSE' represents the statement given by the `then'
4022 condition, while the `ELSE_CLAUSE' represents the statement given
4023 by the `else' condition.
4026 Used to represent a label. The `LABEL_DECL' declared by this
4027 statement can be obtained with the `LABEL_STMT_LABEL' macro. The
4028 `IDENTIFIER_NODE' giving the name of the label can be obtained from
4029 the `LABEL_DECL' with `DECL_NAME'.
4032 If the function uses the G++ "named return value" extension,
4033 meaning that the function has been defined like:
4034 S f(int) return s {...}
4035 then there will be a `RETURN_INIT'. There is never a named
4036 returned value for a constructor. The first argument to the
4037 `RETURN_INIT' is the name of the object returned; the second
4038 argument is the initializer for the object. The object is
4039 initialized when the `RETURN_INIT' is encountered. The object
4040 referred to is the actual object returned; this extension is a
4041 manual way of doing the "return-value optimization." Therefore,
4042 the object must actually be constructed in the place where the
4043 object will be returned.
4046 Used to represent a `return' statement. The `RETURN_EXPR' is the
4047 expression returned; it will be `NULL_TREE' if the statement was
4052 A scope-statement represents the beginning or end of a scope. If
4053 `SCOPE_BEGIN_P' holds, this statement represents the beginning of a
4054 scope; if `SCOPE_END_P' holds this statement represents the end of
4055 a scope. On exit from a scope, all cleanups from `CLEANUP_STMT's
4056 occurring in the scope must be run, in reverse order to the order
4057 in which they were encountered. If `SCOPE_NULLIFIED_P' or
4058 `SCOPE_NO_CLEANUPS_P' holds of the scope, back ends should behave
4059 as if the `SCOPE_STMT' were not present at all.
4062 In a constructor, these nodes are used to mark the point at which a
4063 subobject of `this' is fully constructed. If, after this point, an
4064 exception is thrown before a `CTOR_STMT' with `CTOR_END_P' set is
4065 encountered, the `SUBOBJECT_CLEANUP' must be executed. The
4066 cleanups must be executed in the reverse order in which they
4070 Used to represent a `switch' statement. The `SWITCH_COND' is the
4071 expression on which the switch is occurring. See the documentation
4072 for an `IF_STMT' for more information on the representation used
4073 for the condition. The `SWITCH_BODY' is the body of the switch
4074 statement. The `SWITCH_TYPE' is the original type of switch
4075 expression as given in the source, before any compiler conversions.
4078 Used to represent a `try' block. The body of the try block is
4079 given by `TRY_STMTS'. Each of the catch blocks is a `HANDLER'
4080 node. The first handler is given by `TRY_HANDLERS'. Subsequent
4081 handlers are obtained by following the `TREE_CHAIN' link from one
4082 handler to the next. The body of the handler is given by
4085 If `CLEANUP_P' holds of the `TRY_BLOCK', then the `TRY_HANDLERS'
4086 will not be a `HANDLER' node. Instead, it will be an expression
4087 that should be executed if an exception is thrown in the try
4088 block. It must rethrow the exception after executing that code.
4089 And, if an exception is thrown while the expression is executing,
4090 `terminate' must be called.
4093 Used to represent a `using' directive. The namespace is given by
4094 `USING_STMT_NAMESPACE', which will be a NAMESPACE_DECL. This node
4095 is needed inside template functions, to implement using directives
4096 during instantiation.
4099 Used to represent a `while' loop. The `WHILE_COND' is the
4100 termination condition for the loop. See the documentation for an
4101 `IF_STMT' for more information on the representation used for the
4104 The `WHILE_BODY' is the body of the loop.
4107 File: gccint.info, Node: Attributes, Next: Expression trees, Prev: Declarations, Up: Trees
4112 Attributes, as specified using the `__attribute__' keyword, are
4113 represented internally as a `TREE_LIST'. The `TREE_PURPOSE' is the
4114 name of the attribute, as an `IDENTIFIER_NODE'. The `TREE_VALUE' is a
4115 `TREE_LIST' of the arguments of the attribute, if any, or `NULL_TREE'
4116 if there are no arguments; the arguments are stored as the `TREE_VALUE'
4117 of successive entries in the list, and may be identifiers or
4118 expressions. The `TREE_CHAIN' of the attribute is the next attribute
4119 in a list of attributes applying to the same declaration or type, or
4120 `NULL_TREE' if there are no further attributes in the list.
4122 Attributes may be attached to declarations and to types; these
4123 attributes may be accessed with the following macros. All attributes
4124 are stored in this way, and many also cause other changes to the
4125 declaration or type or to other internal compiler data structures.
4127 - Tree Macro: tree DECL_ATTRIBUTES (tree DECL)
4128 This macro returns the attributes on the declaration DECL.
4130 - Tree Macro: tree TYPE_ATTRIBUTES (tree TYPE)
4131 This macro returns the attributes on the type TYPE.
4134 File: gccint.info, Node: Expression trees, Prev: Attributes, Up: Trees
4139 The internal representation for expressions is for the most part
4140 quite straightforward. However, there are a few facts that one must
4141 bear in mind. In particular, the expression "tree" is actually a
4142 directed acyclic graph. (For example there may be many references to
4143 the integer constant zero throughout the source program; many of these
4144 will be represented by the same expression node.) You should not rely
4145 on certain kinds of node being shared, nor should rely on certain kinds
4146 of nodes being unshared.
4148 The following macros can be used with all expression nodes:
4151 Returns the type of the expression. This value may not be
4152 precisely the same type that would be given the expression in the
4155 In what follows, some nodes that one might expect to always have type
4156 `bool' are documented to have either integral or boolean type. At some
4157 point in the future, the C front end may also make use of this same
4158 intermediate representation, and at this point these nodes will
4159 certainly have integral type. The previous sentence is not meant to
4160 imply that the C++ front end does not or will not give these nodes
4163 Below, we list the various kinds of expression nodes. Except where
4164 noted otherwise, the operands to an expression are accessed using the
4165 `TREE_OPERAND' macro. For example, to access the first operand to a
4166 binary plus expression `expr', use:
4168 TREE_OPERAND (expr, 0)
4170 As this example indicates, the operands are zero-indexed.
4172 The table below begins with constants, moves on to unary expressions,
4173 then proceeds to binary expressions, and concludes with various other
4174 kinds of expressions:
4177 These nodes represent integer constants. Note that the type of
4178 these constants is obtained with `TREE_TYPE'; they are not always
4179 of type `int'. In particular, `char' constants are represented
4180 with `INTEGER_CST' nodes. The value of the integer constant `e' is
4182 ((TREE_INT_CST_HIGH (e) << HOST_BITS_PER_WIDE_INT)
4183 + TREE_INST_CST_LOW (e))
4185 HOST_BITS_PER_WIDE_INT is at least thirty-two on all platforms.
4186 Both `TREE_INT_CST_HIGH' and `TREE_INT_CST_LOW' return a
4187 `HOST_WIDE_INT'. The value of an `INTEGER_CST' is interpreted as
4188 a signed or unsigned quantity depending on the type of the
4189 constant. In general, the expression given above will overflow,
4190 so it should not be used to calculate the value of the constant.
4192 The variable `integer_zero_node' is an integer constant with value
4193 zero. Similarly, `integer_one_node' is an integer constant with
4194 value one. The `size_zero_node' and `size_one_node' variables are
4195 analogous, but have type `size_t' rather than `int'.
4197 The function `tree_int_cst_lt' is a predicate which holds if its
4198 first argument is less than its second. Both constants are
4199 assumed to have the same signedness (i.e., either both should be
4200 signed or both should be unsigned.) The full width of the
4201 constant is used when doing the comparison; the usual rules about
4202 promotions and conversions are ignored. Similarly,
4203 `tree_int_cst_equal' holds if the two constants are equal. The
4204 `tree_int_cst_sgn' function returns the sign of a constant. The
4205 value is `1', `0', or `-1' according on whether the constant is
4206 greater than, equal to, or less than zero. Again, the signedness
4207 of the constant's type is taken into account; an unsigned constant
4208 is never less than zero, no matter what its bit-pattern.
4211 FIXME: Talk about how to obtain representations of this constant,
4212 do comparisons, and so forth.
4215 These nodes are used to represent complex number constants, that
4216 is a `__complex__' whose parts are constant nodes. The
4217 `TREE_REALPART' and `TREE_IMAGPART' return the real and the
4218 imaginary parts respectively.
4221 These nodes are used to represent vector constants, whose parts are
4222 constant nodes. Each individual constant node is either an
4223 integer or a double constant node. The first operand is a
4224 `TREE_LIST' of the constant nodes and is accessed through
4225 `TREE_VECTOR_CST_ELTS'.
4228 These nodes represent string-constants. The `TREE_STRING_LENGTH'
4229 returns the length of the string, as an `int'. The
4230 `TREE_STRING_POINTER' is a `char*' containing the string itself.
4231 The string may not be `NUL'-terminated, and it may contain
4232 embedded `NUL' characters. Therefore, the `TREE_STRING_LENGTH'
4233 includes the trailing `NUL' if it is present.
4235 For wide string constants, the `TREE_STRING_LENGTH' is the number
4236 of bytes in the string, and the `TREE_STRING_POINTER' points to an
4237 array of the bytes of the string, as represented on the target
4238 system (that is, as integers in the target endianness). Wide and
4239 non-wide string constants are distinguished only by the `TREE_TYPE'
4240 of the `STRING_CST'.
4242 FIXME: The formats of string constants are not well-defined when
4243 the target system bytes are not the same width as host system
4247 These nodes are used to represent pointer-to-member constants. The
4248 `PTRMEM_CST_CLASS' is the class type (either a `RECORD_TYPE' or
4249 `UNION_TYPE' within which the pointer points), and the
4250 `PTRMEM_CST_MEMBER' is the declaration for the pointed to object.
4251 Note that the `DECL_CONTEXT' for the `PTRMEM_CST_MEMBER' is in
4252 general different from the `PTRMEM_CST_CLASS'. For example, given:
4253 struct B { int i; };
4254 struct D : public B {};
4257 The `PTRMEM_CST_CLASS' for `&D::i' is `D', even though the
4258 `DECL_CONTEXT' for the `PTRMEM_CST_MEMBER' is `B', since `B::i' is
4259 a member of `B', not `D'.
4262 These nodes represent variables, including static data members.
4263 For more information, *note Declarations::.
4266 These nodes represent unary negation of the single operand, for
4267 both integer and floating-point types. The type of negation can be
4268 determined by looking at the type of the expression.
4270 The behavior of this operation on signed arithmetic overflow is
4271 controlled by the `flag_wrapv' and `flag_trapv' variables.
4274 These nodes represent the absolute value of the single operand, for
4275 both integer and floating-point types. This is typically used to
4276 implement the `abs', `labs' and `llabs' builtins for integer
4277 types, and the `fabs', `fabsf' and `fabsl' builtins for floating
4278 point types. The type of abs operation can be determined by
4279 looking at the type of the expression.
4281 This node is not used for complex types. To represent the modulus
4282 or complex abs of a complex value, use the `BUILT_IN_CABS',
4283 `BUILT_IN_CABSF' or `BUILT_IN_CABSL' builtins, as used to
4284 implement the C99 `cabs', `cabsf' and `cabsl' built-in functions.
4287 These nodes represent bitwise complement, and will always have
4288 integral type. The only operand is the value to be complemented.
4291 These nodes represent logical negation, and will always have
4292 integral (or boolean) type. The operand is the value being
4297 `POSTDECREMENT_EXPR'
4298 `POSTINCREMENT_EXPR'
4299 These nodes represent increment and decrement expressions. The
4300 value of the single operand is computed, and the operand
4301 incremented or decremented. In the case of `PREDECREMENT_EXPR' and
4302 `PREINCREMENT_EXPR', the value of the expression is the value
4303 resulting after the increment or decrement; in the case of
4304 `POSTDECREMENT_EXPR' and `POSTINCREMENT_EXPR' is the value before
4305 the increment or decrement occurs. The type of the operand, like
4306 that of the result, will be either integral, boolean, or
4310 These nodes are used to represent the address of an object. (These
4311 expressions will always have pointer or reference type.) The
4312 operand may be another expression, or it may be a declaration.
4314 As an extension, GCC allows users to take the address of a label.
4315 In this case, the operand of the `ADDR_EXPR' will be a
4316 `LABEL_DECL'. The type of such an expression is `void*'.
4318 If the object addressed is not an lvalue, a temporary is created,
4319 and the address of the temporary is used.
4322 These nodes are used to represent the object pointed to by a
4323 pointer. The operand is the pointer being dereferenced; it will
4324 always have pointer or reference type.
4327 These nodes represent conversion of a floating-point value to an
4328 integer. The single operand will have a floating-point type,
4329 while the the complete expression will have an integral (or
4330 boolean) type. The operand is rounded towards zero.
4333 These nodes represent conversion of an integral (or boolean) value
4334 to a floating-point value. The single operand will have integral
4335 type, while the complete expression will have a floating-point
4338 FIXME: How is the operand supposed to be rounded? Is this
4339 dependent on `-mieee'?
4342 These nodes are used to represent complex numbers constructed from
4343 two expressions of the same (integer or real) type. The first
4344 operand is the real part and the second operand is the imaginary
4348 These nodes represent the conjugate of their operand.
4352 These nodes represent respectively the real and the imaginary parts
4353 of complex numbers (their sole argument).
4356 These nodes indicate that their one and only operand is not an
4357 lvalue. A back end can treat these identically to the single
4361 These nodes are used to represent conversions that do not require
4362 any code-generation. For example, conversion of a `char*' to an
4363 `int*' does not require any code be generated; such a conversion is
4364 represented by a `NOP_EXPR'. The single operand is the expression
4365 to be converted. The conversion from a pointer to a reference is
4366 also represented with a `NOP_EXPR'.
4369 These nodes are similar to `NOP_EXPR's, but are used in those
4370 situations where code may need to be generated. For example, if an
4371 `int*' is converted to an `int' code may need to be generated on
4372 some platforms. These nodes are never used for C++-specific
4373 conversions, like conversions between pointers to different
4374 classes in an inheritance hierarchy. Any adjustments that need to
4375 be made in such cases are always indicated explicitly. Similarly,
4376 a user-defined conversion is never represented by a
4377 `CONVERT_EXPR'; instead, the function calls are made explicit.
4380 These nodes represent `throw' expressions. The single operand is
4381 an expression for the code that should be executed to throw the
4382 exception. However, there is one implicit action not represented
4383 in that expression; namely the call to `__throw'. This function
4384 takes no arguments. If `setjmp'/`longjmp' exceptions are used, the
4385 function `__sjthrow' is called instead. The normal GCC back end
4386 uses the function `emit_throw' to generate this code; you can
4387 examine this function to see what needs to be done.
4391 These nodes represent left and right shifts, respectively. The
4392 first operand is the value to shift; it will always be of integral
4393 type. The second operand is an expression for the number of bits
4394 by which to shift. Right shift should be treated as arithmetic,
4395 i.e., the high-order bits should be zero-filled when the
4396 expression has unsigned type and filled with the sign bit when the
4397 expression has signed type. Note that the result is undefined if
4398 the second operand is larger than the first operand's type size.
4403 These nodes represent bitwise inclusive or, bitwise exclusive or,
4404 and bitwise and, respectively. Both operands will always have
4409 These nodes represent logical and and logical or, respectively.
4410 These operators are not strict; i.e., the second operand is
4411 evaluated only if the value of the expression is not determined by
4412 evaluation of the first operand. The type of the operands, and
4413 the result type, is always of boolean or integral type.
4418 These nodes represent logical and, logical or, and logical
4419 exclusive or. They are strict; both arguments are always
4420 evaluated. There are no corresponding operators in C or C++, but
4421 the front end will sometimes generate these expressions anyhow, if
4422 it can tell that strictness does not matter.
4430 These nodes represent various binary arithmetic operations.
4431 Respectively, these operations are addition, subtraction (of the
4432 second operand from the first), multiplication, integer division,
4433 integer remainder, and floating-point division. The operands to
4434 the first three of these may have either integral or floating
4435 type, but there will never be case in which one operand is of
4436 floating type and the other is of integral type.
4438 The result of a `TRUNC_DIV_EXPR' is always rounded towards zero.
4439 The `TRUNC_MOD_EXPR' of two operands `a' and `b' is always `a -
4440 (a/b)*b' where the division is as if computed by a
4443 The behavior of these operations on signed arithmetic overflow is
4444 controlled by the `flag_wrapv' and `flag_trapv' variables.
4447 These nodes represent array accesses. The first operand is the
4448 array; the second is the index. To calculate the address of the
4449 memory accessed, you must scale the index by the size of the type
4450 of the array elements. The type of these expressions must be the
4451 type of a component of the array.
4454 These nodes represent access to a range (or "slice") of an array.
4455 The operands are the same as that for `ARRAY_REF' and have the same
4456 meanings. The type of these expressions must be an array whose
4457 component type is the same as that of the first operand. The
4458 range of that array type determines the amount of data these
4470 These nodes represent the less than, less than or equal to, greater
4471 than, greater than or equal to, equal, and not equal comparison
4472 operators. The first and second operand with either be both of
4473 integral type or both of floating type. The result type of these
4474 expressions will always be of integral or boolean type.
4477 These nodes represent assignment. The left-hand side is the first
4478 operand; the right-hand side is the second operand. The left-hand
4479 side will be a `VAR_DECL', `INDIRECT_REF', `COMPONENT_REF', or
4482 These nodes are used to represent not only assignment with `=' but
4483 also compound assignments (like `+='), by reduction to `='
4484 assignment. In other words, the representation for `i += 3' looks
4485 just like that for `i = i + 3'.
4488 These nodes are just like `MODIFY_EXPR', but are used only when a
4489 variable is initialized, rather than assigned to subsequently.
4492 These nodes represent non-static data member accesses. The first
4493 operand is the object (rather than a pointer to it); the second
4494 operand is the `FIELD_DECL' for the data member.
4497 These nodes represent comma-expressions. The first operand is an
4498 expression whose value is computed and thrown away prior to the
4499 evaluation of the second operand. The value of the entire
4500 expression is the value of the second operand.
4503 These nodes represent `?:' expressions. The first operand is of
4504 boolean or integral type. If it evaluates to a nonzero value, the
4505 second operand should be evaluated, and returned as the value of
4506 the expression. Otherwise, the third operand is evaluated, and
4507 returned as the value of the expression.
4509 The second operand must have the same type as the entire
4510 expression, unless it unconditionally throws an exception or calls
4511 a noreturn function, in which case it should have void type. The
4512 same constraints apply to the third operand. This allows array
4513 bounds checks to be represented conveniently as `(i >= 0 && i <
4516 As a GNU extension, the C language front-ends allow the second
4517 operand of the `?:' operator may be omitted in the source. For
4518 example, `x ? : 3' is equivalent to `x ? x : 3', assuming that `x'
4519 is an expression without side-effects. In the tree
4520 representation, however, the second operand is always present,
4521 possibly protected by `SAVE_EXPR' if the first argument does cause
4525 These nodes are used to represent calls to functions, including
4526 non-static member functions. The first operand is a pointer to the
4527 function to call; it is always an expression whose type is a
4528 `POINTER_TYPE'. The second argument is a `TREE_LIST'. The
4529 arguments to the call appear left-to-right in the list. The
4530 `TREE_VALUE' of each list node contains the expression
4531 corresponding to that argument. (The value of `TREE_PURPOSE' for
4532 these nodes is unspecified, and should be ignored.) For non-static
4533 member functions, there will be an operand corresponding to the
4534 `this' pointer. There will always be expressions corresponding to
4535 all of the arguments, even if the function is declared with default
4536 arguments and some arguments are not explicitly provided at the
4540 These nodes are used to represent GCC's statement-expression
4541 extension. The statement-expression extension allows code like
4543 int f() { return ({ int j; j = 3; j + 7; }); }
4544 In other words, an sequence of statements may occur where a single
4545 expression would normally appear. The `STMT_EXPR' node represents
4546 such an expression. The `STMT_EXPR_STMT' gives the statement
4547 contained in the expression; this is always a `COMPOUND_STMT'. The
4548 value of the expression is the value of the last sub-statement in
4549 the `COMPOUND_STMT'. More precisely, the value is the value
4550 computed by the last `EXPR_STMT' in the outermost scope of the
4551 `COMPOUND_STMT'. For example, in:
4553 the value is `3' while in:
4555 (represented by a nested `COMPOUND_STMT'), there is no value. If
4556 the `STMT_EXPR' does not yield a value, it's type will be `void'.
4559 These nodes represent local blocks. The first operand is a list of
4560 temporary variables, connected via their `TREE_CHAIN' field. These
4561 will never require cleanups. The scope of these variables is just
4562 the body of the `BIND_EXPR'. The body of the `BIND_EXPR' is the
4566 These nodes represent "infinite" loops. The `LOOP_EXPR_BODY'
4567 represents the body of the loop. It should be executed forever,
4568 unless an `EXIT_EXPR' is encountered.
4571 These nodes represent conditional exits from the nearest enclosing
4572 `LOOP_EXPR'. The single operand is the condition; if it is
4573 nonzero, then the loop should be exited. An `EXIT_EXPR' will only
4574 appear within a `LOOP_EXPR'.
4576 `CLEANUP_POINT_EXPR'
4577 These nodes represent full-expressions. The single operand is an
4578 expression to evaluate. Any destructor calls engendered by the
4579 creation of temporaries during the evaluation of that expression
4580 should be performed immediately after the expression is evaluated.
4583 These nodes represent the brace-enclosed initializers for a
4584 structure or array. The first operand is reserved for use by the
4585 back end. The second operand is a `TREE_LIST'. If the
4586 `TREE_TYPE' of the `CONSTRUCTOR' is a `RECORD_TYPE' or
4587 `UNION_TYPE', then the `TREE_PURPOSE' of each node in the
4588 `TREE_LIST' will be a `FIELD_DECL' and the `TREE_VALUE' of each
4589 node will be the expression used to initialize that field.
4591 If the `TREE_TYPE' of the `CONSTRUCTOR' is an `ARRAY_TYPE', then
4592 the `TREE_PURPOSE' of each element in the `TREE_LIST' will be an
4593 `INTEGER_CST'. This constant indicates which element of the array
4594 (indexed from zero) is being assigned to; again, the `TREE_VALUE'
4595 is the corresponding initializer. If the `TREE_PURPOSE' is
4596 `NULL_TREE', then the initializer is for the next available array
4599 In the front end, you should not depend on the fields appearing in
4600 any particular order. However, in the middle end, fields must
4601 appear in declaration order. You should not assume that all
4602 fields will be represented. Unrepresented fields will be set to
4605 `COMPOUND_LITERAL_EXPR'
4606 These nodes represent ISO C99 compound literals. The
4607 `COMPOUND_LITERAL_EXPR_DECL_STMT' is a `DECL_STMT' containing an
4608 anonymous `VAR_DECL' for the unnamed object represented by the
4609 compound literal; the `DECL_INITIAL' of that `VAR_DECL' is a
4610 `CONSTRUCTOR' representing the brace-enclosed list of initializers
4611 in the compound literal. That anonymous `VAR_DECL' can also be
4612 accessed directly by the `COMPOUND_LITERAL_EXPR_DECL' macro.
4615 A `SAVE_EXPR' represents an expression (possibly involving
4616 side-effects) that is used more than once. The side-effects should
4617 occur only the first time the expression is evaluated. Subsequent
4618 uses should just reuse the computed value. The first operand to
4619 the `SAVE_EXPR' is the expression to evaluate. The side-effects
4620 should be executed where the `SAVE_EXPR' is first encountered in a
4621 depth-first preorder traversal of the expression tree.
4624 A `TARGET_EXPR' represents a temporary object. The first operand
4625 is a `VAR_DECL' for the temporary variable. The second operand is
4626 the initializer for the temporary. The initializer is evaluated,
4627 and copied (bitwise) into the temporary.
4629 Often, a `TARGET_EXPR' occurs on the right-hand side of an
4630 assignment, or as the second operand to a comma-expression which is
4631 itself the right-hand side of an assignment, etc. In this case,
4632 we say that the `TARGET_EXPR' is "normal"; otherwise, we say it is
4633 "orphaned". For a normal `TARGET_EXPR' the temporary variable
4634 should be treated as an alias for the left-hand side of the
4635 assignment, rather than as a new temporary variable.
4637 The third operand to the `TARGET_EXPR', if present, is a
4638 cleanup-expression (i.e., destructor call) for the temporary. If
4639 this expression is orphaned, then this expression must be executed
4640 when the statement containing this expression is complete. These
4641 cleanups must always be executed in the order opposite to that in
4642 which they were encountered. Note that if a temporary is created
4643 on one branch of a conditional operator (i.e., in the second or
4644 third operand to a `COND_EXPR'), the cleanup must be run only if
4645 that branch is actually executed.
4647 See `STMT_IS_FULL_EXPR_P' for more information about running these
4651 An `AGGR_INIT_EXPR' represents the initialization as the return
4652 value of a function call, or as the result of a constructor. An
4653 `AGGR_INIT_EXPR' will only appear as the second operand of a
4654 `TARGET_EXPR'. The first operand to the `AGGR_INIT_EXPR' is the
4655 address of a function to call, just as in a `CALL_EXPR'. The
4656 second operand are the arguments to pass that function, as a
4657 `TREE_LIST', again in a manner similar to that of a `CALL_EXPR'.
4658 The value of the expression is that returned by the function.
4660 If `AGGR_INIT_VIA_CTOR_P' holds of the `AGGR_INIT_EXPR', then the
4661 initialization is via a constructor call. The address of the third
4662 operand of the `AGGR_INIT_EXPR', which is always a `VAR_DECL', is
4663 taken, and this value replaces the first argument in the argument
4664 list. In this case, the value of the expression is the `VAR_DECL'
4665 given by the third operand to the `AGGR_INIT_EXPR'; constructors do
4669 A `VTABLE_REF' indicates that the interior expression computes a
4670 value that is a vtable entry. It is used with `-fvtable-gc' to
4671 track the reference through to front end to the middle end, at
4672 which point we transform this to a `REG_VTABLE_REF' note, which
4673 survives the balance of code generation.
4675 The first operand is the expression that computes the vtable
4676 reference. The second operand is the `VAR_DECL' of the vtable.
4677 The third operand is an `INTEGER_CST' of the byte offset into the
4681 This node is used to implement support for the C/C++ variable
4682 argument-list mechanism. It represents expressions like `va_arg
4683 (ap, type)'. Its `TREE_TYPE' yields the tree representation for
4684 `type' and its sole argument yields the representation for `ap'.
4687 File: gccint.info, Node: RTL, Next: Machine Desc, Prev: Trees, Up: Top
4692 Most of the work of the compiler is done on an intermediate
4693 representation called register transfer language. In this language,
4694 the instructions to be output are described, pretty much one by one, in
4695 an algebraic form that describes what the instruction does.
4697 RTL is inspired by Lisp lists. It has both an internal form, made
4698 up of structures that point at other structures, and a textual form
4699 that is used in the machine description and in printed debugging dumps.
4700 The textual form uses nested parentheses to indicate the pointers in
4705 * RTL Objects:: Expressions vs vectors vs strings vs integers.
4706 * RTL Classes:: Categories of RTL expression objects, and their structure.
4707 * Accessors:: Macros to access expression operands or vector elts.
4708 * Special Accessors:: Macros to access specific annotations on RTL.
4709 * Flags:: Other flags in an RTL expression.
4710 * Machine Modes:: Describing the size and format of a datum.
4711 * Constants:: Expressions with constant values.
4712 * Regs and Memory:: Expressions representing register contents or memory.
4713 * Arithmetic:: Expressions representing arithmetic on other expressions.
4714 * Comparisons:: Expressions representing comparison of expressions.
4715 * Bit-Fields:: Expressions representing bit-fields in memory or reg.
4716 * Vector Operations:: Expressions involving vector datatypes.
4717 * Conversions:: Extending, truncating, floating or fixing.
4718 * RTL Declarations:: Declaring volatility, constancy, etc.
4719 * Side Effects:: Expressions for storing in registers, etc.
4720 * Incdec:: Embedded side-effects for autoincrement addressing.
4721 * Assembler:: Representing `asm' with operands.
4722 * Insns:: Expression types for entire insns.
4723 * Calls:: RTL representation of function call insns.
4724 * Sharing:: Some expressions are unique; others *must* be copied.
4725 * Reading RTL:: Reading textual RTL from a file.
4728 File: gccint.info, Node: RTL Objects, Next: RTL Classes, Up: RTL
4733 RTL uses five kinds of objects: expressions, integers, wide integers,
4734 strings and vectors. Expressions are the most important ones. An RTL
4735 expression ("RTX", for short) is a C structure, but it is usually
4736 referred to with a pointer; a type that is given the typedef name `rtx'.
4738 An integer is simply an `int'; their written form uses decimal
4739 digits. A wide integer is an integral object whose type is
4740 `HOST_WIDE_INT'; their written form uses decimal digits.
4742 A string is a sequence of characters. In core it is represented as a
4743 `char *' in usual C fashion, and it is written in C syntax as well.
4744 However, strings in RTL may never be null. If you write an empty
4745 string in a machine description, it is represented in core as a null
4746 pointer rather than as a pointer to a null character. In certain
4747 contexts, these null pointers instead of strings are valid. Within RTL
4748 code, strings are most commonly found inside `symbol_ref' expressions,
4749 but they appear in other contexts in the RTL expressions that make up
4750 machine descriptions.
4752 In a machine description, strings are normally written with double
4753 quotes, as you would in C. However, strings in machine descriptions may
4754 extend over many lines, which is invalid C, and adjacent string
4755 constants are not concatenated as they are in C. Any string constant
4756 may be surrounded with a single set of parentheses. Sometimes this
4757 makes the machine description easier to read.
4759 There is also a special syntax for strings, which can be useful when
4760 C code is embedded in a machine description. Wherever a string can
4761 appear, it is also valid to write a C-style brace block. The entire
4762 brace block, including the outermost pair of braces, is considered to be
4763 the string constant. Double quote characters inside the braces are not
4764 special. Therefore, if you write string constants in the C code, you
4765 need not escape each quote character with a backslash.
4767 A vector contains an arbitrary number of pointers to expressions.
4768 The number of elements in the vector is explicitly present in the
4769 vector. The written form of a vector consists of square brackets
4770 (`[...]') surrounding the elements, in sequence and with whitespace
4771 separating them. Vectors of length zero are not created; null pointers
4774 Expressions are classified by "expression codes" (also called RTX
4775 codes). The expression code is a name defined in `rtl.def', which is
4776 also (in uppercase) a C enumeration constant. The possible expression
4777 codes and their meanings are machine-independent. The code of an RTX
4778 can be extracted with the macro `GET_CODE (X)' and altered with
4779 `PUT_CODE (X, NEWCODE)'.
4781 The expression code determines how many operands the expression
4782 contains, and what kinds of objects they are. In RTL, unlike Lisp, you
4783 cannot tell by looking at an operand what kind of object it is.
4784 Instead, you must know from its context--from the expression code of
4785 the containing expression. For example, in an expression of code
4786 `subreg', the first operand is to be regarded as an expression and the
4787 second operand as an integer. In an expression of code `plus', there
4788 are two operands, both of which are to be regarded as expressions. In
4789 a `symbol_ref' expression, there is one operand, which is to be
4790 regarded as a string.
4792 Expressions are written as parentheses containing the name of the
4793 expression type, its flags and machine mode if any, and then the
4794 operands of the expression (separated by spaces).
4796 Expression code names in the `md' file are written in lowercase, but
4797 when they appear in C code they are written in uppercase. In this
4798 manual, they are shown as follows: `const_int'.
4800 In a few contexts a null pointer is valid where an expression is
4801 normally wanted. The written form of this is `(nil)'.
4804 File: gccint.info, Node: RTL Classes, Next: Accessors, Prev: RTL Objects, Up: RTL
4806 RTL Classes and Formats
4807 =======================
4809 The various expression codes are divided into several "classes",
4810 which are represented by single characters. You can determine the class
4811 of an RTX code with the macro `GET_RTX_CLASS (CODE)'. Currently,
4812 `rtx.def' defines these classes:
4815 An RTX code that represents an actual object, such as a register
4816 (`REG') or a memory location (`MEM', `SYMBOL_REF'). Constants and
4817 basic transforms on objects (`ADDRESSOF', `HIGH', `LO_SUM') are
4818 also included. Note that `SUBREG' and `STRICT_LOW_PART' are not
4819 in this class, but in class `x'.
4822 An RTX code for a comparison, such as `NE' or `LT'.
4825 An RTX code for a unary arithmetic operation, such as `NEG',
4826 `NOT', or `ABS'. This category also includes value extension
4827 (sign or zero) and conversions between integer and floating point.
4830 An RTX code for a commutative binary operation, such as `PLUS' or
4831 `AND'. `NE' and `EQ' are comparisons, so they have class `<'.
4834 An RTX code for a non-commutative binary operation, such as
4835 `MINUS', `DIV', or `ASHIFTRT'.
4838 An RTX code for a bit-field operation. Currently only
4839 `ZERO_EXTRACT' and `SIGN_EXTRACT'. These have three inputs and
4840 are lvalues (so they can be used for insertion as well). *Note
4844 An RTX code for other three input operations. Currently only
4848 An RTX code for an entire instruction: `INSN', `JUMP_INSN', and
4849 `CALL_INSN'. *Note Insns::.
4852 An RTX code for something that matches in insns, such as
4853 `MATCH_DUP'. These only occur in machine descriptions.
4856 An RTX code for an auto-increment addressing mode, such as
4860 All other RTX codes. This category includes the remaining codes
4861 used only in machine descriptions (`DEFINE_*', etc.). It also
4862 includes all the codes describing side effects (`SET', `USE',
4863 `CLOBBER', etc.) and the non-insns that may appear on an insn
4864 chain, such as `NOTE', `BARRIER', and `CODE_LABEL'.
4866 For each expression code, `rtl.def' specifies the number of
4867 contained objects and their kinds using a sequence of characters called
4868 the "format" of the expression code. For example, the format of
4871 These are the most commonly used format characters:
4874 An expression (actually a pointer to an expression).
4886 A vector of expressions.
4888 A few other format characters are used occasionally:
4891 `u' is equivalent to `e' except that it is printed differently in
4892 debugging dumps. It is used for pointers to insns.
4895 `n' is equivalent to `i' except that it is printed differently in
4896 debugging dumps. It is used for the line number or code number of
4900 `S' indicates a string which is optional. In the RTL objects in
4901 core, `S' is equivalent to `s', but when the object is read, from
4902 an `md' file, the string value of this operand may be omitted. An
4903 omitted string is taken to be the null string.
4906 `V' indicates a vector which is optional. In the RTL objects in
4907 core, `V' is equivalent to `E', but when the object is read from
4908 an `md' file, the vector value of this operand may be omitted. An
4909 omitted vector is effectively the same as a vector of no elements.
4912 `B' indicates a pointer to basic block structure.
4915 `0' means a slot whose contents do not fit any normal category.
4916 `0' slots are not printed at all in dumps, and are often used in
4917 special ways by small parts of the compiler.
4919 There are macros to get the number of operands and the format of an
4922 `GET_RTX_LENGTH (CODE)'
4923 Number of operands of an RTX of code CODE.
4925 `GET_RTX_FORMAT (CODE)'
4926 The format of an RTX of code CODE, as a C string.
4928 Some classes of RTX codes always have the same format. For example,
4929 it is safe to assume that all comparison operations have format `ee'.
4932 All codes of this class have format `e'.
4937 All codes of these classes have format `ee'.
4941 All codes of these classes have format `eee'.
4944 All codes of this class have formats that begin with `iuueiee'.
4945 *Note Insns::. Note that not all RTL objects linked onto an insn
4946 chain are of class `i'.
4951 You can make no assumptions about the format of these codes.
4954 File: gccint.info, Node: Accessors, Next: Special Accessors, Prev: RTL Classes, Up: RTL
4959 Operands of expressions are accessed using the macros `XEXP',
4960 `XINT', `XWINT' and `XSTR'. Each of these macros takes two arguments:
4961 an expression-pointer (RTX) and an operand number (counting from zero).
4966 accesses operand 2 of expression X, as an expression.
4970 accesses the same operand as an integer. `XSTR', used in the same
4971 fashion, would access it as a string.
4973 Any operand can be accessed as an integer, as an expression or as a
4974 string. You must choose the correct method of access for the kind of
4975 value actually stored in the operand. You would do this based on the
4976 expression code of the containing expression. That is also how you
4977 would know how many operands there are.
4979 For example, if X is a `subreg' expression, you know that it has two
4980 operands which can be correctly accessed as `XEXP (X, 0)' and `XINT (X,
4981 1)'. If you did `XINT (X, 0)', you would get the address of the
4982 expression operand but cast as an integer; that might occasionally be
4983 useful, but it would be cleaner to write `(int) XEXP (X, 0)'. `XEXP
4984 (X, 1)' would also compile without error, and would return the second,
4985 integer operand cast as an expression pointer, which would probably
4986 result in a crash when accessed. Nothing stops you from writing `XEXP
4987 (X, 28)' either, but this will access memory past the end of the
4988 expression with unpredictable results.
4990 Access to operands which are vectors is more complicated. You can
4991 use the macro `XVEC' to get the vector-pointer itself, or the macros
4992 `XVECEXP' and `XVECLEN' to access the elements and length of a vector.
4995 Access the vector-pointer which is operand number IDX in EXP.
4997 `XVECLEN (EXP, IDX)'
4998 Access the length (number of elements) in the vector which is in
4999 operand number IDX in EXP. This value is an `int'.
5001 `XVECEXP (EXP, IDX, ELTNUM)'
5002 Access element number ELTNUM in the vector which is in operand
5003 number IDX in EXP. This value is an RTX.
5005 It is up to you to make sure that ELTNUM is not negative and is
5006 less than `XVECLEN (EXP, IDX)'.
5008 All the macros defined in this section expand into lvalues and
5009 therefore can be used to assign the operands, lengths and vector
5010 elements as well as to access them.
5013 File: gccint.info, Node: Special Accessors, Next: Flags, Prev: Accessors, Up: RTL
5015 Access to Special Operands
5016 ==========================
5018 Some RTL nodes have special annotations associated with them.
5023 If 0, X is not in any alias set, and may alias anything.
5024 Otherwise, X can only alias `MEM's in a conflicting alias
5025 set. This value is set in a language-dependent manner in the
5026 front-end, and should not be altered in the back-end. In
5027 some front-ends, these numbers may correspond in some way to
5028 types, or other language-level entities, but they need not,
5029 and the back-end makes no such assumptions. These set
5030 numbers are tested with `alias_sets_conflict_p'.
5033 If this register is known to hold the value of some user-level
5034 declaration, this is that tree node. It may also be a
5035 `COMPONENT_REF', in which case this is some field reference,
5036 and `TREE_OPERAND (X, 0)' contains the declaration, or
5037 another `COMPONENT_REF', or null if there is no compile-time
5038 object associated with the reference.
5041 The offset from the start of `MEM_EXPR' as a `CONST_INT' rtx.
5044 The size in bytes of the memory reference as a `CONST_INT'
5045 rtx. This is mostly relevant for `BLKmode' references as
5046 otherwise the size is implied by the mode.
5049 The known alignment in bits of the memory reference.
5053 `ORIGINAL_REGNO (X)'
5054 This field holds the number the register "originally" had;
5055 for a pseudo register turned into a hard reg this will hold
5056 the old pseudo register number.
5059 If this register is known to hold the value of some user-level
5060 declaration, this is that tree node.
5063 If this register is known to hold the value of some user-level
5064 declaration, this is the offset into that logical storage.
5068 `SYMBOL_REF_DECL (X)'
5069 If the `symbol_ref' X was created for a `VAR_DECL' or a
5070 `FUNCTION_DECL', that tree is recorded here. If this value is
5071 null, then X was created by back end code generation routines,
5072 and there is no associated front end symbol table entry.
5074 `SYMBOL_REF_DECL' may also point to a tree of class `'c'',
5075 that is, some sort of constant. In this case, the
5076 `symbol_ref' is an entry in the per-file constant pool;
5077 again, there is no associated front end symbol table entry.
5079 `SYMBOL_REF_FLAGS (X)'
5080 In a `symbol_ref', this is used to communicate various
5081 predicates about the symbol. Some of these are common enough
5082 to be computed by common code, some are specific to the
5083 target. The common bits are:
5085 `SYMBOL_FLAG_FUNCTION'
5086 Set if the symbol refers to a function.
5089 Set if the symbol is local to this "module". See
5090 `TARGET_BINDS_LOCAL_P'.
5092 `SYMBOL_FLAG_EXTERNAL'
5093 Set if this symbol is not defined in this translation
5094 unit. Note that this is not the inverse of
5095 `SYMBOL_FLAG_LOCAL'.
5098 Set if the symbol is located in the small data section.
5099 See `TARGET_IN_SMALL_DATA_P'.
5101 `SYMBOL_REF_TLS_MODEL (X)'
5102 This is a multi-bit field accessor that returns the
5103 `tls_model' to be used for a thread-local storage
5104 symbol. It returns zero for non-thread-local symbols.
5106 Bits beginning with `SYMBOL_FLAG_MACH_DEP' are available for
5110 File: gccint.info, Node: Flags, Next: Machine Modes, Prev: Special Accessors, Up: RTL
5112 Flags in an RTL Expression
5113 ==========================
5115 RTL expressions contain several flags (one-bit bit-fields) that are
5116 used in certain types of expression. Most often they are accessed with
5117 the following macros, which expand into lvalues.
5119 `CONSTANT_POOL_ADDRESS_P (X)'
5120 Nonzero in a `symbol_ref' if it refers to part of the current
5121 function's constant pool. For most targets these addresses are in
5122 a `.rodata' section entirely separate from the function, but for
5123 some targets the addresses are close to the beginning of the
5124 function. In either case GCC assumes these addresses can be
5125 addressed directly, perhaps with the help of base registers.
5126 Stored in the `unchanging' field and printed as `/u'.
5128 `CONST_OR_PURE_CALL_P (X)'
5129 In a `call_insn', `note', or an `expr_list' for notes, indicates
5130 that the insn represents a call to a const or pure function.
5131 Stored in the `unchanging' field and printed as `/u'.
5133 `INSN_ANNULLED_BRANCH_P (X)'
5134 In a `jump_insn', `call_insn', or `insn' indicates that the branch
5135 is an annulling one. See the discussion under `sequence' below.
5136 Stored in the `unchanging' field and printed as `/u'.
5138 `INSN_DEAD_CODE_P (X)'
5139 In an `insn' during the dead-code elimination pass, nonzero if the
5140 insn is dead. Stored in the `in_struct' field and printed as `/s'.
5142 `INSN_DELETED_P (X)'
5143 In an `insn', `call_insn', `jump_insn', `code_label', `barrier',
5144 or `note', nonzero if the insn has been deleted. Stored in the
5145 `volatil' field and printed as `/v'.
5147 `INSN_FROM_TARGET_P (X)'
5148 In an `insn' or `jump_insn' or `call_insn' in a delay slot of a
5149 branch, indicates that the insn is from the target of the branch.
5150 If the branch insn has `INSN_ANNULLED_BRANCH_P' set, this insn
5151 will only be executed if the branch is taken. For annulled
5152 branches with `INSN_FROM_TARGET_P' clear, the insn will be
5153 executed only if the branch is not taken. When
5154 `INSN_ANNULLED_BRANCH_P' is not set, this insn will always be
5155 executed. Stored in the `in_struct' field and printed as `/s'.
5157 `LABEL_OUTSIDE_LOOP_P (X)'
5158 In `label_ref' expressions, nonzero if this is a reference to a
5159 label that is outside the innermost loop containing the reference
5160 to the label. Stored in the `in_struct' field and printed as `/s'.
5162 `LABEL_PRESERVE_P (X)'
5163 In a `code_label' or `note', indicates that the label is
5164 referenced by code or data not visible to the RTL of a given
5165 function. Labels referenced by a non-local goto will have this
5166 bit set. Stored in the `in_struct' field and printed as `/s'.
5168 `LABEL_REF_NONLOCAL_P (X)'
5169 In `label_ref' and `reg_label' expressions, nonzero if this is a
5170 reference to a non-local label. Stored in the `volatil' field and
5173 `MEM_IN_STRUCT_P (X)'
5174 In `mem' expressions, nonzero for reference to an entire structure,
5175 union or array, or to a component of one. Zero for references to a
5176 scalar variable or through a pointer to a scalar. If both this
5177 flag and `MEM_SCALAR_P' are clear, then we don't know whether this
5178 `mem' is in a structure or not. Both flags should never be
5179 simultaneously set. Stored in the `in_struct' field and printed
5182 `MEM_KEEP_ALIAS_SET_P (X)'
5183 In `mem' expressions, 1 if we should keep the alias set for this
5184 mem unchanged when we access a component. Set to 1, for example,
5185 when we are already in a non-addressable component of an aggregate.
5186 Stored in the `jump' field and printed as `/j'.
5189 In `mem' expressions, nonzero for reference to a scalar known not
5190 to be a member of a structure, union, or array. Zero for such
5191 references and for indirections through pointers, even pointers
5192 pointing to scalar types. If both this flag and `MEM_IN_STRUCT_P'
5193 are clear, then we don't know whether this `mem' is in a structure
5194 or not. Both flags should never be simultaneously set. Stored in
5195 the `frame_related' field and printed as `/f'.
5197 `MEM_VOLATILE_P (X)'
5198 In `mem', `asm_operands', and `asm_input' expressions, nonzero for
5199 volatile memory references. Stored in the `volatil' field and
5203 In `mem', nonzero for memory references that will not trap.
5204 Stored in the `call' field and printed as `/c'.
5206 `REG_FUNCTION_VALUE_P (X)'
5207 Nonzero in a `reg' if it is the place in which this function's
5208 value is going to be returned. (This happens only in a hard
5209 register.) Stored in the `integrated' field and printed as `/i'.
5211 `REG_LOOP_TEST_P (X)'
5212 In `reg' expressions, nonzero if this register's entire life is
5213 contained in the exit test code for some loop. Stored in the
5214 `in_struct' field and printed as `/s'.
5217 Nonzero in a `reg' if the register holds a pointer. Stored in the
5218 `frame_related' field and printed as `/f'.
5221 In a `reg', nonzero if it corresponds to a variable present in the
5222 user's source code. Zero for temporaries generated internally by
5223 the compiler. Stored in the `volatil' field and printed as `/v'.
5225 The same hard register may be used also for collecting the values
5226 of functions called by this one, but `REG_FUNCTION_VALUE_P' is zero
5227 in this kind of use.
5229 `RTX_FRAME_RELATED_P (X)'
5230 Nonzero in an `insn', `call_insn', `jump_insn', `barrier', or
5231 `set' which is part of a function prologue and sets the stack
5232 pointer, sets the frame pointer, or saves a register. This flag
5233 should also be set on an instruction that sets up a temporary
5234 register to use in place of the frame pointer. Stored in the
5235 `frame_related' field and printed as `/f'.
5237 In particular, on RISC targets where there are limits on the sizes
5238 of immediate constants, it is sometimes impossible to reach the
5239 register save area directly from the stack pointer. In that case,
5240 a temporary register is used that is near enough to the register
5241 save area, and the Canonical Frame Address, i.e., DWARF2's logical
5242 frame pointer, register must (temporarily) be changed to be this
5243 temporary register. So, the instruction that sets this temporary
5244 register must be marked as `RTX_FRAME_RELATED_P'.
5246 If the marked instruction is overly complex (defined in terms of
5247 what `dwarf2out_frame_debug_expr' can handle), you will also have
5248 to create a `REG_FRAME_RELATED_EXPR' note and attach it to the
5249 instruction. This note should contain a simple expression of the
5250 computation performed by this instruction, i.e., one that
5251 `dwarf2out_frame_debug_expr' can handle.
5253 This flag is required for exception handling support on targets
5256 `RTX_INTEGRATED_P (X)'
5257 Nonzero in an `insn', `call_insn', `jump_insn', `barrier',
5258 `code_label', `insn_list', `const', or `note' if it resulted from
5259 an in-line function call. Stored in the `integrated' field and
5262 `RTX_UNCHANGING_P (X)'
5263 Nonzero in a `reg', `mem', or `concat' if the register or memory
5264 is set at most once, anywhere. This does not mean that it is
5267 GCC uses this flag to determine whether two references conflict.
5268 As implemented by `true_dependence' in `alias.c' for memory
5269 references, unchanging memory can't conflict with non-unchanging
5270 memory; a non-unchanging read can conflict with a non-unchanging
5271 write; an unchanging read can conflict with an unchanging write
5272 (since there may be a single store to this address to initialize
5273 it); and an unchanging store can conflict with a non-unchanging
5274 read. This means we must make conservative assumptions when
5275 choosing the value of this flag for a memory reference to an
5276 object containing both unchanging and non-unchanging fields: we
5277 must set the flag when writing to the object and clear it when
5278 reading from the object.
5280 Stored in the `unchanging' field and printed as `/u'.
5283 During instruction scheduling, in an `insn', `call_insn' or
5284 `jump_insn', indicates that the previous insn must be scheduled
5285 together with this insn. This is used to ensure that certain
5286 groups of instructions will not be split up by the instruction
5287 scheduling pass, for example, `use' insns before a `call_insn' may
5288 not be separated from the `call_insn'. Stored in the `in_struct'
5289 field and printed as `/s'.
5291 `SET_IS_RETURN_P (X)'
5292 For a `set', nonzero if it is for a return. Stored in the `jump'
5293 field and printed as `/j'.
5295 `SIBLING_CALL_P (X)'
5296 For a `call_insn', nonzero if the insn is a sibling call. Stored
5297 in the `jump' field and printed as `/j'.
5299 `STRING_POOL_ADDRESS_P (X)'
5300 For a `symbol_ref' expression, nonzero if it addresses this
5301 function's string constant pool. Stored in the `frame_related'
5302 field and printed as `/f'.
5304 `SUBREG_PROMOTED_UNSIGNED_P (X)'
5305 Returns a value greater then zero for a `subreg' that has
5306 `SUBREG_PROMOTED_VAR_P' nonzero if the object being referenced is
5307 kept zero-extended, zero if it is kept sign-extended, and less
5308 then zero if it is extended some other way via the `ptr_extend'
5309 instruction. Stored in the `unchanging' field and `volatil'
5310 field, printed as `/u' and `/v'. This macro may only be used to
5311 get the value it may not be used to change the value. Use
5312 `SUBREG_PROMOTED_UNSIGNED_SET' to change the value.
5314 `SUBREG_PROMOTED_UNSIGNED_SET (X)'
5315 Set the `unchanging' and `volatil' fields in a `subreg' to reflect
5316 zero, sign, or other extension. If `volatil' is zero, then
5317 `unchanging' as nonzero means zero extension and as zero means
5318 sign extension. If `volatil' is nonzero then some other type of
5319 extension was done via the `ptr_extend' instruction.
5321 `SUBREG_PROMOTED_VAR_P (X)'
5322 Nonzero in a `subreg' if it was made when accessing an object that
5323 was promoted to a wider mode in accord with the `PROMOTED_MODE'
5324 machine description macro (*note Storage Layout::). In this case,
5325 the mode of the `subreg' is the declared mode of the object and
5326 the mode of `SUBREG_REG' is the mode of the register that holds
5327 the object. Promoted variables are always either sign- or
5328 zero-extended to the wider mode on every assignment. Stored in
5329 the `in_struct' field and printed as `/s'.
5331 `SYMBOL_REF_USED (X)'
5332 In a `symbol_ref', indicates that X has been used. This is
5333 normally only used to ensure that X is only declared external
5334 once. Stored in the `used' field.
5336 `SYMBOL_REF_WEAK (X)'
5337 In a `symbol_ref', indicates that X has been declared weak.
5338 Stored in the `integrated' field and printed as `/i'.
5340 `SYMBOL_REF_FLAG (X)'
5341 In a `symbol_ref', this is used as a flag for machine-specific
5342 purposes. Stored in the `volatil' field and printed as `/v'.
5344 Most uses of `SYMBOL_REF_FLAG' are historic and may be subsumed by
5345 `SYMBOL_REF_FLAGS'. Certainly use of `SYMBOL_REF_FLAGS' is
5346 mandatory if the target requires more than one bit of storage.
5348 These are the fields to which the above macros refer:
5351 In a `mem', 1 means that the memory reference will not trap.
5353 In an RTL dump, this flag is represented as `/c'.
5356 In an `insn' or `set' expression, 1 means that it is part of a
5357 function prologue and sets the stack pointer, sets the frame
5358 pointer, saves a register, or sets up a temporary register to use
5359 in place of the frame pointer.
5361 In `reg' expressions, 1 means that the register holds a pointer.
5363 In `symbol_ref' expressions, 1 means that the reference addresses
5364 this function's string constant pool.
5366 In `mem' expressions, 1 means that the reference is to a scalar.
5368 In an RTL dump, this flag is represented as `/f'.
5371 In `mem' expressions, it is 1 if the memory datum referred to is
5372 all or part of a structure or array; 0 if it is (or might be) a
5373 scalar variable. A reference through a C pointer has 0 because
5374 the pointer might point to a scalar variable. This information
5375 allows the compiler to determine something about possible cases of
5378 In `reg' expressions, it is 1 if the register has its entire life
5379 contained within the test expression of some loop.
5381 In `subreg' expressions, 1 means that the `subreg' is accessing an
5382 object that has had its mode promoted from a wider mode.
5384 In `label_ref' expressions, 1 means that the referenced label is
5385 outside the innermost loop containing the insn in which the
5386 `label_ref' was found.
5388 In `code_label' expressions, it is 1 if the label may never be
5389 deleted. This is used for labels which are the target of
5390 non-local gotos. Such a label that would have been deleted is
5391 replaced with a `note' of type `NOTE_INSN_DELETED_LABEL'.
5393 In an `insn' during dead-code elimination, 1 means that the insn is
5396 In an `insn' or `jump_insn' during reorg for an insn in the delay
5397 slot of a branch, 1 means that this insn is from the target of the
5400 In an `insn' during instruction scheduling, 1 means that this insn
5401 must be scheduled as part of a group together with the previous
5404 In an RTL dump, this flag is represented as `/s'.
5407 In an `insn', `insn_list', or `const', 1 means the RTL was
5408 produced by procedure integration.
5410 In `reg' expressions, 1 means the register contains the value to
5411 be returned by the current function. On machines that pass
5412 parameters in registers, the same register number may be used for
5413 parameters as well, but this flag is not set on such uses.
5415 In `symbol_ref' expressions, 1 means the referenced symbol is weak.
5417 In an RTL dump, this flag is represented as `/i'.
5420 In a `mem' expression, 1 means we should keep the alias set for
5421 this mem unchanged when we access a component.
5423 In a `set', 1 means it is for a return.
5425 In a `call_insn', 1 means it is a sibling call.
5427 In an RTL dump, this flag is represented as `/j'.
5430 In `reg' and `mem' expressions, 1 means that the value of the
5431 expression never changes.
5433 In `subreg' expressions, it is 1 if the `subreg' references an
5434 unsigned object whose mode has been promoted to a wider mode.
5436 In an `insn' or `jump_insn' in the delay slot of a branch
5437 instruction, 1 means an annulling branch should be used.
5439 In a `symbol_ref' expression, 1 means that this symbol addresses
5440 something in the per-function constant pool.
5442 In a `call_insn', `note', or an `expr_list' of notes, 1 means that
5443 this instruction is a call to a const or pure function.
5445 In an RTL dump, this flag is represented as `/u'.
5448 This flag is used directly (without an access macro) at the end of
5449 RTL generation for a function, to count the number of times an
5450 expression appears in insns. Expressions that appear more than
5451 once are copied, according to the rules for shared structure
5454 For a `reg', it is used directly (without an access macro) by the
5455 leaf register renumbering code to ensure that each register is only
5458 In a `symbol_ref', it indicates that an external declaration for
5459 the symbol has already been written.
5462 In a `mem', `asm_operands', or `asm_input' expression, it is 1 if
5463 the memory reference is volatile. Volatile memory references may
5464 not be deleted, reordered or combined.
5466 In a `symbol_ref' expression, it is used for machine-specific
5469 In a `reg' expression, it is 1 if the value is a user-level
5470 variable. 0 indicates an internal compiler temporary.
5472 In an `insn', 1 means the insn has been deleted.
5474 In `label_ref' and `reg_label' expressions, 1 means a reference to
5477 In an RTL dump, this flag is represented as `/v'.
5480 File: gccint.info, Node: Machine Modes, Next: Constants, Prev: Flags, Up: RTL
5485 A machine mode describes a size of data object and the
5486 representation used for it. In the C code, machine modes are
5487 represented by an enumeration type, `enum machine_mode', defined in
5488 `machmode.def'. Each RTL expression has room for a machine mode and so
5489 do certain kinds of tree expressions (declarations and types, to be
5492 In debugging dumps and machine descriptions, the machine mode of an
5493 RTL expression is written after the expression code with a colon to
5494 separate them. The letters `mode' which appear at the end of each
5495 machine mode name are omitted. For example, `(reg:SI 38)' is a `reg'
5496 expression with machine mode `SImode'. If the mode is `VOIDmode', it
5497 is not written at all.
5499 Here is a table of machine modes. The term "byte" below refers to an
5500 object of `BITS_PER_UNIT' bits (*note Storage Layout::).
5503 "Bit" mode represents a single bit, for predicate registers.
5506 "Quarter-Integer" mode represents a single byte treated as an
5510 "Half-Integer" mode represents a two-byte integer.
5513 "Partial Single Integer" mode represents an integer which occupies
5514 four bytes but which doesn't really use all four. On some
5515 machines, this is the right mode to use for pointers.
5518 "Single Integer" mode represents a four-byte integer.
5521 "Partial Double Integer" mode represents an integer which occupies
5522 eight bytes but which doesn't really use all eight. On some
5523 machines, this is the right mode to use for certain pointers.
5526 "Double Integer" mode represents an eight-byte integer.
5529 "Tetra Integer" (?) mode represents a sixteen-byte integer.
5532 "Octa Integer" (?) mode represents a thirty-two-byte integer.
5535 "Quarter-Floating" mode represents a quarter-precision (single
5536 byte) floating point number.
5539 "Half-Floating" mode represents a half-precision (two byte)
5540 floating point number.
5543 "Three-Quarter-Floating" (?) mode represents a
5544 three-quarter-precision (three byte) floating point number.
5547 "Single Floating" mode represents a four byte floating point
5548 number. In the common case, of a processor with IEEE arithmetic
5549 and 8-bit bytes, this is a single-precision IEEE floating point
5550 number; it can also be used for double-precision (on processors
5551 with 16-bit bytes) and single-precision VAX and IBM types.
5554 "Double Floating" mode represents an eight byte floating point
5555 number. In the common case, of a processor with IEEE arithmetic
5556 and 8-bit bytes, this is a double-precision IEEE floating point
5560 "Extended Floating" mode represents a twelve byte floating point
5561 number. This mode is used for IEEE extended floating point. On
5562 some systems not all bits within these bytes will actually be used.
5565 "Tetra Floating" mode represents a sixteen byte floating point
5566 number. This gets used for both the 96-bit extended IEEE
5567 floating-point types padded to 128 bits, and true 128-bit extended
5568 IEEE floating-point types.
5571 "Condition Code" mode represents the value of a condition code,
5572 which is a machine-specific set of bits used to represent the
5573 result of a comparison operation. Other machine-specific modes
5574 may also be used for the condition code. These modes are not used
5575 on machines that use `cc0' (see *note Condition Code::).
5578 "Block" mode represents values that are aggregates to which none of
5579 the other modes apply. In RTL, only memory references can have
5580 this mode, and only if they appear in string-move or vector
5581 instructions. On machines which have no such instructions,
5582 `BLKmode' will not appear in RTL.
5585 Void mode means the absence of a mode or an unspecified mode. For
5586 example, RTL expressions of code `const_int' have mode `VOIDmode'
5587 because they can be taken to have whatever mode the context
5588 requires. In debugging dumps of RTL, `VOIDmode' is expressed by
5589 the absence of any mode.
5591 `QCmode, HCmode, SCmode, DCmode, XCmode, TCmode'
5592 These modes stand for a complex number represented as a pair of
5593 floating point values. The floating point values are in `QFmode',
5594 `HFmode', `SFmode', `DFmode', `XFmode', and `TFmode', respectively.
5596 `CQImode, CHImode, CSImode, CDImode, CTImode, COImode'
5597 These modes stand for a complex number represented as a pair of
5598 integer values. The integer values are in `QImode', `HImode',
5599 `SImode', `DImode', `TImode', and `OImode', respectively.
5601 The machine description defines `Pmode' as a C macro which expands
5602 into the machine mode used for addresses. Normally this is the mode
5603 whose size is `BITS_PER_WORD', `SImode' on 32-bit machines.
5605 The only modes which a machine description must support are
5606 `QImode', and the modes corresponding to `BITS_PER_WORD',
5607 `FLOAT_TYPE_SIZE' and `DOUBLE_TYPE_SIZE'. The compiler will attempt to
5608 use `DImode' for 8-byte structures and unions, but this can be
5609 prevented by overriding the definition of `MAX_FIXED_MODE_SIZE'.
5610 Alternatively, you can have the compiler use `TImode' for 16-byte
5611 structures and unions. Likewise, you can arrange for the C type `short
5612 int' to avoid using `HImode'.
5614 Very few explicit references to machine modes remain in the compiler
5615 and these few references will soon be removed. Instead, the machine
5616 modes are divided into mode classes. These are represented by the
5617 enumeration type `enum mode_class' defined in `machmode.h'. The
5618 possible mode classes are:
5621 Integer modes. By default these are `BImode', `QImode', `HImode',
5622 `SImode', `DImode', `TImode', and `OImode'.
5625 The "partial integer" modes, `PQImode', `PHImode', `PSImode' and
5629 Floating point modes. By default these are `QFmode', `HFmode',
5630 `TQFmode', `SFmode', `DFmode', `XFmode' and `TFmode'.
5633 Complex integer modes. (These are not currently implemented).
5635 `MODE_COMPLEX_FLOAT'
5636 Complex floating point modes. By default these are `QCmode',
5637 `HCmode', `SCmode', `DCmode', `XCmode', and `TCmode'.
5640 Algol or Pascal function variables including a static chain.
5641 (These are not currently implemented).
5644 Modes representing condition code values. These are `CCmode' plus
5645 any modes listed in the `EXTRA_CC_MODES' macro. *Note Jump
5646 Patterns::, also see *Note Condition Code::.
5649 This is a catchall mode class for modes which don't fit into the
5650 above classes. Currently `VOIDmode' and `BLKmode' are in
5653 Here are some C macros that relate to machine modes:
5656 Returns the machine mode of the RTX X.
5658 `PUT_MODE (X, NEWMODE)'
5659 Alters the machine mode of the RTX X to be NEWMODE.
5662 Stands for the number of machine modes available on the target
5663 machine. This is one greater than the largest numeric value of any
5667 Returns the name of mode M as a string.
5669 `GET_MODE_CLASS (M)'
5670 Returns the mode class of mode M.
5672 `GET_MODE_WIDER_MODE (M)'
5673 Returns the next wider natural mode. For example, the expression
5674 `GET_MODE_WIDER_MODE (QImode)' returns `HImode'.
5677 Returns the size in bytes of a datum of mode M.
5679 `GET_MODE_BITSIZE (M)'
5680 Returns the size in bits of a datum of mode M.
5683 Returns a bitmask containing 1 for all bits in a word that fit
5684 within mode M. This macro can only be used for modes whose
5685 bitsize is less than or equal to `HOST_BITS_PER_INT'.
5687 `GET_MODE_ALIGNMENT (M)'
5688 Return the required alignment, in bits, for an object of mode M.
5690 `GET_MODE_UNIT_SIZE (M)'
5691 Returns the size in bytes of the subunits of a datum of mode M.
5692 This is the same as `GET_MODE_SIZE' except in the case of complex
5693 modes. For them, the unit size is the size of the real or
5696 `GET_MODE_NUNITS (M)'
5697 Returns the number of units contained in a mode, i.e.,
5698 `GET_MODE_SIZE' divided by `GET_MODE_UNIT_SIZE'.
5700 `GET_CLASS_NARROWEST_MODE (C)'
5701 Returns the narrowest mode in mode class C.
5703 The global variables `byte_mode' and `word_mode' contain modes whose
5704 classes are `MODE_INT' and whose bitsizes are either `BITS_PER_UNIT' or
5705 `BITS_PER_WORD', respectively. On 32-bit machines, these are `QImode'
5706 and `SImode', respectively.
5709 File: gccint.info, Node: Constants, Next: Regs and Memory, Prev: Machine Modes, Up: RTL
5711 Constant Expression Types
5712 =========================
5714 The simplest RTL expressions are those that represent constant
5718 This type of expression represents the integer value I. I is
5719 customarily accessed with the macro `INTVAL' as in `INTVAL (EXP)',
5720 which is equivalent to `XWINT (EXP, 0)'.
5722 There is only one expression object for the integer value zero; it
5723 is the value of the variable `const0_rtx'. Likewise, the only
5724 expression for integer value one is found in `const1_rtx', the only
5725 expression for integer value two is found in `const2_rtx', and the
5726 only expression for integer value negative one is found in
5727 `constm1_rtx'. Any attempt to create an expression of code
5728 `const_int' and value zero, one, two or negative one will return
5729 `const0_rtx', `const1_rtx', `const2_rtx' or `constm1_rtx' as
5732 Similarly, there is only one object for the integer whose value is
5733 `STORE_FLAG_VALUE'. It is found in `const_true_rtx'. If
5734 `STORE_FLAG_VALUE' is one, `const_true_rtx' and `const1_rtx' will
5735 point to the same object. If `STORE_FLAG_VALUE' is -1,
5736 `const_true_rtx' and `constm1_rtx' will point to the same object.
5738 `(const_double:M ADDR I0 I1 ...)'
5739 Represents either a floating-point constant of mode M or an
5740 integer constant too large to fit into `HOST_BITS_PER_WIDE_INT'
5741 bits but small enough to fit within twice that number of bits (GCC
5742 does not provide a mechanism to represent even larger constants).
5743 In the latter case, M will be `VOIDmode'.
5745 `(const_vector:M [X0 X1 ...])'
5746 Represents a vector constant. The square brackets stand for the
5747 vector containing the constant elements. X0, X1 and so on are the
5748 `const_int' or `const_double' elements.
5750 The number of units in a `const_vector' is obtained with the macro
5751 `CONST_VECTOR_NUNITS' as in `CONST_VECTOR_NUNITS (V)'.
5753 Individual elements in a vector constant are accessed with the
5754 macro `CONST_VECTOR_ELT' as in `CONST_VECTOR_ELT (V, N)' where V
5755 is the vector constant and N is the element desired.
5757 ADDR is used to contain the `mem' expression that corresponds to
5758 the location in memory that at which the constant can be found. If
5759 it has not been allocated a memory location, but is on the chain
5760 of all `const_double' expressions in this compilation (maintained
5761 using an undisplayed field), ADDR contains `const0_rtx'. If it is
5762 not on the chain, ADDR contains `cc0_rtx'. ADDR is customarily
5763 accessed with the macro `CONST_DOUBLE_MEM' and the chain field via
5764 `CONST_DOUBLE_CHAIN'.
5766 If M is `VOIDmode', the bits of the value are stored in I0 and I1.
5767 I0 is customarily accessed with the macro `CONST_DOUBLE_LOW' and
5768 I1 with `CONST_DOUBLE_HIGH'.
5770 If the constant is floating point (regardless of its precision),
5771 then the number of integers used to store the value depends on the
5772 size of `REAL_VALUE_TYPE' (*note Floating Point::). The integers
5773 represent a floating point number, but not precisely in the target
5774 machine's or host machine's floating point format. To convert
5775 them to the precise bit pattern used by the target machine, use
5776 the macro `REAL_VALUE_TO_TARGET_DOUBLE' and friends (*note Data
5779 The macro `CONST0_RTX (MODE)' refers to an expression with value 0
5780 in mode MODE. If mode MODE is of mode class `MODE_INT', it
5781 returns `const0_rtx'. If mode MODE is of mode class `MODE_FLOAT',
5782 it returns a `CONST_DOUBLE' expression in mode MODE. Otherwise,
5783 it returns a `CONST_VECTOR' expression in mode MODE. Similarly,
5784 the macro `CONST1_RTX (MODE)' refers to an expression with value 1
5785 in mode MODE and similarly for `CONST2_RTX'. The `CONST1_RTX' and
5786 `CONST2_RTX' macros are undefined for vector modes.
5788 `(const_string STR)'
5789 Represents a constant string with value STR. Currently this is
5790 used only for insn attributes (*note Insn Attributes::) since
5791 constant strings in C are placed in memory.
5793 `(symbol_ref:MODE SYMBOL)'
5794 Represents the value of an assembler label for data. SYMBOL is a
5795 string that describes the name of the assembler label. If it
5796 starts with a `*', the label is the rest of SYMBOL not including
5797 the `*'. Otherwise, the label is SYMBOL, usually prefixed with
5800 The `symbol_ref' contains a mode, which is usually `Pmode'.
5801 Usually that is the only mode for which a symbol is directly valid.
5804 Represents the value of an assembler label for code. It contains
5805 one operand, an expression, which must be a `code_label' or a
5806 `note' of type `NOTE_INSN_DELETED_LABEL' that appears in the
5807 instruction sequence to identify the place where the label should
5810 The reason for using a distinct expression type for code label
5811 references is so that jump optimization can distinguish them.
5814 Represents a constant that is the result of an assembly-time
5815 arithmetic computation. The operand, EXP, is an expression that
5816 contains only constants (`const_int', `symbol_ref' and `label_ref'
5817 expressions) combined with `plus' and `minus'. However, not all
5818 combinations are valid, since the assembler cannot do arbitrary
5819 arithmetic on relocatable symbols.
5821 M should be `Pmode'.
5824 Represents the high-order bits of EXP, usually a `symbol_ref'.
5825 The number of bits is machine-dependent and is normally the number
5826 of bits specified in an instruction that initializes the high
5827 order bits of a register. It is used with `lo_sum' to represent
5828 the typical two-instruction sequence used in RISC machines to
5829 reference a global memory location.
5831 M should be `Pmode'.
5834 File: gccint.info, Node: Regs and Memory, Next: Arithmetic, Prev: Constants, Up: RTL
5836 Registers and Memory
5837 ====================
5839 Here are the RTL expression types for describing access to machine
5840 registers and to main memory.
5843 For small values of the integer N (those that are less than
5844 `FIRST_PSEUDO_REGISTER'), this stands for a reference to machine
5845 register number N: a "hard register". For larger values of N, it
5846 stands for a temporary value or "pseudo register". The compiler's
5847 strategy is to generate code assuming an unlimited number of such
5848 pseudo registers, and later convert them into hard registers or
5849 into memory references.
5851 M is the machine mode of the reference. It is necessary because
5852 machines can generally refer to each register in more than one
5853 mode. For example, a register may contain a full word but there
5854 may be instructions to refer to it as a half word or as a single
5855 byte, as well as instructions to refer to it as a floating point
5856 number of various precisions.
5858 Even for a register that the machine can access in only one mode,
5859 the mode must always be specified.
5861 The symbol `FIRST_PSEUDO_REGISTER' is defined by the machine
5862 description, since the number of hard registers on the machine is
5863 an invariant characteristic of the machine. Note, however, that
5864 not all of the machine registers must be general registers. All
5865 the machine registers that can be used for storage of data are
5866 given hard register numbers, even those that can be used only in
5867 certain instructions or can hold only certain types of data.
5869 A hard register may be accessed in various modes throughout one
5870 function, but each pseudo register is given a natural mode and is
5871 accessed only in that mode. When it is necessary to describe an
5872 access to a pseudo register using a nonnatural mode, a `subreg'
5875 A `reg' expression with a machine mode that specifies more than
5876 one word of data may actually stand for several consecutive
5877 registers. If in addition the register number specifies a
5878 hardware register, then it actually represents several consecutive
5879 hardware registers starting with the specified one.
5881 Each pseudo register number used in a function's RTL code is
5882 represented by a unique `reg' expression.
5884 Some pseudo register numbers, those within the range of
5885 `FIRST_VIRTUAL_REGISTER' to `LAST_VIRTUAL_REGISTER' only appear
5886 during the RTL generation phase and are eliminated before the
5887 optimization phases. These represent locations in the stack frame
5888 that cannot be determined until RTL generation for the function
5889 has been completed. The following virtual register numbers are
5892 `VIRTUAL_INCOMING_ARGS_REGNUM'
5893 This points to the first word of the incoming arguments
5894 passed on the stack. Normally these arguments are placed
5895 there by the caller, but the callee may have pushed some
5896 arguments that were previously passed in registers.
5898 When RTL generation is complete, this virtual register is
5899 replaced by the sum of the register given by
5900 `ARG_POINTER_REGNUM' and the value of `FIRST_PARM_OFFSET'.
5902 `VIRTUAL_STACK_VARS_REGNUM'
5903 If `FRAME_GROWS_DOWNWARD' is defined, this points to
5904 immediately above the first variable on the stack.
5905 Otherwise, it points to the first variable on the stack.
5907 `VIRTUAL_STACK_VARS_REGNUM' is replaced with the sum of the
5908 register given by `FRAME_POINTER_REGNUM' and the value
5909 `STARTING_FRAME_OFFSET'.
5911 `VIRTUAL_STACK_DYNAMIC_REGNUM'
5912 This points to the location of dynamically allocated memory
5913 on the stack immediately after the stack pointer has been
5914 adjusted by the amount of memory desired.
5916 This virtual register is replaced by the sum of the register
5917 given by `STACK_POINTER_REGNUM' and the value
5918 `STACK_DYNAMIC_OFFSET'.
5920 `VIRTUAL_OUTGOING_ARGS_REGNUM'
5921 This points to the location in the stack at which outgoing
5922 arguments should be written when the stack is pre-pushed
5923 (arguments pushed using push insns should always use
5924 `STACK_POINTER_REGNUM').
5926 This virtual register is replaced by the sum of the register
5927 given by `STACK_POINTER_REGNUM' and the value
5928 `STACK_POINTER_OFFSET'.
5930 `(subreg:M REG BYTENUM)'
5931 `subreg' expressions are used to refer to a register in a machine
5932 mode other than its natural one, or to refer to one register of a
5933 multi-part `reg' that actually refers to several registers.
5935 Each pseudo-register has a natural mode. If it is necessary to
5936 operate on it in a different mode--for example, to perform a
5937 fullword move instruction on a pseudo-register that contains a
5938 single byte--the pseudo-register must be enclosed in a `subreg'.
5939 In such a case, BYTENUM is zero.
5941 Usually M is at least as narrow as the mode of REG, in which case
5942 it is restricting consideration to only the bits of REG that are
5945 Sometimes M is wider than the mode of REG. These `subreg'
5946 expressions are often called "paradoxical". They are used in
5947 cases where we want to refer to an object in a wider mode but do
5948 not care what value the additional bits have. The reload pass
5949 ensures that paradoxical references are only made to hard
5952 The other use of `subreg' is to extract the individual registers of
5953 a multi-register value. Machine modes such as `DImode' and
5954 `TImode' can indicate values longer than a word, values which
5955 usually require two or more consecutive registers. To access one
5956 of the registers, use a `subreg' with mode `SImode' and a BYTENUM
5957 offset that says which register.
5959 Storing in a non-paradoxical `subreg' has undefined results for
5960 bits belonging to the same word as the `subreg'. This laxity makes
5961 it easier to generate efficient code for such instructions. To
5962 represent an instruction that preserves all the bits outside of
5963 those in the `subreg', use `strict_low_part' around the `subreg'.
5965 The compilation parameter `WORDS_BIG_ENDIAN', if set to 1, says
5966 that byte number zero is part of the most significant word;
5967 otherwise, it is part of the least significant word.
5969 The compilation parameter `BYTES_BIG_ENDIAN', if set to 1, says
5970 that byte number zero is the most significant byte within a word;
5971 otherwise, it is the least significant byte within a word.
5973 On a few targets, `FLOAT_WORDS_BIG_ENDIAN' disagrees with
5974 `WORDS_BIG_ENDIAN'. However, most parts of the compiler treat
5975 floating point values as if they had the same endianness as
5976 integer values. This works because they handle them solely as a
5977 collection of integer values, with no particular numerical value.
5978 Only real.c and the runtime libraries care about
5979 `FLOAT_WORDS_BIG_ENDIAN'.
5981 Between the combiner pass and the reload pass, it is possible to
5982 have a paradoxical `subreg' which contains a `mem' instead of a
5983 `reg' as its first operand. After the reload pass, it is also
5984 possible to have a non-paradoxical `subreg' which contains a
5985 `mem'; this usually occurs when the `mem' is a stack slot which
5986 replaced a pseudo register.
5988 Note that it is not valid to access a `DFmode' value in `SFmode'
5989 using a `subreg'. On some machines the most significant part of a
5990 `DFmode' value does not have the same format as a single-precision
5993 It is also not valid to access a single word of a multi-word value
5994 in a hard register when less registers can hold the value than
5995 would be expected from its size. For example, some 32-bit
5996 machines have floating-point registers that can hold an entire
5997 `DFmode' value. If register 10 were such a register `(subreg:SI
5998 (reg:DF 10) 1)' would be invalid because there is no way to
5999 convert that reference to a single machine register. The reload
6000 pass prevents `subreg' expressions such as these from being formed.
6002 The first operand of a `subreg' expression is customarily accessed
6003 with the `SUBREG_REG' macro and the second operand is customarily
6004 accessed with the `SUBREG_BYTE' macro.
6007 This represents a scratch register that will be required for the
6008 execution of a single instruction and not used subsequently. It is
6009 converted into a `reg' by either the local register allocator or
6012 `scratch' is usually present inside a `clobber' operation (*note
6016 This refers to the machine's condition code register. It has no
6017 operands and may not have a machine mode. There are two ways to
6020 * To stand for a complete set of condition code flags. This is
6021 best on most machines, where each comparison sets the entire
6024 With this technique, `(cc0)' may be validly used in only two
6025 contexts: as the destination of an assignment (in test and
6026 compare instructions) and in comparison operators comparing
6027 against zero (`const_int' with value zero; that is to say,
6030 * To stand for a single flag that is the result of a single
6031 condition. This is useful on machines that have only a
6032 single flag bit, and in which comparison instructions must
6033 specify the condition to test.
6035 With this technique, `(cc0)' may be validly used in only two
6036 contexts: as the destination of an assignment (in test and
6037 compare instructions) where the source is a comparison
6038 operator, and as the first operand of `if_then_else' (in a
6039 conditional branch).
6041 There is only one expression object of code `cc0'; it is the value
6042 of the variable `cc0_rtx'. Any attempt to create an expression of
6043 code `cc0' will return `cc0_rtx'.
6045 Instructions can set the condition code implicitly. On many
6046 machines, nearly all instructions set the condition code based on
6047 the value that they compute or store. It is not necessary to
6048 record these actions explicitly in the RTL because the machine
6049 description includes a prescription for recognizing the
6050 instructions that do so (by means of the macro
6051 `NOTICE_UPDATE_CC'). *Note Condition Code::. Only instructions
6052 whose sole purpose is to set the condition code, and instructions
6053 that use the condition code, need mention `(cc0)'.
6055 On some machines, the condition code register is given a register
6056 number and a `reg' is used instead of `(cc0)'. This is usually the
6057 preferable approach if only a small subset of instructions modify
6058 the condition code. Other machines store condition codes in
6059 general registers; in such cases a pseudo register should be used.
6061 Some machines, such as the SPARC and RS/6000, have two sets of
6062 arithmetic instructions, one that sets and one that does not set
6063 the condition code. This is best handled by normally generating
6064 the instruction that does not set the condition code, and making a
6065 pattern that both performs the arithmetic and sets the condition
6066 code register (which would not be `(cc0)' in this case). For
6067 examples, search for `addcc' and `andcc' in `sparc.md'.
6070 This represents the machine's program counter. It has no operands
6071 and may not have a machine mode. `(pc)' may be validly used only
6072 in certain specific contexts in jump instructions.
6074 There is only one expression object of code `pc'; it is the value
6075 of the variable `pc_rtx'. Any attempt to create an expression of
6076 code `pc' will return `pc_rtx'.
6078 All instructions that do not jump alter the program counter
6079 implicitly by incrementing it, but there is no need to mention
6082 `(mem:M ADDR ALIAS)'
6083 This RTX represents a reference to main memory at an address
6084 represented by the expression ADDR. M specifies how large a unit
6085 of memory is accessed. ALIAS specifies an alias set for the
6086 reference. In general two items are in different alias sets if
6087 they cannot reference the same memory address.
6089 The construct `(mem:BLK (scratch))' is considered to alias all
6090 other memories. Thus it may be used as a memory barrier in
6091 epilogue stack deallocation patterns.
6094 This RTX represents a request for the address of register REG.
6095 Its mode is always `Pmode'. If there are any `addressof'
6096 expressions left in the function after CSE, REG is forced into the
6097 stack and the `addressof' expression is replaced with a `plus'
6098 expression for the address of its stack slot.
6101 File: gccint.info, Node: Arithmetic, Next: Comparisons, Prev: Regs and Memory, Up: RTL
6103 RTL Expressions for Arithmetic
6104 ==============================
6106 Unless otherwise specified, all the operands of arithmetic
6107 expressions must be valid for mode M. An operand is valid for mode M
6108 if it has mode M, or if it is a `const_int' or `const_double' and M is
6109 a mode of class `MODE_INT'.
6111 For commutative binary operations, constants should be placed in the
6115 Represents the sum of the values represented by X and Y carried
6116 out in machine mode M.
6119 Like `plus', except that it represents that sum of X and the
6120 low-order bits of Y. The number of low order bits is
6121 machine-dependent but is normally the number of bits in a `Pmode'
6122 item minus the number of bits set by the `high' code (*note
6125 M should be `Pmode'.
6128 Like `plus' but represents subtraction.
6131 Like `plus', but using signed saturation in case of an overflow.
6134 Like `plus', but using unsigned saturation in case of an overflow.
6137 Like `minus', but using signed saturation in case of an overflow.
6140 Like `minus', but using unsigned saturation in case of an overflow.
6143 Represents the result of subtracting Y from X for purposes of
6144 comparison. The result is computed without overflow, as if with
6147 Of course, machines can't really subtract with infinite precision.
6148 However, they can pretend to do so when only the sign of the
6149 result will be used, which is the case when the result is stored
6150 in the condition code. And that is the _only_ way this kind of
6151 expression may validly be used: as a value to be stored in the
6152 condition codes, either `(cc0)' or a register. *Note
6155 The mode M is not related to the modes of X and Y, but instead is
6156 the mode of the condition code value. If `(cc0)' is used, it is
6157 `VOIDmode'. Otherwise it is some mode in class `MODE_CC', often
6158 `CCmode'. *Note Condition Code::. If M is `VOIDmode' or
6159 `CCmode', the operation returns sufficient information (in an
6160 unspecified format) so that any comparison operator can be applied
6161 to the result of the `COMPARE' operation. For other modes in
6162 class `MODE_CC', the operation only returns a subset of this
6165 Normally, X and Y must have the same mode. Otherwise, `compare'
6166 is valid only if the mode of X is in class `MODE_INT' and Y is a
6167 `const_int' or `const_double' with mode `VOIDmode'. The mode of X
6168 determines what mode the comparison is to be done in; thus it must
6171 If one of the operands is a constant, it should be placed in the
6172 second operand and the comparison code adjusted as appropriate.
6174 A `compare' specifying two `VOIDmode' constants is not valid since
6175 there is no way to know in what mode the comparison is to be
6176 performed; the comparison must either be folded during the
6177 compilation or the first operand must be loaded into a register
6178 while its mode is still known.
6181 Represents the negation (subtraction from zero) of the value
6182 represented by X, carried out in mode M.
6185 Represents the signed product of the values represented by X and Y
6186 carried out in machine mode M.
6188 Some machines support a multiplication that generates a product
6189 wider than the operands. Write the pattern for this as
6191 (mult:M (sign_extend:M X) (sign_extend:M Y))
6193 where M is wider than the modes of X and Y, which need not be the
6196 For unsigned widening multiplication, use the same idiom, but with
6197 `zero_extend' instead of `sign_extend'.
6200 Represents the quotient in signed division of X by Y, carried out
6201 in machine mode M. If M is a floating point mode, it represents
6202 the exact quotient; otherwise, the integerized quotient.
6204 Some machines have division instructions in which the operands and
6205 quotient widths are not all the same; you should represent such
6206 instructions using `truncate' and `sign_extend' as in,
6208 (truncate:M1 (div:M2 X (sign_extend:M2 Y)))
6211 Like `div' but represents unsigned division.
6215 Like `div' and `udiv' but represent the remainder instead of the
6220 Represents the smaller (for `smin') or larger (for `smax') of X
6221 and Y, interpreted as signed integers in mode M.
6225 Like `smin' and `smax', but the values are interpreted as unsigned
6229 Represents the bitwise complement of the value represented by X,
6230 carried out in mode M, which must be a fixed-point machine mode.
6233 Represents the bitwise logical-and of the values represented by X
6234 and Y, carried out in machine mode M, which must be a fixed-point
6238 Represents the bitwise inclusive-or of the values represented by X
6239 and Y, carried out in machine mode M, which must be a fixed-point
6243 Represents the bitwise exclusive-or of the values represented by X
6244 and Y, carried out in machine mode M, which must be a fixed-point
6248 Represents the result of arithmetically shifting X left by C
6249 places. X have mode M, a fixed-point machine mode. C be a
6250 fixed-point mode or be a constant with mode `VOIDmode'; which mode
6251 is determined by the mode called for in the machine description
6252 entry for the left-shift instruction. For example, on the VAX,
6253 the mode of C is `QImode' regardless of M.
6257 Like `ashift' but for right shift. Unlike the case for left shift,
6258 these two operations are distinct.
6262 Similar but represent left and right rotate. If C is a constant,
6266 Represents the absolute value of X, computed in mode M.
6269 Represents the square root of X, computed in mode M. Most often M
6270 will be a floating point mode.
6273 Represents one plus the index of the least significant 1-bit in X,
6274 represented as an integer of mode M. (The value is zero if X is
6275 zero.) The mode of X need not be M; depending on the target
6276 machine, various mode combinations may be valid.
6279 Represents the number of leading 0-bits in X, represented as an
6280 integer of mode M, starting at the most significant bit position.
6281 If X is zero, the value is determined by
6282 `CLZ_DEFINED_VALUE_AT_ZERO'. Note that this is one of the few
6283 expressions that is not invariant under widening. The mode of X
6284 will usually be an integer mode.
6287 Represents the number of trailing 0-bits in X, represented as an
6288 integer of mode M, starting at the least significant bit position.
6289 If X is zero, the value is determined by
6290 `CTZ_DEFINED_VALUE_AT_ZERO'. Except for this case, `ctz(x)' is
6291 equivalent to `ffs(X) - 1'. The mode of X will usually be an
6295 Represents the number of 1-bits in X, represented as an integer of
6296 mode M. The mode of X will usually be an integer mode.
6299 Represents the number of 1-bits modulo 2 in X, represented as an
6300 integer of mode M. The mode of X will usually be an integer mode.
6303 File: gccint.info, Node: Comparisons, Next: Bit-Fields, Prev: Arithmetic, Up: RTL
6305 Comparison Operations
6306 =====================
6308 Comparison operators test a relation on two operands and are
6309 considered to represent a machine-dependent nonzero value described by,
6310 but not necessarily equal to, `STORE_FLAG_VALUE' (*note Misc::) if the
6311 relation holds, or zero if it does not, for comparison operators whose
6312 results have a `MODE_INT' mode, and `FLOAT_STORE_FLAG_VALUE' (*note
6313 Misc::) if the relation holds, or zero if it does not, for comparison
6314 operators that return floating-point values. The mode of the
6315 comparison operation is independent of the mode of the data being
6316 compared. If the comparison operation is being tested (e.g., the first
6317 operand of an `if_then_else'), the mode must be `VOIDmode'.
6319 There are two ways that comparison operations may be used. The
6320 comparison operators may be used to compare the condition codes `(cc0)'
6321 against zero, as in `(eq (cc0) (const_int 0))'. Such a construct
6322 actually refers to the result of the preceding instruction in which the
6323 condition codes were set. The instruction setting the condition code
6324 must be adjacent to the instruction using the condition code; only
6325 `note' insns may separate them.
6327 Alternatively, a comparison operation may directly compare two data
6328 objects. The mode of the comparison is determined by the operands; they
6329 must both be valid for a common machine mode. A comparison with both
6330 operands constant would be invalid as the machine mode could not be
6331 deduced from it, but such a comparison should never exist in RTL due to
6334 In the example above, if `(cc0)' were last set to `(compare X Y)',
6335 the comparison operation is identical to `(eq X Y)'. Usually only one
6336 style of comparisons is supported on a particular machine, but the
6337 combine pass will try to merge the operations to produce the `eq' shown
6338 in case it exists in the context of the particular insn involved.
6340 Inequality comparisons come in two flavors, signed and unsigned.
6341 Thus, there are distinct expression codes `gt' and `gtu' for signed and
6342 unsigned greater-than. These can produce different results for the same
6343 pair of integer values: for example, 1 is signed greater-than -1 but not
6344 unsigned greater-than, because -1 when regarded as unsigned is actually
6345 `0xffffffff' which is greater than 1.
6347 The signed comparisons are also used for floating point values.
6348 Floating point comparisons are distinguished by the machine modes of
6352 `STORE_FLAG_VALUE' if the values represented by X and Y are equal,
6356 `STORE_FLAG_VALUE' if the values represented by X and Y are not
6360 `STORE_FLAG_VALUE' if the X is greater than Y. If they are
6361 fixed-point, the comparison is done in a signed sense.
6364 Like `gt' but does unsigned comparison, on fixed-point numbers
6369 Like `gt' and `gtu' but test for "less than".
6373 Like `gt' and `gtu' but test for "greater than or equal".
6377 Like `gt' and `gtu' but test for "less than or equal".
6379 `(if_then_else COND THEN ELSE)'
6380 This is not a comparison operation but is listed here because it is
6381 always used in conjunction with a comparison operation. To be
6382 precise, COND is a comparison expression. This expression
6383 represents a choice, according to COND, between the value
6384 represented by THEN and the one represented by ELSE.
6386 On most machines, `if_then_else' expressions are valid only to
6387 express conditional jumps.
6389 `(cond [TEST1 VALUE1 TEST2 VALUE2 ...] DEFAULT)'
6390 Similar to `if_then_else', but more general. Each of TEST1,
6391 TEST2, ... is performed in turn. The result of this expression is
6392 the VALUE corresponding to the first nonzero test, or DEFAULT if
6393 none of the tests are nonzero expressions.
6395 This is currently not valid for instruction patterns and is
6396 supported only for insn attributes. *Note Insn Attributes::.
6399 File: gccint.info, Node: Bit-Fields, Next: Vector Operations, Prev: Comparisons, Up: RTL
6404 Special expression codes exist to represent bit-field instructions.
6405 These types of expressions are lvalues in RTL; they may appear on the
6406 left side of an assignment, indicating insertion of a value into the
6407 specified bit-field.
6409 `(sign_extract:M LOC SIZE POS)'
6410 This represents a reference to a sign-extended bit-field contained
6411 or starting in LOC (a memory or register reference). The bit-field
6412 is SIZE bits wide and starts at bit POS. The compilation option
6413 `BITS_BIG_ENDIAN' says which end of the memory unit POS counts
6416 If LOC is in memory, its mode must be a single-byte integer mode.
6417 If LOC is in a register, the mode to use is specified by the
6418 operand of the `insv' or `extv' pattern (*note Standard Names::)
6419 and is usually a full-word integer mode, which is the default if
6422 The mode of POS is machine-specific and is also specified in the
6423 `insv' or `extv' pattern.
6425 The mode M is the same as the mode that would be used for LOC if
6428 `(zero_extract:M LOC SIZE POS)'
6429 Like `sign_extract' but refers to an unsigned or zero-extended
6430 bit-field. The same sequence of bits are extracted, but they are
6431 filled to an entire word with zeros instead of by sign-extension.
6434 File: gccint.info, Node: Vector Operations, Next: Conversions, Prev: Bit-Fields, Up: RTL
6439 All normal RTL expressions can be used with vector modes; they are
6440 interpreted as operating on each part of the vector independently.
6441 Additionally, there are a few new expressions to describe specific
6444 `(vec_merge:M VEC1 VEC2 ITEMS)'
6445 This describes a merge operation between two vectors. The result
6446 is a vector of mode M; its elements are selected from either VEC1
6447 or VEC2. Which elements are selected is described by ITEMS, which
6448 is a bit mask represented by a `const_int'; a zero bit indicates
6449 the corresponding element in the result vector is taken from VEC2
6450 while a set bit indicates it is taken from VEC1.
6452 `(vec_select:M VEC1 SELECTION)'
6453 This describes an operation that selects parts of a vector. VEC1
6454 is the source vector, SELECTION is a `parallel' that contains a
6455 `const_int' for each of the subparts of the result vector, giving
6456 the number of the source subpart that should be stored into it.
6458 `(vec_concat:M VEC1 VEC2)'
6459 Describes a vector concat operation. The result is a
6460 concatenation of the vectors VEC1 and VEC2; its length is the sum
6461 of the lengths of the two inputs.
6463 `(vec_duplicate:M VEC)'
6464 This operation converts a small vector into a larger one by
6465 duplicating the input values. The output vector mode must have
6466 the same submodes as the input vector mode, and the number of
6467 output parts must be an integer multiple of the number of input
6471 File: gccint.info, Node: Conversions, Next: RTL Declarations, Prev: Vector Operations, Up: RTL
6476 All conversions between machine modes must be represented by
6477 explicit conversion operations. For example, an expression which is
6478 the sum of a byte and a full word cannot be written as `(plus:SI
6479 (reg:QI 34) (reg:SI 80))' because the `plus' operation requires two
6480 operands of the same machine mode. Therefore, the byte-sized operand
6481 is enclosed in a conversion operation, as in
6483 (plus:SI (sign_extend:SI (reg:QI 34)) (reg:SI 80))
6485 The conversion operation is not a mere placeholder, because there
6486 may be more than one way of converting from a given starting mode to
6487 the desired final mode. The conversion operation code says how to do
6490 For all conversion operations, X must not be `VOIDmode' because the
6491 mode in which to do the conversion would not be known. The conversion
6492 must either be done at compile-time or X must be placed into a register.
6495 Represents the result of sign-extending the value X to machine
6496 mode M. M must be a fixed-point mode and X a fixed-point value of
6497 a mode narrower than M.
6500 Represents the result of zero-extending the value X to machine
6501 mode M. M must be a fixed-point mode and X a fixed-point value of
6502 a mode narrower than M.
6504 `(float_extend:M X)'
6505 Represents the result of extending the value X to machine mode M.
6506 M must be a floating point mode and X a floating point value of a
6507 mode narrower than M.
6510 Represents the result of truncating the value X to machine mode M.
6511 M must be a fixed-point mode and X a fixed-point value of a mode
6515 Represents the result of truncating the value X to machine mode M,
6516 using signed saturation in the case of overflow. Both M and the
6517 mode of X must be fixed-point modes.
6520 Represents the result of truncating the value X to machine mode M,
6521 using unsigned saturation in the case of overflow. Both M and the
6522 mode of X must be fixed-point modes.
6524 `(float_truncate:M X)'
6525 Represents the result of truncating the value X to machine mode M.
6526 M must be a floating point mode and X a floating point value of a
6530 Represents the result of converting fixed point value X, regarded
6531 as signed, to floating point mode M.
6533 `(unsigned_float:M X)'
6534 Represents the result of converting fixed point value X, regarded
6535 as unsigned, to floating point mode M.
6538 When M is a fixed point mode, represents the result of converting
6539 floating point value X to mode M, regarded as signed. How
6540 rounding is done is not specified, so this operation may be used
6541 validly in compiling C code only for integer-valued operands.
6543 `(unsigned_fix:M X)'
6544 Represents the result of converting floating point value X to
6545 fixed point mode M, regarded as unsigned. How rounding is done is
6549 When M is a floating point mode, represents the result of
6550 converting floating point value X (valid for mode M) to an
6551 integer, still represented in floating point mode M, by rounding
6555 File: gccint.info, Node: RTL Declarations, Next: Side Effects, Prev: Conversions, Up: RTL
6560 Declaration expression codes do not represent arithmetic operations
6561 but rather state assertions about their operands.
6563 `(strict_low_part (subreg:M (reg:N R) 0))'
6564 This expression code is used in only one context: as the
6565 destination operand of a `set' expression. In addition, the
6566 operand of this expression must be a non-paradoxical `subreg'
6569 The presence of `strict_low_part' says that the part of the
6570 register which is meaningful in mode N, but is not part of mode M,
6571 is not to be altered. Normally, an assignment to such a subreg is
6572 allowed to have undefined effects on the rest of the register when
6573 M is less than a word.
6576 File: gccint.info, Node: Side Effects, Next: Incdec, Prev: RTL Declarations, Up: RTL
6578 Side Effect Expressions
6579 =======================
6581 The expression codes described so far represent values, not actions.
6582 But machine instructions never produce values; they are meaningful only
6583 for their side effects on the state of the machine. Special expression
6584 codes are used to represent side effects.
6586 The body of an instruction is always one of these side effect codes;
6587 the codes described above, which represent values, appear only as the
6591 Represents the action of storing the value of X into the place
6592 represented by LVAL. LVAL must be an expression representing a
6593 place that can be stored in: `reg' (or `subreg', `strict_low_part'
6594 or `zero_extract'), `mem', `pc', `parallel', or `cc0'.
6596 If LVAL is a `reg', `subreg' or `mem', it has a machine mode; then
6597 X must be valid for that mode.
6599 If LVAL is a `reg' whose machine mode is less than the full width
6600 of the register, then it means that the part of the register
6601 specified by the machine mode is given the specified value and the
6602 rest of the register receives an undefined value. Likewise, if
6603 LVAL is a `subreg' whose machine mode is narrower than the mode of
6604 the register, the rest of the register can be changed in an
6607 If LVAL is a `strict_low_part' or `zero_extract' of a `subreg',
6608 then the part of the register specified by the machine mode of the
6609 `subreg' is given the value X and the rest of the register is not
6612 If LVAL is `(cc0)', it has no machine mode, and X may be either a
6613 `compare' expression or a value that may have any mode. The
6614 latter case represents a "test" instruction. The expression `(set
6615 (cc0) (reg:M N))' is equivalent to `(set (cc0) (compare (reg:M N)
6616 (const_int 0)))'. Use the former expression to save space during
6619 If LVAL is a `parallel', it is used to represent the case of a
6620 function returning a structure in multiple registers. Each element
6621 of the `parallel' is an `expr_list' whose first operand is a `reg'
6622 and whose second operand is a `const_int' representing the offset
6623 (in bytes) into the structure at which the data in that register
6624 corresponds. The first element may be null to indicate that the
6625 structure is also passed partly in memory.
6627 If LVAL is `(pc)', we have a jump instruction, and the
6628 possibilities for X are very limited. It may be a `label_ref'
6629 expression (unconditional jump). It may be an `if_then_else'
6630 (conditional jump), in which case either the second or the third
6631 operand must be `(pc)' (for the case which does not jump) and the
6632 other of the two must be a `label_ref' (for the case which does
6633 jump). X may also be a `mem' or `(plus:SI (pc) Y)', where Y may
6634 be a `reg' or a `mem'; these unusual patterns are used to
6635 represent jumps through branch tables.
6637 If LVAL is neither `(cc0)' nor `(pc)', the mode of LVAL must not
6638 be `VOIDmode' and the mode of X must be valid for the mode of LVAL.
6640 LVAL is customarily accessed with the `SET_DEST' macro and X with
6641 the `SET_SRC' macro.
6644 As the sole expression in a pattern, represents a return from the
6645 current function, on machines where this can be done with one
6646 instruction, such as VAXen. On machines where a multi-instruction
6647 "epilogue" must be executed in order to return from the function,
6648 returning is done by jumping to a label which precedes the
6649 epilogue, and the `return' expression code is never used.
6651 Inside an `if_then_else' expression, represents the value to be
6652 placed in `pc' to return to the caller.
6654 Note that an insn pattern of `(return)' is logically equivalent to
6655 `(set (pc) (return))', but the latter form is never used.
6657 `(call FUNCTION NARGS)'
6658 Represents a function call. FUNCTION is a `mem' expression whose
6659 address is the address of the function to be called. NARGS is an
6660 expression which can be used for two purposes: on some machines it
6661 represents the number of bytes of stack argument; on others, it
6662 represents the number of argument registers.
6664 Each machine has a standard machine mode which FUNCTION must have.
6665 The machine description defines macro `FUNCTION_MODE' to expand
6666 into the requisite mode name. The purpose of this mode is to
6667 specify what kind of addressing is allowed, on machines where the
6668 allowed kinds of addressing depend on the machine mode being
6672 Represents the storing or possible storing of an unpredictable,
6673 undescribed value into X, which must be a `reg', `scratch',
6674 `parallel' or `mem' expression.
6676 One place this is used is in string instructions that store
6677 standard values into particular hard registers. It may not be
6678 worth the trouble to describe the values that are stored, but it
6679 is essential to inform the compiler that the registers will be
6680 altered, lest it attempt to keep data in them across the string
6683 If X is `(mem:BLK (const_int 0))' or `(mem:BLK (scratch))', it
6684 means that all memory locations must be presumed clobbered. If X
6685 is a `parallel', it has the same meaning as a `parallel' in a
6688 Note that the machine description classifies certain hard
6689 registers as "call-clobbered". All function call instructions are
6690 assumed by default to clobber these registers, so there is no need
6691 to use `clobber' expressions to indicate this fact. Also, each
6692 function call is assumed to have the potential to alter any memory
6693 location, unless the function is declared `const'.
6695 If the last group of expressions in a `parallel' are each a
6696 `clobber' expression whose arguments are `reg' or `match_scratch'
6697 (*note RTL Template::) expressions, the combiner phase can add the
6698 appropriate `clobber' expressions to an insn it has constructed
6699 when doing so will cause a pattern to be matched.
6701 This feature can be used, for example, on a machine that whose
6702 multiply and add instructions don't use an MQ register but which
6703 has an add-accumulate instruction that does clobber the MQ
6704 register. Similarly, a combined instruction might require a
6705 temporary register while the constituent instructions might not.
6707 When a `clobber' expression for a register appears inside a
6708 `parallel' with other side effects, the register allocator
6709 guarantees that the register is unoccupied both before and after
6710 that insn. However, the reload phase may allocate a register used
6711 for one of the inputs unless the `&' constraint is specified for
6712 the selected alternative (*note Modifiers::). You can clobber
6713 either a specific hard register, a pseudo register, or a `scratch'
6714 expression; in the latter two cases, GCC will allocate a hard
6715 register that is available there for use as a temporary.
6717 For instructions that require a temporary register, you should use
6718 `scratch' instead of a pseudo-register because this will allow the
6719 combiner phase to add the `clobber' when required. You do this by
6720 coding (`clobber' (`match_scratch' ...)). If you do clobber a
6721 pseudo register, use one which appears nowhere else--generate a
6722 new one each time. Otherwise, you may confuse CSE.
6724 There is one other known use for clobbering a pseudo register in a
6725 `parallel': when one of the input operands of the insn is also
6726 clobbered by the insn. In this case, using the same pseudo
6727 register in the clobber and elsewhere in the insn produces the
6731 Represents the use of the value of X. It indicates that the value
6732 in X at this point in the program is needed, even though it may
6733 not be apparent why this is so. Therefore, the compiler will not
6734 attempt to delete previous instructions whose only effect is to
6735 store a value in X. X must be a `reg' expression.
6737 In some situations, it may be tempting to add a `use' of a
6738 register in a `parallel' to describe a situation where the value
6739 of a special register will modify the behavior of the instruction.
6740 An hypothetical example might be a pattern for an addition that can
6741 either wrap around or use saturating addition depending on the
6742 value of a special control register:
6744 (parallel [(set (reg:SI 2) (unspec:SI [(reg:SI 3)
6748 This will not work, several of the optimizers only look at
6749 expressions locally; it is very likely that if you have multiple
6750 insns with identical inputs to the `unspec', they will be
6751 optimized away even if register 1 changes in between.
6753 This means that `use' can _only_ be used to describe that the
6754 register is live. You should think twice before adding `use'
6755 statements, more often you will want to use `unspec' instead. The
6756 `use' RTX is most commonly useful to describe that a fixed
6757 register is implicitly used in an insn. It is also safe to use in
6758 patterns where the compiler knows for other reasons that the result
6759 of the whole pattern is variable, such as `movstrM' or `call'
6762 During the reload phase, an insn that has a `use' as pattern can
6763 carry a reg_equal note. These `use' insns will be deleted before
6764 the reload phase exits.
6766 During the delayed branch scheduling phase, X may be an insn.
6767 This indicates that X previously was located at this place in the
6768 code and its data dependencies need to be taken into account.
6769 These `use' insns will be deleted before the delayed branch
6770 scheduling phase exits.
6772 `(parallel [X0 X1 ...])'
6773 Represents several side effects performed in parallel. The square
6774 brackets stand for a vector; the operand of `parallel' is a vector
6775 of expressions. X0, X1 and so on are individual side effect
6776 expressions--expressions of code `set', `call', `return',
6779 "In parallel" means that first all the values used in the
6780 individual side-effects are computed, and second all the actual
6781 side-effects are performed. For example,
6783 (parallel [(set (reg:SI 1) (mem:SI (reg:SI 1)))
6784 (set (mem:SI (reg:SI 1)) (reg:SI 1))])
6786 says unambiguously that the values of hard register 1 and the
6787 memory location addressed by it are interchanged. In both places
6788 where `(reg:SI 1)' appears as a memory address it refers to the
6789 value in register 1 _before_ the execution of the insn.
6791 It follows that it is _incorrect_ to use `parallel' and expect the
6792 result of one `set' to be available for the next one. For
6793 example, people sometimes attempt to represent a jump-if-zero
6794 instruction this way:
6796 (parallel [(set (cc0) (reg:SI 34))
6797 (set (pc) (if_then_else
6798 (eq (cc0) (const_int 0))
6802 But this is incorrect, because it says that the jump condition
6803 depends on the condition code value _before_ this instruction, not
6804 on the new value that is set by this instruction.
6806 Peephole optimization, which takes place together with final
6807 assembly code output, can produce insns whose patterns consist of
6808 a `parallel' whose elements are the operands needed to output the
6809 resulting assembler code--often `reg', `mem' or constant
6810 expressions. This would not be well-formed RTL at any other stage
6811 in compilation, but it is ok then because no further optimization
6812 remains to be done. However, the definition of the macro
6813 `NOTICE_UPDATE_CC', if any, must deal with such insns if you
6814 define any peephole optimizations.
6816 `(cond_exec [COND EXPR])'
6817 Represents a conditionally executed expression. The EXPR is
6818 executed only if the COND is nonzero. The COND expression must
6819 not have side-effects, but the EXPR may very well have
6822 `(sequence [INSNS ...])'
6823 Represents a sequence of insns. Each of the INSNS that appears in
6824 the vector is suitable for appearing in the chain of insns, so it
6825 must be an `insn', `jump_insn', `call_insn', `code_label',
6826 `barrier' or `note'.
6828 A `sequence' RTX is never placed in an actual insn during RTL
6829 generation. It represents the sequence of insns that result from a
6830 `define_expand' _before_ those insns are passed to `emit_insn' to
6831 insert them in the chain of insns. When actually inserted, the
6832 individual sub-insns are separated out and the `sequence' is
6835 After delay-slot scheduling is completed, an insn and all the
6836 insns that reside in its delay slots are grouped together into a
6837 `sequence'. The insn requiring the delay slot is the first insn
6838 in the vector; subsequent insns are to be placed in the delay slot.
6840 `INSN_ANNULLED_BRANCH_P' is set on an insn in a delay slot to
6841 indicate that a branch insn should be used that will conditionally
6842 annul the effect of the insns in the delay slots. In such a case,
6843 `INSN_FROM_TARGET_P' indicates that the insn is from the target of
6844 the branch and should be executed only if the branch is taken;
6845 otherwise the insn should be executed only if the branch is not
6846 taken. *Note Delay Slots::.
6848 These expression codes appear in place of a side effect, as the body
6849 of an insn, though strictly speaking they do not always describe side
6853 Represents literal assembler code as described by the string S.
6855 `(unspec [OPERANDS ...] INDEX)'
6856 `(unspec_volatile [OPERANDS ...] INDEX)'
6857 Represents a machine-specific operation on OPERANDS. INDEX
6858 selects between multiple machine-specific operations.
6859 `unspec_volatile' is used for volatile operations and operations
6860 that may trap; `unspec' is used for other operations.
6862 These codes may appear inside a `pattern' of an insn, inside a
6863 `parallel', or inside an expression.
6865 `(addr_vec:M [LR0 LR1 ...])'
6866 Represents a table of jump addresses. The vector elements LR0,
6867 etc., are `label_ref' expressions. The mode M specifies how much
6868 space is given to each address; normally M would be `Pmode'.
6870 `(addr_diff_vec:M BASE [LR0 LR1 ...] MIN MAX FLAGS)'
6871 Represents a table of jump addresses expressed as offsets from
6872 BASE. The vector elements LR0, etc., are `label_ref' expressions
6873 and so is BASE. The mode M specifies how much space is given to
6874 each address-difference. MIN and MAX are set up by branch
6875 shortening and hold a label with a minimum and a maximum address,
6876 respectively. FLAGS indicates the relative position of BASE, MIN
6877 and MAX to the containing insn and of MIN and MAX to BASE. See
6878 rtl.def for details.
6880 `(prefetch:M ADDR RW LOCALITY)'
6881 Represents prefetch of memory at address ADDR. Operand RW is 1 if
6882 the prefetch is for data to be written, 0 otherwise; targets that
6883 do not support write prefetches should treat this as a normal
6884 prefetch. Operand LOCALITY specifies the amount of temporal
6885 locality; 0 if there is none or 1, 2, or 3 for increasing levels
6886 of temporal locality; targets that do not support locality hints
6889 This insn is used to minimize cache-miss latency by moving data
6890 into a cache before it is accessed. It should use only
6891 non-faulting data prefetch instructions.
6894 File: gccint.info, Node: Incdec, Next: Assembler, Prev: Side Effects, Up: RTL
6896 Embedded Side-Effects on Addresses
6897 ==================================
6899 Six special side-effect expression codes appear as memory addresses.
6902 Represents the side effect of decrementing X by a standard amount
6903 and represents also the value that X has after being decremented.
6904 X must be a `reg' or `mem', but most machines allow only a `reg'.
6905 M must be the machine mode for pointers on the machine in use.
6906 The amount X is decremented by is the length in bytes of the
6907 machine mode of the containing memory reference of which this
6908 expression serves as the address. Here is an example of its use:
6910 (mem:DF (pre_dec:SI (reg:SI 39)))
6912 This says to decrement pseudo register 39 by the length of a
6913 `DFmode' value and use the result to address a `DFmode' value.
6916 Similar, but specifies incrementing X instead of decrementing it.
6919 Represents the same side effect as `pre_dec' but a different
6920 value. The value represented here is the value X has before being
6924 Similar, but specifies incrementing X instead of decrementing it.
6926 `(post_modify:M X Y)'
6927 Represents the side effect of setting X to Y and represents X
6928 before X is modified. X must be a `reg' or `mem', but most
6929 machines allow only a `reg'. M must be the machine mode for
6930 pointers on the machine in use.
6932 The expression Y must be one of three forms:
6933 `(plus:M X Z)', `(minus:M X Z)', or `(plus:M X I)', where Z
6934 is an index register and I is a constant.
6936 Here is an example of its use:
6938 (mem:SF (post_modify:SI (reg:SI 42) (plus (reg:SI 42)
6941 This says to modify pseudo register 42 by adding the contents of
6942 pseudo register 48 to it, after the use of what ever 42 points to.
6944 `(pre_modify:M X EXPR)'
6945 Similar except side effects happen before the use.
6947 These embedded side effect expressions must be used with care.
6948 Instruction patterns may not use them. Until the `flow' pass of the
6949 compiler, they may occur only to represent pushes onto the stack. The
6950 `flow' pass finds cases where registers are incremented or decremented
6951 in one instruction and used as an address shortly before or after;
6952 these cases are then transformed to use pre- or post-increment or
6955 If a register used as the operand of these expressions is used in
6956 another address in an insn, the original value of the register is used.
6957 Uses of the register outside of an address are not permitted within the
6958 same insn as a use in an embedded side effect expression because such
6959 insns behave differently on different machines and hence must be treated
6960 as ambiguous and disallowed.
6962 An instruction that can be represented with an embedded side effect
6963 could also be represented using `parallel' containing an additional
6964 `set' to describe how the address register is altered. This is not
6965 done because machines that allow these operations at all typically
6966 allow them wherever a memory address is called for. Describing them as
6967 additional parallel stores would require doubling the number of entries
6968 in the machine description.
6971 File: gccint.info, Node: Assembler, Next: Insns, Prev: Incdec, Up: RTL
6973 Assembler Instructions as Expressions
6974 =====================================
6976 The RTX code `asm_operands' represents a value produced by a
6977 user-specified assembler instruction. It is used to represent an `asm'
6978 statement with arguments. An `asm' statement with a single output
6981 asm ("foo %1,%2,%0" : "=a" (outputvar) : "g" (x + y), "di" (*z));
6983 is represented using a single `asm_operands' RTX which represents the
6984 value that is stored in `outputvar':
6986 (set RTX-FOR-OUTPUTVAR
6987 (asm_operands "foo %1,%2,%0" "a" 0
6988 [RTX-FOR-ADDITION-RESULT RTX-FOR-*Z]
6990 (asm_input:M2 "di")]))
6992 Here the operands of the `asm_operands' RTX are the assembler template
6993 string, the output-operand's constraint, the index-number of the output
6994 operand among the output operands specified, a vector of input operand
6995 RTX's, and a vector of input-operand modes and constraints. The mode
6996 M1 is the mode of the sum `x+y'; M2 is that of `*z'.
6998 When an `asm' statement has multiple output values, its insn has
6999 several such `set' RTX's inside of a `parallel'. Each `set' contains a
7000 `asm_operands'; all of these share the same assembler template and
7001 vectors, but each contains the constraint for the respective output
7002 operand. They are also distinguished by the output-operand index
7003 number, which is 0, 1, ... for successive output operands.
7006 File: gccint.info, Node: Insns, Next: Calls, Prev: Assembler, Up: RTL
7011 The RTL representation of the code for a function is a doubly-linked
7012 chain of objects called "insns". Insns are expressions with special
7013 codes that are used for no other purpose. Some insns are actual
7014 instructions; others represent dispatch tables for `switch' statements;
7015 others represent labels to jump to or various sorts of declarative
7018 In addition to its own specific data, each insn must have a unique
7019 id-number that distinguishes it from all other insns in the current
7020 function (after delayed branch scheduling, copies of an insn with the
7021 same id-number may be present in multiple places in a function, but
7022 these copies will always be identical and will only appear inside a
7023 `sequence'), and chain pointers to the preceding and following insns.
7024 These three fields occupy the same position in every insn, independent
7025 of the expression code of the insn. They could be accessed with `XEXP'
7026 and `XINT', but instead three special macros are always used:
7029 Accesses the unique id of insn I.
7032 Accesses the chain pointer to the insn preceding I. If I is the
7033 first insn, this is a null pointer.
7036 Accesses the chain pointer to the insn following I. If I is the
7037 last insn, this is a null pointer.
7039 The first insn in the chain is obtained by calling `get_insns'; the
7040 last insn is the result of calling `get_last_insn'. Within the chain
7041 delimited by these insns, the `NEXT_INSN' and `PREV_INSN' pointers must
7042 always correspond: if INSN is not the first insn,
7044 NEXT_INSN (PREV_INSN (INSN)) == INSN
7046 is always true and if INSN is not the last insn,
7048 PREV_INSN (NEXT_INSN (INSN)) == INSN
7052 After delay slot scheduling, some of the insns in the chain might be
7053 `sequence' expressions, which contain a vector of insns. The value of
7054 `NEXT_INSN' in all but the last of these insns is the next insn in the
7055 vector; the value of `NEXT_INSN' of the last insn in the vector is the
7056 same as the value of `NEXT_INSN' for the `sequence' in which it is
7057 contained. Similar rules apply for `PREV_INSN'.
7059 This means that the above invariants are not necessarily true for
7060 insns inside `sequence' expressions. Specifically, if INSN is the
7061 first insn in a `sequence', `NEXT_INSN (PREV_INSN (INSN))' is the insn
7062 containing the `sequence' expression, as is the value of `PREV_INSN
7063 (NEXT_INSN (INSN))' if INSN is the last insn in the `sequence'
7064 expression. You can use these expressions to find the containing
7065 `sequence' expression.
7067 Every insn has one of the following six expression codes:
7070 The expression code `insn' is used for instructions that do not
7071 jump and do not do function calls. `sequence' expressions are
7072 always contained in insns with code `insn' even if one of those
7073 insns should jump or do function calls.
7075 Insns with code `insn' have four additional fields beyond the three
7076 mandatory ones listed above. These four are described in a table
7080 The expression code `jump_insn' is used for instructions that may
7081 jump (or, more generally, may contain `label_ref' expressions). If
7082 there is an instruction to return from the current function, it is
7083 recorded as a `jump_insn'.
7085 `jump_insn' insns have the same extra fields as `insn' insns,
7086 accessed in the same way and in addition contain a field
7087 `JUMP_LABEL' which is defined once jump optimization has completed.
7089 For simple conditional and unconditional jumps, this field contains
7090 the `code_label' to which this insn will (possibly conditionally)
7091 branch. In a more complex jump, `JUMP_LABEL' records one of the
7092 labels that the insn refers to; the only way to find the others is
7093 to scan the entire body of the insn. In an `addr_vec',
7094 `JUMP_LABEL' is `NULL_RTX'.
7096 Return insns count as jumps, but since they do not refer to any
7097 labels, their `JUMP_LABEL' is `NULL_RTX'.
7100 The expression code `call_insn' is used for instructions that may
7101 do function calls. It is important to distinguish these
7102 instructions because they imply that certain registers and memory
7103 locations may be altered unpredictably.
7105 `call_insn' insns have the same extra fields as `insn' insns,
7106 accessed in the same way and in addition contain a field
7107 `CALL_INSN_FUNCTION_USAGE', which contains a list (chain of
7108 `expr_list' expressions) containing `use' and `clobber'
7109 expressions that denote hard registers and `MEM's used or
7110 clobbered by the called function.
7112 A `MEM' generally points to a stack slots in which arguments passed
7113 to the libcall by reference (*note FUNCTION_ARG_PASS_BY_REFERENCE:
7114 Register Arguments.) are stored. If the argument is caller-copied
7115 (*note FUNCTION_ARG_CALLEE_COPIES: Register Arguments.), the stack
7116 slot will be mentioned in `CLOBBER' and `USE' entries; if it's
7117 callee-copied, only a `USE' will appear, and the `MEM' may point
7118 to addresses that are not stack slots. These `MEM's are used only
7119 in libcalls, because, unlike regular function calls, `CONST_CALL's
7120 (which libcalls generally are, *note CONST_CALL_P: Flags.) aren't
7121 assumed to read and write all memory, so flow would consider the
7122 stores dead and remove them. Note that, since a libcall must
7123 never return values in memory (*note RETURN_IN_MEMORY: Aggregate
7124 Return.), there will never be a `CLOBBER' for a memory address
7125 holding a return value.
7127 `CLOBBER'ed registers in this list augment registers specified in
7128 `CALL_USED_REGISTERS' (*note Register Basics::).
7131 A `code_label' insn represents a label that a jump insn can jump
7132 to. It contains two special fields of data in addition to the
7133 three standard ones. `CODE_LABEL_NUMBER' is used to hold the
7134 "label number", a number that identifies this label uniquely among
7135 all the labels in the compilation (not just in the current
7136 function). Ultimately, the label is represented in the assembler
7137 output as an assembler label, usually of the form `LN' where N is
7140 When a `code_label' appears in an RTL expression, it normally
7141 appears within a `label_ref' which represents the address of the
7144 Besides as a `code_label', a label can also be represented as a
7145 `note' of type `NOTE_INSN_DELETED_LABEL'.
7147 The field `LABEL_NUSES' is only defined once the jump optimization
7148 phase is completed. It contains the number of times this label is
7149 referenced in the current function.
7151 The field `LABEL_KIND' differentiates four different types of
7152 labels: `LABEL_NORMAL', `LABEL_STATIC_ENTRY',
7153 `LABEL_GLOBAL_ENTRY', and `LABEL_WEAK_ENTRY'. The only labels
7154 that do not have type `LABEL_NORMAL' are "alternate entry points"
7155 to the current function. These may be static (visible only in the
7156 containing translation unit), global (exposed to all translation
7157 units), or weak (global, but can be overridden by another symbol
7158 with the same name).
7160 Much of the compiler treats all four kinds of label identically.
7161 Some of it needs to know whether or not a label is an alternate
7162 entry point; for this purpose, the macro `LABEL_ALT_ENTRY_P' is
7163 provided. It is equivalent to testing whether `LABEL_KIND (label)
7164 == LABEL_NORMAL'. The only place that cares about the distinction
7165 between static, global, and weak alternate entry points, besides
7166 the front-end code that creates them, is the function
7167 `output_alternate_entry_point', in `final.c'.
7169 To set the kind of a label, use the `SET_LABEL_KIND' macro.
7172 Barriers are placed in the instruction stream when control cannot
7173 flow past them. They are placed after unconditional jump
7174 instructions to indicate that the jumps are unconditional and
7175 after calls to `volatile' functions, which do not return (e.g.,
7176 `exit'). They contain no information beyond the three standard
7180 `note' insns are used to represent additional debugging and
7181 declarative information. They contain two nonstandard fields, an
7182 integer which is accessed with the macro `NOTE_LINE_NUMBER' and a
7183 string accessed with `NOTE_SOURCE_FILE'.
7185 If `NOTE_LINE_NUMBER' is positive, the note represents the
7186 position of a source line and `NOTE_SOURCE_FILE' is the source
7187 file name that the line came from. These notes control generation
7188 of line number data in the assembler output.
7190 Otherwise, `NOTE_LINE_NUMBER' is not really a line number but a
7191 code with one of the following values (and `NOTE_SOURCE_FILE' must
7192 contain a null pointer):
7195 Such a note is completely ignorable. Some passes of the
7196 compiler delete insns by altering them into notes of this
7199 `NOTE_INSN_DELETED_LABEL'
7200 This marks what used to be a `code_label', but was not used
7201 for other purposes than taking its address and was
7202 transformed to mark that no code jumps to it.
7204 `NOTE_INSN_BLOCK_BEG'
7205 `NOTE_INSN_BLOCK_END'
7206 These types of notes indicate the position of the beginning
7207 and end of a level of scoping of variable names. They
7208 control the output of debugging information.
7210 `NOTE_INSN_EH_REGION_BEG'
7211 `NOTE_INSN_EH_REGION_END'
7212 These types of notes indicate the position of the beginning
7213 and end of a level of scoping for exception handling.
7214 `NOTE_BLOCK_NUMBER' identifies which `CODE_LABEL' or `note'
7215 of type `NOTE_INSN_DELETED_LABEL' is associated with the
7218 `NOTE_INSN_LOOP_BEG'
7219 `NOTE_INSN_LOOP_END'
7220 These types of notes indicate the position of the beginning
7221 and end of a `while' or `for' loop. They enable the loop
7222 optimizer to find loops quickly.
7224 `NOTE_INSN_LOOP_CONT'
7225 Appears at the place in a loop that `continue' statements
7228 `NOTE_INSN_LOOP_VTOP'
7229 This note indicates the place in a loop where the exit test
7230 begins for those loops in which the exit test has been
7231 duplicated. This position becomes another virtual start of
7232 the loop when considering loop invariants.
7234 `NOTE_INSN_FUNCTION_END'
7235 Appears near the end of the function body, just before the
7236 label that `return' statements jump to (on machine where a
7237 single instruction does not suffice for returning). This
7238 note may be deleted by jump optimization.
7241 Appears following each call to `setjmp' or a related function.
7243 These codes are printed symbolically when they appear in debugging
7246 The machine mode of an insn is normally `VOIDmode', but some phases
7247 use the mode for various purposes.
7249 The common subexpression elimination pass sets the mode of an insn to
7250 `QImode' when it is the first insn in a block that has already been
7253 The second Haifa scheduling pass, for targets that can multiple
7254 issue, sets the mode of an insn to `TImode' when it is believed that the
7255 instruction begins an issue group. That is, when the instruction
7256 cannot issue simultaneously with the previous. This may be relied on
7257 by later passes, in particular machine-dependent reorg.
7259 Here is a table of the extra fields of `insn', `jump_insn' and
7263 An expression for the side effect performed by this insn. This
7264 must be one of the following codes: `set', `call', `use',
7265 `clobber', `return', `asm_input', `asm_output', `addr_vec',
7266 `addr_diff_vec', `trap_if', `unspec', `unspec_volatile',
7267 `parallel', `cond_exec', or `sequence'. If it is a `parallel',
7268 each element of the `parallel' must be one these codes, except that
7269 `parallel' expressions cannot be nested and `addr_vec' and
7270 `addr_diff_vec' are not permitted inside a `parallel' expression.
7273 An integer that says which pattern in the machine description
7274 matches this insn, or -1 if the matching has not yet been
7277 Such matching is never attempted and this field remains -1 on an
7278 insn whose pattern consists of a single `use', `clobber',
7279 `asm_input', `addr_vec' or `addr_diff_vec' expression.
7281 Matching is also never attempted on insns that result from an `asm'
7282 statement. These contain at least one `asm_operands' expression.
7283 The function `asm_noperands' returns a non-negative value for such
7286 In the debugging output, this field is printed as a number
7287 followed by a symbolic representation that locates the pattern in
7288 the `md' file as some small positive or negative offset from a
7292 A list (chain of `insn_list' expressions) giving information about
7293 dependencies between instructions within a basic block. Neither a
7294 jump nor a label may come between the related insns.
7297 A list (chain of `expr_list' and `insn_list' expressions) giving
7298 miscellaneous information about the insn. It is often information
7299 pertaining to the registers used in this insn.
7301 The `LOG_LINKS' field of an insn is a chain of `insn_list'
7302 expressions. Each of these has two operands: the first is an insn, and
7303 the second is another `insn_list' expression (the next one in the
7304 chain). The last `insn_list' in the chain has a null pointer as second
7305 operand. The significant thing about the chain is which insns appear
7306 in it (as first operands of `insn_list' expressions). Their order is
7309 This list is originally set up by the flow analysis pass; it is a
7310 null pointer until then. Flow only adds links for those data
7311 dependencies which can be used for instruction combination. For each
7312 insn, the flow analysis pass adds a link to insns which store into
7313 registers values that are used for the first time in this insn. The
7314 instruction scheduling pass adds extra links so that every dependence
7315 will be represented. Links represent data dependencies,
7316 antidependencies and output dependencies; the machine mode of the link
7317 distinguishes these three types: antidependencies have mode
7318 `REG_DEP_ANTI', output dependencies have mode `REG_DEP_OUTPUT', and
7319 data dependencies have mode `VOIDmode'.
7321 The `REG_NOTES' field of an insn is a chain similar to the
7322 `LOG_LINKS' field but it includes `expr_list' expressions in addition
7323 to `insn_list' expressions. There are several kinds of register notes,
7324 which are distinguished by the machine mode, which in a register note
7325 is really understood as being an `enum reg_note'. The first operand OP
7326 of the note is data whose meaning depends on the kind of note.
7328 The macro `REG_NOTE_KIND (X)' returns the kind of register note.
7329 Its counterpart, the macro `PUT_REG_NOTE_KIND (X, NEWKIND)' sets the
7330 register note type of X to be NEWKIND.
7332 Register notes are of three classes: They may say something about an
7333 input to an insn, they may say something about an output of an insn, or
7334 they may create a linkage between two insns. There are also a set of
7335 values that are only used in `LOG_LINKS'.
7337 These register notes annotate inputs to an insn:
7340 The value in OP dies in this insn; that is to say, altering the
7341 value immediately after this insn would not affect the future
7342 behavior of the program.
7344 It does not follow that the register OP has no useful value after
7345 this insn since OP is not necessarily modified by this insn.
7346 Rather, no subsequent instruction uses the contents of OP.
7349 The register OP being set by this insn will not be used in a
7350 subsequent insn. This differs from a `REG_DEAD' note, which
7351 indicates that the value in an input will not be used subsequently.
7352 These two notes are independent; both may be present for the same
7356 The register OP is incremented (or decremented; at this level
7357 there is no distinction) by an embedded side effect inside this
7358 insn. This means it appears in a `post_inc', `pre_inc',
7359 `post_dec' or `pre_dec' expression.
7362 The register OP is known to have a nonnegative value when this
7363 insn is reached. This is used so that decrement and branch until
7364 zero instructions, such as the m68k dbra, can be matched.
7366 The `REG_NONNEG' note is added to insns only if the machine
7367 description has a `decrement_and_branch_until_zero' pattern.
7370 This insn does not cause a conflict between OP and the item being
7371 set by this insn even though it might appear that it does. In
7372 other words, if the destination register and OP could otherwise be
7373 assigned the same register, this insn does not prevent that
7376 Insns with this note are usually part of a block that begins with a
7377 `clobber' insn specifying a multi-word pseudo register (which will
7378 be the output of the block), a group of insns that each set one
7379 word of the value and have the `REG_NO_CONFLICT' note attached,
7380 and a final insn that copies the output to itself with an attached
7381 `REG_EQUAL' note giving the expression being computed. This block
7382 is encapsulated with `REG_LIBCALL' and `REG_RETVAL' notes on the
7383 first and last insns, respectively.
7386 This insn uses OP, a `code_label' or a `note' of type
7387 `NOTE_INSN_DELETED_LABEL', but is not a `jump_insn', or it is a
7388 `jump_insn' that required the label to be held in a register. The
7389 presence of this note allows jump optimization to be aware that OP
7390 is, in fact, being used, and flow optimization to build an
7391 accurate flow graph.
7393 The following notes describe attributes of outputs of an insn:
7397 This note is only valid on an insn that sets only one register and
7398 indicates that that register will be equal to OP at run time; the
7399 scope of this equivalence differs between the two types of notes.
7400 The value which the insn explicitly copies into the register may
7401 look different from OP, but they will be equal at run time. If the
7402 output of the single `set' is a `strict_low_part' expression, the
7403 note refers to the register that is contained in `SUBREG_REG' of
7404 the `subreg' expression.
7406 For `REG_EQUIV', the register is equivalent to OP throughout the
7407 entire function, and could validly be replaced in all its
7408 occurrences by OP. ("Validly" here refers to the data flow of the
7409 program; simple replacement may make some insns invalid.) For
7410 example, when a constant is loaded into a register that is never
7411 assigned any other value, this kind of note is used.
7413 When a parameter is copied into a pseudo-register at entry to a
7414 function, a note of this kind records that the register is
7415 equivalent to the stack slot where the parameter was passed.
7416 Although in this case the register may be set by other insns, it
7417 is still valid to replace the register by the stack slot
7418 throughout the function.
7420 A `REG_EQUIV' note is also used on an instruction which copies a
7421 register parameter into a pseudo-register at entry to a function,
7422 if there is a stack slot where that parameter could be stored.
7423 Although other insns may set the pseudo-register, it is valid for
7424 the compiler to replace the pseudo-register by stack slot
7425 throughout the function, provided the compiler ensures that the
7426 stack slot is properly initialized by making the replacement in
7427 the initial copy instruction as well. This is used on machines
7428 for which the calling convention allocates stack space for
7429 register parameters. See `REG_PARM_STACK_SPACE' in *Note Stack
7432 In the case of `REG_EQUAL', the register that is set by this insn
7433 will be equal to OP at run time at the end of this insn but not
7434 necessarily elsewhere in the function. In this case, OP is
7435 typically an arithmetic expression. For example, when a sequence
7436 of insns such as a library call is used to perform an arithmetic
7437 operation, this kind of note is attached to the insn that produces
7438 or copies the final value.
7440 These two notes are used in different ways by the compiler passes.
7441 `REG_EQUAL' is used by passes prior to register allocation (such as
7442 common subexpression elimination and loop optimization) to tell
7443 them how to think of that value. `REG_EQUIV' notes are used by
7444 register allocation to indicate that there is an available
7445 substitute expression (either a constant or a `mem' expression for
7446 the location of a parameter on the stack) that may be used in
7447 place of a register if insufficient registers are available.
7449 Except for stack homes for parameters, which are indicated by a
7450 `REG_EQUIV' note and are not useful to the early optimization
7451 passes and pseudo registers that are equivalent to a memory
7452 location throughout their entire life, which is not detected until
7453 later in the compilation, all equivalences are initially indicated
7454 by an attached `REG_EQUAL' note. In the early stages of register
7455 allocation, a `REG_EQUAL' note is changed into a `REG_EQUIV' note
7456 if OP is a constant and the insn represents the only set of its
7457 destination register.
7459 Thus, compiler passes prior to register allocation need only check
7460 for `REG_EQUAL' notes and passes subsequent to register allocation
7461 need only check for `REG_EQUIV' notes.
7463 These notes describe linkages between insns. They occur in pairs:
7464 one insn has one of a pair of notes that points to a second insn, which
7465 has the inverse note pointing back to the first insn.
7468 This insn copies the value of a multi-insn sequence (for example, a
7469 library call), and OP is the first insn of the sequence (for a
7470 library call, the first insn that was generated to set up the
7471 arguments for the library call).
7473 Loop optimization uses this note to treat such a sequence as a
7474 single operation for code motion purposes and flow analysis uses
7475 this note to delete such sequences whose results are dead.
7477 A `REG_EQUAL' note will also usually be attached to this insn to
7478 provide the expression being computed by the sequence.
7480 These notes will be deleted after reload, since they are no longer
7484 This is the inverse of `REG_RETVAL': it is placed on the first
7485 insn of a multi-insn sequence, and it points to the last one.
7487 These notes are deleted after reload, since they are no longer
7492 On machines that use `cc0', the insns which set and use `cc0' set
7493 and use `cc0' are adjacent. However, when branch delay slot
7494 filling is done, this may no longer be true. In this case a
7495 `REG_CC_USER' note will be placed on the insn setting `cc0' to
7496 point to the insn using `cc0' and a `REG_CC_SETTER' note will be
7497 placed on the insn using `cc0' to point to the insn setting `cc0'.
7499 These values are only used in the `LOG_LINKS' field, and indicate
7500 the type of dependency that each link represents. Links which indicate
7501 a data dependence (a read after write dependence) do not use any code,
7502 they simply have mode `VOIDmode', and are printed without any
7506 This indicates an anti dependence (a write after read dependence).
7509 This indicates an output dependence (a write after write
7512 These notes describe information gathered from gcov profile data.
7513 They are stored in the `REG_NOTES' field of an insn as an `expr_list'.
7516 This is used to specify the ratio of branches to non-branches of a
7517 branch insn according to the profile data. The value is stored as
7518 a value between 0 and REG_BR_PROB_BASE; larger values indicate a
7519 higher probability that the branch will be taken.
7522 These notes are found in JUMP insns after delayed branch scheduling
7523 has taken place. They indicate both the direction and the
7524 likelihood of the JUMP. The format is a bitmask of ATTR_FLAG_*
7527 `REG_FRAME_RELATED_EXPR'
7528 This is used on an RTX_FRAME_RELATED_P insn wherein the attached
7529 expression is used in place of the actual insn pattern. This is
7530 done in cases where the pattern is either complex or misleading.
7532 For convenience, the machine mode in an `insn_list' or `expr_list'
7533 is printed using these symbolic codes in debugging dumps.
7535 The only difference between the expression codes `insn_list' and
7536 `expr_list' is that the first operand of an `insn_list' is assumed to
7537 be an insn and is printed in debugging dumps as the insn's unique id;
7538 the first operand of an `expr_list' is printed in the ordinary way as
7542 File: gccint.info, Node: Calls, Next: Sharing, Prev: Insns, Up: RTL
7544 RTL Representation of Function-Call Insns
7545 =========================================
7547 Insns that call subroutines have the RTL expression code `call_insn'.
7548 These insns must satisfy special rules, and their bodies must use a
7549 special RTL expression code, `call'.
7551 A `call' expression has two operands, as follows:
7553 (call (mem:FM ADDR) NBYTES)
7555 Here NBYTES is an operand that represents the number of bytes of
7556 argument data being passed to the subroutine, FM is a machine mode
7557 (which must equal as the definition of the `FUNCTION_MODE' macro in the
7558 machine description) and ADDR represents the address of the subroutine.
7560 For a subroutine that returns no value, the `call' expression as
7561 shown above is the entire body of the insn, except that the insn might
7562 also contain `use' or `clobber' expressions.
7564 For a subroutine that returns a value whose mode is not `BLKmode',
7565 the value is returned in a hard register. If this register's number is
7566 R, then the body of the call insn looks like this:
7569 (call (mem:FM ADDR) NBYTES))
7571 This RTL expression makes it clear (to the optimizer passes) that the
7572 appropriate register receives a useful value in this insn.
7574 When a subroutine returns a `BLKmode' value, it is handled by
7575 passing to the subroutine the address of a place to store the value.
7576 So the call insn itself does not "return" any value, and it has the
7577 same RTL form as a call that returns nothing.
7579 On some machines, the call instruction itself clobbers some register,
7580 for example to contain the return address. `call_insn' insns on these
7581 machines should have a body which is a `parallel' that contains both
7582 the `call' expression and `clobber' expressions that indicate which
7583 registers are destroyed. Similarly, if the call instruction requires
7584 some register other than the stack pointer that is not explicitly
7585 mentioned it its RTL, a `use' subexpression should mention that
7588 Functions that are called are assumed to modify all registers listed
7589 in the configuration macro `CALL_USED_REGISTERS' (*note Register
7590 Basics::) and, with the exception of `const' functions and library
7591 calls, to modify all of memory.
7593 Insns containing just `use' expressions directly precede the
7594 `call_insn' insn to indicate which registers contain inputs to the
7595 function. Similarly, if registers other than those in
7596 `CALL_USED_REGISTERS' are clobbered by the called function, insns
7597 containing a single `clobber' follow immediately after the call to
7598 indicate which registers.
7601 File: gccint.info, Node: Sharing, Next: Reading RTL, Prev: Calls, Up: RTL
7603 Structure Sharing Assumptions
7604 =============================
7606 The compiler assumes that certain kinds of RTL expressions are
7607 unique; there do not exist two distinct objects representing the same
7608 value. In other cases, it makes an opposite assumption: that no RTL
7609 expression object of a certain kind appears in more than one place in
7610 the containing structure.
7612 These assumptions refer to a single function; except for the RTL
7613 objects that describe global variables and external functions, and a
7614 few standard objects such as small integer constants, no RTL objects
7615 are common to two functions.
7617 * Each pseudo-register has only a single `reg' object to represent
7618 it, and therefore only a single machine mode.
7620 * For any symbolic label, there is only one `symbol_ref' object
7623 * All `const_int' expressions with equal values are shared.
7625 * There is only one `pc' expression.
7627 * There is only one `cc0' expression.
7629 * There is only one `const_double' expression with value 0 for each
7630 floating point mode. Likewise for values 1 and 2.
7632 * There is only one `const_vector' expression with value 0 for each
7633 vector mode, be it an integer or a double constant vector.
7635 * No `label_ref' or `scratch' appears in more than one place in the
7636 RTL structure; in other words, it is safe to do a tree-walk of all
7637 the insns in the function and assume that each time a `label_ref'
7638 or `scratch' is seen it is distinct from all others that are seen.
7640 * Only one `mem' object is normally created for each static variable
7641 or stack slot, so these objects are frequently shared in all the
7642 places they appear. However, separate but equal objects for these
7643 variables are occasionally made.
7645 * When a single `asm' statement has multiple output operands, a
7646 distinct `asm_operands' expression is made for each output operand.
7647 However, these all share the vector which contains the sequence of
7648 input operands. This sharing is used later on to test whether two
7649 `asm_operands' expressions come from the same statement, so all
7650 optimizations must carefully preserve the sharing if they copy the
7653 * No RTL object appears in more than one place in the RTL structure
7654 except as described above. Many passes of the compiler rely on
7655 this by assuming that they can modify RTL objects in place without
7656 unwanted side-effects on other insns.
7658 * During initial RTL generation, shared structure is freely
7659 introduced. After all the RTL for a function has been generated,
7660 all shared structure is copied by `unshare_all_rtl' in
7661 `emit-rtl.c', after which the above rules are guaranteed to be
7664 * During the combiner pass, shared structure within an insn can exist
7665 temporarily. However, the shared structure is copied before the
7666 combiner is finished with the insn. This is done by calling
7667 `copy_rtx_if_shared', which is a subroutine of `unshare_all_rtl'.
7670 File: gccint.info, Node: Reading RTL, Prev: Sharing, Up: RTL
7675 To read an RTL object from a file, call `read_rtx'. It takes one
7676 argument, a stdio stream, and returns a single RTL object. This routine
7677 is defined in `read-rtl.c'. It is not available in the compiler
7678 itself, only the various programs that generate the compiler back end
7679 from the machine description.
7681 People frequently have the idea of using RTL stored as text in a
7682 file as an interface between a language front end and the bulk of GCC.
7683 This idea is not feasible.
7685 GCC was designed to use RTL internally only. Correct RTL for a given
7686 program is very dependent on the particular target machine. And the RTL
7687 does not contain all the information about the program.
7689 The proper way to interface GCC to a new language front end is with
7690 the "tree" data structure, described in the files `tree.h' and
7691 `tree.def'. The documentation for this structure (*note Trees::) is
7695 File: gccint.info, Node: Machine Desc, Next: Target Macros, Prev: RTL, Up: Top
7697 Machine Descriptions
7698 ********************
7700 A machine description has two parts: a file of instruction patterns
7701 (`.md' file) and a C header file of macro definitions.
7703 The `.md' file for a target machine contains a pattern for each
7704 instruction that the target machine supports (or at least each
7705 instruction that is worth telling the compiler about). It may also
7706 contain comments. A semicolon causes the rest of the line to be a
7707 comment, unless the semicolon is inside a quoted string.
7709 See the next chapter for information on the C header file.
7713 * Overview:: How the machine description is used.
7714 * Patterns:: How to write instruction patterns.
7715 * Example:: An explained example of a `define_insn' pattern.
7716 * RTL Template:: The RTL template defines what insns match a pattern.
7717 * Output Template:: The output template says how to make assembler code
7719 * Output Statement:: For more generality, write C code to output
7721 * Constraints:: When not all operands are general operands.
7722 * Standard Names:: Names mark patterns to use for code generation.
7723 * Pattern Ordering:: When the order of patterns makes a difference.
7724 * Dependent Patterns:: Having one pattern may make you need another.
7725 * Jump Patterns:: Special considerations for patterns for jump insns.
7726 * Looping Patterns:: How to define patterns for special looping insns.
7727 * Insn Canonicalizations::Canonicalization of Instructions
7728 * Expander Definitions::Generating a sequence of several RTL insns
7729 for a standard operation.
7730 * Insn Splitting:: Splitting Instructions into Multiple Instructions.
7731 * Including Patterns:: Including Patterns in Machine Descriptions.
7732 * Peephole Definitions::Defining machine-specific peephole optimizations.
7733 * Insn Attributes:: Specifying the value of attributes for generated insns.
7734 * Conditional Execution::Generating `define_insn' patterns for
7736 * Constant Definitions::Defining symbolic constants that can be used in the
7740 File: gccint.info, Node: Overview, Next: Patterns, Up: Machine Desc
7742 Overview of How the Machine Description is Used
7743 ===============================================
7745 There are three main conversions that happen in the compiler:
7747 1. The front end reads the source code and builds a parse tree.
7749 2. The parse tree is used to generate an RTL insn list based on named
7750 instruction patterns.
7752 3. The insn list is matched against the RTL templates to produce
7756 For the generate pass, only the names of the insns matter, from
7757 either a named `define_insn' or a `define_expand'. The compiler will
7758 choose the pattern with the right name and apply the operands according
7759 to the documentation later in this chapter, without regard for the RTL
7760 template or operand constraints. Note that the names the compiler looks
7761 for are hard-coded in the compiler--it will ignore unnamed patterns and
7762 patterns with names it doesn't know about, but if you don't provide a
7763 named pattern it needs, it will abort.
7765 If a `define_insn' is used, the template given is inserted into the
7766 insn list. If a `define_expand' is used, one of three things happens,
7767 based on the condition logic. The condition logic may manually create
7768 new insns for the insn list, say via `emit_insn()', and invoke `DONE'.
7769 For certain named patterns, it may invoke `FAIL' to tell the compiler
7770 to use an alternate way of performing that task. If it invokes neither
7771 `DONE' nor `FAIL', the template given in the pattern is inserted, as if
7772 the `define_expand' were a `define_insn'.
7774 Once the insn list is generated, various optimization passes convert,
7775 replace, and rearrange the insns in the insn list. This is where the
7776 `define_split' and `define_peephole' patterns get used, for example.
7778 Finally, the insn list's RTL is matched up with the RTL templates in
7779 the `define_insn' patterns, and those patterns are used to emit the
7780 final assembly code. For this purpose, each named `define_insn' acts
7781 like it's unnamed, since the names are ignored.
7784 File: gccint.info, Node: Patterns, Next: Example, Prev: Overview, Up: Machine Desc
7786 Everything about Instruction Patterns
7787 =====================================
7789 Each instruction pattern contains an incomplete RTL expression, with
7790 pieces to be filled in later, operand constraints that restrict how the
7791 pieces can be filled in, and an output pattern or C code to generate
7792 the assembler output, all wrapped up in a `define_insn' expression.
7794 A `define_insn' is an RTL expression containing four or five
7797 1. An optional name. The presence of a name indicate that this
7798 instruction pattern can perform a certain standard job for the
7799 RTL-generation pass of the compiler. This pass knows certain
7800 names and will use the instruction patterns with those names, if
7801 the names are defined in the machine description.
7803 The absence of a name is indicated by writing an empty string
7804 where the name should go. Nameless instruction patterns are never
7805 used for generating RTL code, but they may permit several simpler
7806 insns to be combined later on.
7808 Names that are not thus known and used in RTL-generation have no
7809 effect; they are equivalent to no name at all.
7811 For the purpose of debugging the compiler, you may also specify a
7812 name beginning with the `*' character. Such a name is used only
7813 for identifying the instruction in RTL dumps; it is entirely
7814 equivalent to having a nameless pattern for all other purposes.
7816 2. The "RTL template" (*note RTL Template::) is a vector of incomplete
7817 RTL expressions which show what the instruction should look like.
7818 It is incomplete because it may contain `match_operand',
7819 `match_operator', and `match_dup' expressions that stand for
7820 operands of the instruction.
7822 If the vector has only one element, that element is the template
7823 for the instruction pattern. If the vector has multiple elements,
7824 then the instruction pattern is a `parallel' expression containing
7825 the elements described.
7827 3. A condition. This is a string which contains a C expression that
7828 is the final test to decide whether an insn body matches this
7831 For a named pattern, the condition (if present) may not depend on
7832 the data in the insn being matched, but only the
7833 target-machine-type flags. The compiler needs to test these
7834 conditions during initialization in order to learn exactly which
7835 named instructions are available in a particular run.
7837 For nameless patterns, the condition is applied only when matching
7838 an individual insn, and only after the insn has matched the
7839 pattern's recognition template. The insn's operands may be found
7840 in the vector `operands'. For an insn where the condition has
7841 once matched, it can't be used to control register allocation, for
7842 example by excluding certain hard registers or hard register
7845 4. The "output template": a string that says how to output matching
7846 insns as assembler code. `%' in this string specifies where to
7847 substitute the value of an operand. *Note Output Template::.
7849 When simple substitution isn't general enough, you can specify a
7850 piece of C code to compute the output. *Note Output Statement::.
7852 5. Optionally, a vector containing the values of attributes for insns
7853 matching this pattern. *Note Insn Attributes::.
7856 File: gccint.info, Node: Example, Next: RTL Template, Prev: Patterns, Up: Machine Desc
7858 Example of `define_insn'
7859 ========================
7861 Here is an actual example of an instruction pattern, for the
7864 (define_insn "tstsi"
7866 (match_operand:SI 0 "general_operand" "rm"))]
7870 if (TARGET_68020 || ! ADDRESS_REG_P (operands[0]))
7872 return \"cmpl #0,%0\";
7875 This can also be written using braced strings:
7877 (define_insn "tstsi"
7879 (match_operand:SI 0 "general_operand" "rm"))]
7882 if (TARGET_68020 || ! ADDRESS_REG_P (operands[0]))
7884 return "cmpl #0,%0";
7887 This is an instruction that sets the condition codes based on the
7888 value of a general operand. It has no condition, so any insn whose RTL
7889 description has the form shown may be handled according to this
7890 pattern. The name `tstsi' means "test a `SImode' value" and tells the
7891 RTL generation pass that, when it is necessary to test such a value, an
7892 insn to do so can be constructed using this pattern.
7894 The output control string is a piece of C code which chooses which
7895 output template to return based on the kind of operand and the specific
7896 type of CPU for which code is being generated.
7898 `"rm"' is an operand constraint. Its meaning is explained below.
7901 File: gccint.info, Node: RTL Template, Next: Output Template, Prev: Example, Up: Machine Desc
7906 The RTL template is used to define which insns match the particular
7907 pattern and how to find their operands. For named patterns, the RTL
7908 template also says how to construct an insn from specified operands.
7910 Construction involves substituting specified operands into a copy of
7911 the template. Matching involves determining the values that serve as
7912 the operands in the insn being matched. Both of these activities are
7913 controlled by special expression types that direct matching and
7914 substitution of the operands.
7916 `(match_operand:M N PREDICATE CONSTRAINT)'
7917 This expression is a placeholder for operand number N of the insn.
7918 When constructing an insn, operand number N will be substituted
7919 at this point. When matching an insn, whatever appears at this
7920 position in the insn will be taken as operand number N; but it
7921 must satisfy PREDICATE or this instruction pattern will not match
7924 Operand numbers must be chosen consecutively counting from zero in
7925 each instruction pattern. There may be only one `match_operand'
7926 expression in the pattern for each operand number. Usually
7927 operands are numbered in the order of appearance in `match_operand'
7928 expressions. In the case of a `define_expand', any operand numbers
7929 used only in `match_dup' expressions have higher values than all
7930 other operand numbers.
7932 PREDICATE is a string that is the name of a C function that
7933 accepts two arguments, an expression and a machine mode. During
7934 matching, the function will be called with the putative operand as
7935 the expression and M as the mode argument (if M is not specified,
7936 `VOIDmode' will be used, which normally causes PREDICATE to accept
7937 any mode). If it returns zero, this instruction pattern fails to
7938 match. PREDICATE may be an empty string; then it means no test is
7939 to be done on the operand, so anything which occurs in this
7942 Most of the time, PREDICATE will reject modes other than M--but
7943 not always. For example, the predicate `address_operand' uses M
7944 as the mode of memory ref that the address should be valid for.
7945 Many predicates accept `const_int' nodes even though their mode is
7948 CONSTRAINT controls reloading and the choice of the best register
7949 class to use for a value, as explained later (*note Constraints::).
7951 People are often unclear on the difference between the constraint
7952 and the predicate. The predicate helps decide whether a given
7953 insn matches the pattern. The constraint plays no role in this
7954 decision; instead, it controls various decisions in the case of an
7955 insn which does match.
7957 On CISC machines, the most common PREDICATE is
7958 `"general_operand"'. This function checks that the putative
7959 operand is either a constant, a register or a memory reference,
7960 and that it is valid for mode M.
7962 For an operand that must be a register, PREDICATE should be
7963 `"register_operand"'. Using `"general_operand"' would be valid,
7964 since the reload pass would copy any non-register operands through
7965 registers, but this would make GCC do extra work, it would prevent
7966 invariant operands (such as constant) from being removed from
7967 loops, and it would prevent the register allocator from doing the
7968 best possible job. On RISC machines, it is usually most efficient
7969 to allow PREDICATE to accept only objects that the constraints
7972 For an operand that must be a constant, you must be sure to either
7973 use `"immediate_operand"' for PREDICATE, or make the instruction
7974 pattern's extra condition require a constant, or both. You cannot
7975 expect the constraints to do this work! If the constraints allow
7976 only constants, but the predicate allows something else, the
7977 compiler will crash when that case arises.
7979 `(match_scratch:M N CONSTRAINT)'
7980 This expression is also a placeholder for operand number N and
7981 indicates that operand must be a `scratch' or `reg' expression.
7983 When matching patterns, this is equivalent to
7985 (match_operand:M N "scratch_operand" PRED)
7987 but, when generating RTL, it produces a (`scratch':M) expression.
7989 If the last few expressions in a `parallel' are `clobber'
7990 expressions whose operands are either a hard register or
7991 `match_scratch', the combiner can add or delete them when
7992 necessary. *Note Side Effects::.
7995 This expression is also a placeholder for operand number N. It is
7996 used when the operand needs to appear more than once in the insn.
7998 In construction, `match_dup' acts just like `match_operand': the
7999 operand is substituted into the insn being constructed. But in
8000 matching, `match_dup' behaves differently. It assumes that operand
8001 number N has already been determined by a `match_operand'
8002 appearing earlier in the recognition template, and it matches only
8003 an identical-looking expression.
8005 Note that `match_dup' should not be used to tell the compiler that
8006 a particular register is being used for two operands (example:
8007 `add' that adds one register to another; the second register is
8008 both an input operand and the output operand). Use a matching
8009 constraint (*note Simple Constraints::) for those. `match_dup' is
8010 for the cases where one operand is used in two places in the
8011 template, such as an instruction that computes both a quotient and
8012 a remainder, where the opcode takes two input operands but the RTL
8013 template has to refer to each of those twice; once for the
8014 quotient pattern and once for the remainder pattern.
8016 `(match_operator:M N PREDICATE [OPERANDS...])'
8017 This pattern is a kind of placeholder for a variable RTL expression
8020 When constructing an insn, it stands for an RTL expression whose
8021 expression code is taken from that of operand N, and whose
8022 operands are constructed from the patterns OPERANDS.
8024 When matching an expression, it matches an expression if the
8025 function PREDICATE returns nonzero on that expression _and_ the
8026 patterns OPERANDS match the operands of the expression.
8028 Suppose that the function `commutative_operator' is defined as
8029 follows, to match any expression whose operator is one of the
8030 commutative arithmetic operators of RTL and whose mode is MODE:
8033 commutative_operator (x, mode)
8035 enum machine_mode mode;
8037 enum rtx_code code = GET_CODE (x);
8038 if (GET_MODE (x) != mode)
8040 return (GET_RTX_CLASS (code) == 'c'
8041 || code == EQ || code == NE);
8044 Then the following pattern will match any RTL expression consisting
8045 of a commutative operator applied to two general operands:
8047 (match_operator:SI 3 "commutative_operator"
8048 [(match_operand:SI 1 "general_operand" "g")
8049 (match_operand:SI 2 "general_operand" "g")])
8051 Here the vector `[OPERANDS...]' contains two patterns because the
8052 expressions to be matched all contain two operands.
8054 When this pattern does match, the two operands of the commutative
8055 operator are recorded as operands 1 and 2 of the insn. (This is
8056 done by the two instances of `match_operand'.) Operand 3 of the
8057 insn will be the entire commutative expression: use `GET_CODE
8058 (operands[3])' to see which commutative operator was used.
8060 The machine mode M of `match_operator' works like that of
8061 `match_operand': it is passed as the second argument to the
8062 predicate function, and that function is solely responsible for
8063 deciding whether the expression to be matched "has" that mode.
8065 When constructing an insn, argument 3 of the gen-function will
8066 specify the operation (i.e. the expression code) for the
8067 expression to be made. It should be an RTL expression, whose
8068 expression code is copied into a new expression whose operands are
8069 arguments 1 and 2 of the gen-function. The subexpressions of
8070 argument 3 are not used; only its expression code matters.
8072 When `match_operator' is used in a pattern for matching an insn,
8073 it usually best if the operand number of the `match_operator' is
8074 higher than that of the actual operands of the insn. This improves
8075 register allocation because the register allocator often looks at
8076 operands 1 and 2 of insns to see if it can do register tying.
8078 There is no way to specify constraints in `match_operator'. The
8079 operand of the insn which corresponds to the `match_operator'
8080 never has any constraints because it is never reloaded as a whole.
8081 However, if parts of its OPERANDS are matched by `match_operand'
8082 patterns, those parts may have constraints of their own.
8084 `(match_op_dup:M N[OPERANDS...])'
8085 Like `match_dup', except that it applies to operators instead of
8086 operands. When constructing an insn, operand number N will be
8087 substituted at this point. But in matching, `match_op_dup' behaves
8088 differently. It assumes that operand number N has already been
8089 determined by a `match_operator' appearing earlier in the
8090 recognition template, and it matches only an identical-looking
8093 `(match_parallel N PREDICATE [SUBPAT...])'
8094 This pattern is a placeholder for an insn that consists of a
8095 `parallel' expression with a variable number of elements. This
8096 expression should only appear at the top level of an insn pattern.
8098 When constructing an insn, operand number N will be substituted at
8099 this point. When matching an insn, it matches if the body of the
8100 insn is a `parallel' expression with at least as many elements as
8101 the vector of SUBPAT expressions in the `match_parallel', if each
8102 SUBPAT matches the corresponding element of the `parallel', _and_
8103 the function PREDICATE returns nonzero on the `parallel' that is
8104 the body of the insn. It is the responsibility of the predicate
8105 to validate elements of the `parallel' beyond those listed in the
8108 A typical use of `match_parallel' is to match load and store
8109 multiple expressions, which can contain a variable number of
8110 elements in a `parallel'. For example,
8113 [(match_parallel 0 "load_multiple_operation"
8114 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
8115 (match_operand:SI 2 "memory_operand" "m"))
8117 (clobber (reg:SI 179))])]
8121 This example comes from `a29k.md'. The function
8122 `load_multiple_operation' is defined in `a29k.c' and checks that
8123 subsequent elements in the `parallel' are the same as the `set' in
8124 the pattern, except that they are referencing subsequent registers
8125 and memory locations.
8127 An insn that matches this pattern might look like:
8130 [(set (reg:SI 20) (mem:SI (reg:SI 100)))
8132 (clobber (reg:SI 179))
8134 (mem:SI (plus:SI (reg:SI 100)
8137 (mem:SI (plus:SI (reg:SI 100)
8140 `(match_par_dup N [SUBPAT...])'
8141 Like `match_op_dup', but for `match_parallel' instead of
8144 `(match_insn PREDICATE)'
8145 Match a complete insn. Unlike the other `match_*' recognizers,
8146 `match_insn' does not take an operand number.
8148 The machine mode M of `match_insn' works like that of
8149 `match_operand': it is passed as the second argument to the
8150 predicate function, and that function is solely responsible for
8151 deciding whether the expression to be matched "has" that mode.
8153 `(match_insn2 N PREDICATE)'
8154 Match a complete insn.
8156 The machine mode M of `match_insn2' works like that of
8157 `match_operand': it is passed as the second argument to the
8158 predicate function, and that function is solely responsible for
8159 deciding whether the expression to be matched "has" that mode.
8162 File: gccint.info, Node: Output Template, Next: Output Statement, Prev: RTL Template, Up: Machine Desc
8164 Output Templates and Operand Substitution
8165 =========================================
8167 The "output template" is a string which specifies how to output the
8168 assembler code for an instruction pattern. Most of the template is a
8169 fixed string which is output literally. The character `%' is used to
8170 specify where to substitute an operand; it can also be used to identify
8171 places where different variants of the assembler require different
8174 In the simplest case, a `%' followed by a digit N says to output
8175 operand N at that point in the string.
8177 `%' followed by a letter and a digit says to output an operand in an
8178 alternate fashion. Four letters have standard, built-in meanings
8179 described below. The machine description macro `PRINT_OPERAND' can
8180 define additional letters with nonstandard meanings.
8182 `%cDIGIT' can be used to substitute an operand that is a constant
8183 value without the syntax that normally indicates an immediate operand.
8185 `%nDIGIT' is like `%cDIGIT' except that the value of the constant is
8186 negated before printing.
8188 `%aDIGIT' can be used to substitute an operand as if it were a
8189 memory reference, with the actual operand treated as the address. This
8190 may be useful when outputting a "load address" instruction, because
8191 often the assembler syntax for such an instruction requires you to
8192 write the operand as if it were a memory reference.
8194 `%lDIGIT' is used to substitute a `label_ref' into a jump
8197 `%=' outputs a number which is unique to each instruction in the
8198 entire compilation. This is useful for making local labels to be
8199 referred to more than once in a single template that generates multiple
8200 assembler instructions.
8202 `%' followed by a punctuation character specifies a substitution that
8203 does not use an operand. Only one case is standard: `%%' outputs a `%'
8204 into the assembler code. Other nonstandard cases can be defined in the
8205 `PRINT_OPERAND' macro. You must also define which punctuation
8206 characters are valid with the `PRINT_OPERAND_PUNCT_VALID_P' macro.
8208 The template may generate multiple assembler instructions. Write
8209 the text for the instructions, with `\;' between them.
8211 When the RTL contains two operands which are required by constraint
8212 to match each other, the output template must refer only to the
8213 lower-numbered operand. Matching operands are not always identical,
8214 and the rest of the compiler arranges to put the proper RTL expression
8215 for printing into the lower-numbered operand.
8217 One use of nonstandard letters or punctuation following `%' is to
8218 distinguish between different assembler languages for the same machine;
8219 for example, Motorola syntax versus MIT syntax for the 68000. Motorola
8220 syntax requires periods in most opcode names, while MIT syntax does
8221 not. For example, the opcode `movel' in MIT syntax is `move.l' in
8222 Motorola syntax. The same file of patterns is used for both kinds of
8223 output syntax, but the character sequence `%.' is used in each place
8224 where Motorola syntax wants a period. The `PRINT_OPERAND' macro for
8225 Motorola syntax defines the sequence to output a period; the macro for
8226 MIT syntax defines it to do nothing.
8228 As a special case, a template consisting of the single character `#'
8229 instructs the compiler to first split the insn, and then output the
8230 resulting instructions separately. This helps eliminate redundancy in
8231 the output templates. If you have a `define_insn' that needs to emit
8232 multiple assembler instructions, and there is an matching `define_split'
8233 already defined, then you can simply use `#' as the output template
8234 instead of writing an output template that emits the multiple assembler
8237 If the macro `ASSEMBLER_DIALECT' is defined, you can use construct
8238 of the form `{option0|option1|option2}' in the templates. These
8239 describe multiple variants of assembler language syntax. *Note
8240 Instruction Output::.
8243 File: gccint.info, Node: Output Statement, Next: Constraints, Prev: Output Template, Up: Machine Desc
8245 C Statements for Assembler Output
8246 =================================
8248 Often a single fixed template string cannot produce correct and
8249 efficient assembler code for all the cases that are recognized by a
8250 single instruction pattern. For example, the opcodes may depend on the
8251 kinds of operands; or some unfortunate combinations of operands may
8252 require extra machine instructions.
8254 If the output control string starts with a `@', then it is actually
8255 a series of templates, each on a separate line. (Blank lines and
8256 leading spaces and tabs are ignored.) The templates correspond to the
8257 pattern's constraint alternatives (*note Multi-Alternative::). For
8258 example, if a target machine has a two-address add instruction `addr'
8259 to add into a register and another `addm' to add a register to memory,
8260 you might write this pattern:
8262 (define_insn "addsi3"
8263 [(set (match_operand:SI 0 "general_operand" "=r,m")
8264 (plus:SI (match_operand:SI 1 "general_operand" "0,0")
8265 (match_operand:SI 2 "general_operand" "g,r")))]
8271 If the output control string starts with a `*', then it is not an
8272 output template but rather a piece of C program that should compute a
8273 template. It should execute a `return' statement to return the
8274 template-string you want. Most such templates use C string literals,
8275 which require doublequote characters to delimit them. To include these
8276 doublequote characters in the string, prefix each one with `\'.
8278 If the output control string is written as a brace block instead of a
8279 double-quoted string, it is automatically assumed to be C code. In that
8280 case, it is not necessary to put in a leading asterisk, or to escape the
8281 doublequotes surrounding C string literals.
8283 The operands may be found in the array `operands', whose C data type
8286 It is very common to select different ways of generating assembler
8287 code based on whether an immediate operand is within a certain range.
8288 Be careful when doing this, because the result of `INTVAL' is an
8289 integer on the host machine. If the host machine has more bits in an
8290 `int' than the target machine has in the mode in which the constant
8291 will be used, then some of the bits you get from `INTVAL' will be
8292 superfluous. For proper results, you must carefully disregard the
8293 values of those bits.
8295 It is possible to output an assembler instruction and then go on to
8296 output or compute more of them, using the subroutine `output_asm_insn'.
8297 This receives two arguments: a template-string and a vector of
8298 operands. The vector may be `operands', or it may be another array of
8299 `rtx' that you declare locally and initialize yourself.
8301 When an insn pattern has multiple alternatives in its constraints,
8302 often the appearance of the assembler code is determined mostly by
8303 which alternative was matched. When this is so, the C code can test
8304 the variable `which_alternative', which is the ordinal number of the
8305 alternative that was actually satisfied (0 for the first, 1 for the
8306 second alternative, etc.).
8308 For example, suppose there are two opcodes for storing zero, `clrreg'
8309 for registers and `clrmem' for memory locations. Here is how a pattern
8310 could use `which_alternative' to choose between them:
8313 [(set (match_operand:SI 0 "general_operand" "=r,m")
8317 return (which_alternative == 0
8318 ? "clrreg %0" : "clrmem %0");
8321 The example above, where the assembler code to generate was _solely_
8322 determined by the alternative, could also have been specified as
8323 follows, having the output control string start with a `@':
8326 [(set (match_operand:SI 0 "general_operand" "=r,m")
8334 File: gccint.info, Node: Constraints, Next: Standard Names, Prev: Output Statement, Up: Machine Desc
8339 Each `match_operand' in an instruction pattern can specify a
8340 constraint for the type of operands allowed. Constraints can say
8341 whether an operand may be in a register, and which kinds of register;
8342 whether the operand can be a memory reference, and which kinds of
8343 address; whether the operand may be an immediate constant, and which
8344 possible values it may have. Constraints can also require two operands
8349 * Simple Constraints:: Basic use of constraints.
8350 * Multi-Alternative:: When an insn has two alternative constraint-patterns.
8351 * Class Preferences:: Constraints guide which hard register to put things in.
8352 * Modifiers:: More precise control over effects of constraints.
8353 * Machine Constraints:: Existing constraints for some particular machines.
8356 File: gccint.info, Node: Simple Constraints, Next: Multi-Alternative, Up: Constraints
8361 The simplest kind of constraint is a string full of letters, each of
8362 which describes one kind of operand that is permitted. Here are the
8363 letters that are allowed:
8366 Whitespace characters are ignored and can be inserted at any
8367 position except the first. This enables each alternative for
8368 different operands to be visually aligned in the machine
8369 description even if they have different number of constraints and
8373 A memory operand is allowed, with any kind of address that the
8374 machine supports in general.
8377 A memory operand is allowed, but only if the address is
8378 "offsettable". This means that adding a small integer (actually,
8379 the width in bytes of the operand, as determined by its machine
8380 mode) may be added to the address and the result is also a valid
8383 For example, an address which is constant is offsettable; so is an
8384 address that is the sum of a register and a constant (as long as a
8385 slightly larger constant is also within the range of
8386 address-offsets supported by the machine); but an autoincrement or
8387 autodecrement address is not offsettable. More complicated
8388 indirect/indexed addresses may or may not be offsettable depending
8389 on the other addressing modes that the machine supports.
8391 Note that in an output operand which can be matched by another
8392 operand, the constraint letter `o' is valid only when accompanied
8393 by both `<' (if the target machine has predecrement addressing)
8394 and `>' (if the target machine has preincrement addressing).
8397 A memory operand that is not offsettable. In other words,
8398 anything that would fit the `m' constraint but not the `o'
8402 A memory operand with autodecrement addressing (either
8403 predecrement or postdecrement) is allowed.
8406 A memory operand with autoincrement addressing (either
8407 preincrement or postincrement) is allowed.
8410 A register operand is allowed provided that it is in a general
8414 An immediate integer operand (one with constant value) is allowed.
8415 This includes symbolic constants whose values will be known only at
8419 An immediate integer operand with a known numeric value is allowed.
8420 Many systems cannot support assembly-time constants for operands
8421 less than a word wide. Constraints for these operands should use
8422 `n' rather than `i'.
8424 `I', `J', `K', ... `P'
8425 Other letters in the range `I' through `P' may be defined in a
8426 machine-dependent fashion to permit immediate integer operands with
8427 explicit integer values in specified ranges. For example, on the
8428 68000, `I' is defined to stand for the range of values 1 to 8.
8429 This is the range permitted as a shift count in the shift
8433 An immediate floating operand (expression code `const_double') is
8434 allowed, but only if the target floating point format is the same
8435 as that of the host machine (on which the compiler is running).
8438 An immediate floating operand (expression code `const_double' or
8439 `const_vector') is allowed.
8442 `G' and `H' may be defined in a machine-dependent fashion to
8443 permit immediate floating operands in particular ranges of values.
8446 An immediate integer operand whose value is not an explicit
8449 This might appear strange; if an insn allows a constant operand
8450 with a value not known at compile time, it certainly must allow
8451 any known value. So why use `s' instead of `i'? Sometimes it
8452 allows better code to be generated.
8454 For example, on the 68000 in a fullword instruction it is possible
8455 to use an immediate operand; but if the immediate value is between
8456 -128 and 127, better code results from loading the value into a
8457 register and using the register. This is because the load into
8458 the register can be done with a `moveq' instruction. We arrange
8459 for this to happen by defining the letter `K' to mean "any integer
8460 outside the range -128 to 127", and then specifying `Ks' in the
8461 operand constraints.
8464 Any register, memory or immediate integer operand is allowed,
8465 except for registers that are not general registers.
8468 Any operand whatsoever is allowed, even if it does not satisfy
8469 `general_operand'. This is normally used in the constraint of a
8470 `match_scratch' when certain alternatives will not actually
8471 require a scratch register.
8473 `0', `1', `2', ... `9'
8474 An operand that matches the specified operand number is allowed.
8475 If a digit is used together with letters within the same
8476 alternative, the digit should come last.
8478 This number is allowed to be more than a single digit. If multiple
8479 digits are encountered consecutively, they are interpreted as a
8480 single decimal integer. There is scant chance for ambiguity,
8481 since to-date it has never been desirable that `10' be interpreted
8482 as matching either operand 1 _or_ operand 0. Should this be
8483 desired, one can use multiple alternatives instead.
8485 This is called a "matching constraint" and what it really means is
8486 that the assembler has only a single operand that fills two roles
8487 considered separate in the RTL insn. For example, an add insn has
8488 two input operands and one output operand in the RTL, but on most
8489 CISC machines an add instruction really has only two operands, one
8490 of them an input-output operand:
8494 Matching constraints are used in these circumstances. More
8495 precisely, the two operands that match must include one input-only
8496 operand and one output-only operand. Moreover, the digit must be a
8497 smaller number than the number of the operand that uses it in the
8500 For operands to match in a particular case usually means that they
8501 are identical-looking RTL expressions. But in a few special cases
8502 specific kinds of dissimilarity are allowed. For example, `*x' as
8503 an input operand will match `*x++' as an output operand. For
8504 proper results in such cases, the output template should always
8505 use the output-operand's number when printing the operand.
8508 An operand that is a valid memory address is allowed. This is for
8509 "load address" and "push address" instructions.
8511 `p' in the constraint must be accompanied by `address_operand' as
8512 the predicate in the `match_operand'. This predicate interprets
8513 the mode specified in the `match_operand' as the mode of the memory
8514 reference for which the address would be valid.
8517 Other letters can be defined in machine-dependent fashion to stand
8518 for particular classes of registers or other arbitrary operand
8519 types. `d', `a' and `f' are defined on the 68000/68020 to stand
8520 for data, address and floating point registers.
8522 The machine description macro `REG_CLASS_FROM_LETTER' has first
8523 cut at the otherwise unused letters. If it evaluates to `NO_REGS',
8524 then `EXTRA_CONSTRAINT' is evaluated.
8526 A typical use for `EXTRA_CONSTRAINT' would be to distinguish
8527 certain types of memory references that affect other insn operands.
8529 In order to have valid assembler code, each operand must satisfy its
8530 constraint. But a failure to do so does not prevent the pattern from
8531 applying to an insn. Instead, it directs the compiler to modify the
8532 code so that the constraint will be satisfied. Usually this is done by
8533 copying an operand into a register.
8535 Contrast, therefore, the two instruction patterns that follow:
8538 [(set (match_operand:SI 0 "general_operand" "=r")
8539 (plus:SI (match_dup 0)
8540 (match_operand:SI 1 "general_operand" "r")))]
8544 which has two operands, one of which must appear in two places, and
8547 [(set (match_operand:SI 0 "general_operand" "=r")
8548 (plus:SI (match_operand:SI 1 "general_operand" "0")
8549 (match_operand:SI 2 "general_operand" "r")))]
8553 which has three operands, two of which are required by a constraint to
8554 be identical. If we are considering an insn of the form
8558 (plus:SI (reg:SI 6) (reg:SI 109)))
8561 the first pattern would not apply at all, because this insn does not
8562 contain two identical subexpressions in the right place. The pattern
8563 would say, "That does not look like an add instruction; try other
8564 patterns." The second pattern would say, "Yes, that's an add
8565 instruction, but there is something wrong with it." It would direct
8566 the reload pass of the compiler to generate additional insns to make
8567 the constraint true. The results might look like this:
8570 (set (reg:SI 3) (reg:SI 6))
8575 (plus:SI (reg:SI 3) (reg:SI 109)))
8578 It is up to you to make sure that each operand, in each pattern, has
8579 constraints that can handle any RTL expression that could be present for
8580 that operand. (When multiple alternatives are in use, each pattern
8581 must, for each possible combination of operand expressions, have at
8582 least one alternative which can handle that combination of operands.)
8583 The constraints don't need to _allow_ any possible operand--when this is
8584 the case, they do not constrain--but they must at least point the way to
8585 reloading any possible operand so that it will fit.
8587 * If the constraint accepts whatever operands the predicate permits,
8588 there is no problem: reloading is never necessary for this operand.
8590 For example, an operand whose constraints permit everything except
8591 registers is safe provided its predicate rejects registers.
8593 An operand whose predicate accepts only constant values is safe
8594 provided its constraints include the letter `i'. If any possible
8595 constant value is accepted, then nothing less than `i' will do; if
8596 the predicate is more selective, then the constraints may also be
8599 * Any operand expression can be reloaded by copying it into a
8600 register. So if an operand's constraints allow some kind of
8601 register, it is certain to be safe. It need not permit all
8602 classes of registers; the compiler knows how to copy a register
8603 into another register of the proper class in order to make an
8606 * A nonoffsettable memory reference can be reloaded by copying the
8607 address into a register. So if the constraint uses the letter
8608 `o', all memory references are taken care of.
8610 * A constant operand can be reloaded by allocating space in memory to
8611 hold it as preinitialized data. Then the memory reference can be
8612 used in place of the constant. So if the constraint uses the
8613 letters `o' or `m', constant operands are not a problem.
8615 * If the constraint permits a constant and a pseudo register used in
8616 an insn was not allocated to a hard register and is equivalent to
8617 a constant, the register will be replaced with the constant. If
8618 the predicate does not permit a constant and the insn is
8619 re-recognized for some reason, the compiler will crash. Thus the
8620 predicate must always recognize any objects allowed by the
8623 If the operand's predicate can recognize registers, but the
8624 constraint does not permit them, it can make the compiler crash. When
8625 this operand happens to be a register, the reload pass will be stymied,
8626 because it does not know how to copy a register temporarily into memory.
8628 If the predicate accepts a unary operator, the constraint applies to
8629 the operand. For example, the MIPS processor at ISA level 3 supports an
8630 instruction which adds two registers in `SImode' to produce a `DImode'
8631 result, but only if the registers are correctly sign extended. This
8632 predicate for the input operands accepts a `sign_extend' of an `SImode'
8633 register. Write the constraint to indicate the type of register that
8634 is required for the operand of the `sign_extend'.
8637 File: gccint.info, Node: Multi-Alternative, Next: Class Preferences, Prev: Simple Constraints, Up: Constraints
8639 Multiple Alternative Constraints
8640 --------------------------------
8642 Sometimes a single instruction has multiple alternative sets of
8643 possible operands. For example, on the 68000, a logical-or instruction
8644 can combine register or an immediate value into memory, or it can
8645 combine any kind of operand into a register; but it cannot combine one
8646 memory location into another.
8648 These constraints are represented as multiple alternatives. An
8649 alternative can be described by a series of letters for each operand.
8650 The overall constraint for an operand is made from the letters for this
8651 operand from the first alternative, a comma, the letters for this
8652 operand from the second alternative, a comma, and so on until the last
8653 alternative. Here is how it is done for fullword logical-or on the
8656 (define_insn "iorsi3"
8657 [(set (match_operand:SI 0 "general_operand" "=m,d")
8658 (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
8659 (match_operand:SI 2 "general_operand" "dKs,dmKs")))]
8662 The first alternative has `m' (memory) for operand 0, `0' for
8663 operand 1 (meaning it must match operand 0), and `dKs' for operand 2.
8664 The second alternative has `d' (data register) for operand 0, `0' for
8665 operand 1, and `dmKs' for operand 2. The `=' and `%' in the
8666 constraints apply to all the alternatives; their meaning is explained
8667 in the next section (*note Class Preferences::).
8669 If all the operands fit any one alternative, the instruction is
8670 valid. Otherwise, for each alternative, the compiler counts how many
8671 instructions must be added to copy the operands so that that
8672 alternative applies. The alternative requiring the least copying is
8673 chosen. If two alternatives need the same amount of copying, the one
8674 that comes first is chosen. These choices can be altered with the `?'
8678 Disparage slightly the alternative that the `?' appears in, as a
8679 choice when no alternative applies exactly. The compiler regards
8680 this alternative as one unit more costly for each `?' that appears
8684 Disparage severely the alternative that the `!' appears in. This
8685 alternative can still be used if it fits without reloading, but if
8686 reloading is needed, some other alternative will be used.
8688 When an insn pattern has multiple alternatives in its constraints,
8689 often the appearance of the assembler code is determined mostly by which
8690 alternative was matched. When this is so, the C code for writing the
8691 assembler code can use the variable `which_alternative', which is the
8692 ordinal number of the alternative that was actually satisfied (0 for
8693 the first, 1 for the second alternative, etc.). *Note Output
8697 File: gccint.info, Node: Class Preferences, Next: Modifiers, Prev: Multi-Alternative, Up: Constraints
8699 Register Class Preferences
8700 --------------------------
8702 The operand constraints have another function: they enable the
8703 compiler to decide which kind of hardware register a pseudo register is
8704 best allocated to. The compiler examines the constraints that apply to
8705 the insns that use the pseudo register, looking for the
8706 machine-dependent letters such as `d' and `a' that specify classes of
8707 registers. The pseudo register is put in whichever class gets the most
8708 "votes". The constraint letters `g' and `r' also vote: they vote in
8709 favor of a general register. The machine description says which
8710 registers are considered general.
8712 Of course, on some machines all registers are equivalent, and no
8713 register classes are defined. Then none of this complexity is relevant.
8716 File: gccint.info, Node: Modifiers, Next: Machine Constraints, Prev: Class Preferences, Up: Constraints
8718 Constraint Modifier Characters
8719 ------------------------------
8721 Here are constraint modifier characters.
8724 Means that this operand is write-only for this instruction: the
8725 previous value is discarded and replaced by output data.
8728 Means that this operand is both read and written by the
8731 When the compiler fixes up the operands to satisfy the constraints,
8732 it needs to know which operands are inputs to the instruction and
8733 which are outputs from it. `=' identifies an output; `+'
8734 identifies an operand that is both input and output; all other
8735 operands are assumed to be input only.
8737 If you specify `=' or `+' in a constraint, you put it in the first
8738 character of the constraint string.
8741 Means (in a particular alternative) that this operand is an
8742 "earlyclobber" operand, which is modified before the instruction is
8743 finished using the input operands. Therefore, this operand may
8744 not lie in a register that is used as an input operand or as part
8745 of any memory address.
8747 `&' applies only to the alternative in which it is written. In
8748 constraints with multiple alternatives, sometimes one alternative
8749 requires `&' while others do not. See, for example, the `movdf'
8752 An input operand can be tied to an earlyclobber operand if its only
8753 use as an input occurs before the early result is written. Adding
8754 alternatives of this form often allows GCC to produce better code
8755 when only some of the inputs can be affected by the earlyclobber.
8756 See, for example, the `mulsi3' insn of the ARM.
8758 `&' does not obviate the need to write `='.
8761 Declares the instruction to be commutative for this operand and the
8762 following operand. This means that the compiler may interchange
8763 the two operands if that is the cheapest way to make all operands
8764 fit the constraints. This is often used in patterns for addition
8765 instructions that really have only two operands: the result must
8766 go in one of the arguments. Here for example, is how the 68000
8767 halfword-add instruction is defined:
8769 (define_insn "addhi3"
8770 [(set (match_operand:HI 0 "general_operand" "=m,r")
8771 (plus:HI (match_operand:HI 1 "general_operand" "%0,0")
8772 (match_operand:HI 2 "general_operand" "di,g")))]
8774 GCC can only handle one commutative pair in an asm; if you use
8775 more, the compiler may fail.
8778 Says that all following characters, up to the next comma, are to be
8779 ignored as a constraint. They are significant only for choosing
8780 register preferences.
8783 Says that the following character should be ignored when choosing
8784 register preferences. `*' has no effect on the meaning of the
8785 constraint as a constraint, and no effect on reloading.
8787 Here is an example: the 68000 has an instruction to sign-extend a
8788 halfword in a data register, and can also sign-extend a value by
8789 copying it into an address register. While either kind of
8790 register is acceptable, the constraints on an address-register
8791 destination are less strict, so it is best if register allocation
8792 makes an address register its goal. Therefore, `*' is used so
8793 that the `d' constraint letter (for data register) is ignored when
8794 computing register preferences.
8796 (define_insn "extendhisi2"
8797 [(set (match_operand:SI 0 "general_operand" "=*d,a")
8799 (match_operand:HI 1 "general_operand" "0,g")))]
8803 File: gccint.info, Node: Machine Constraints, Prev: Modifiers, Up: Constraints
8805 Constraints for Particular Machines
8806 -----------------------------------
8808 Whenever possible, you should use the general-purpose constraint
8809 letters in `asm' arguments, since they will convey meaning more readily
8810 to people reading your code. Failing that, use the constraint letters
8811 that usually have very similar meanings across architectures. The most
8812 commonly used constraints are `m' and `r' (for memory and
8813 general-purpose registers respectively; *note Simple Constraints::), and
8814 `I', usually the letter indicating the most common immediate-constant
8817 For each machine architecture, the `config/MACHINE/MACHINE.h' file
8818 defines additional constraints. These constraints are used by the
8819 compiler itself for instruction generation, as well as for `asm'
8820 statements; therefore, some of the constraints are not particularly
8821 interesting for `asm'. The constraints are defined through these
8824 `REG_CLASS_FROM_LETTER'
8825 Register class constraints (usually lowercase).
8827 `CONST_OK_FOR_LETTER_P'
8828 Immediate constant constraints, for non-floating point constants of
8829 word size or smaller precision (usually uppercase).
8831 `CONST_DOUBLE_OK_FOR_LETTER_P'
8832 Immediate constant constraints, for all floating point constants
8833 and for constants of greater than word size precision (usually
8837 Special cases of registers or memory. This macro is not required,
8838 and is only defined for some machines.
8840 Inspecting these macro definitions in the compiler source for your
8841 machine is the best way to be certain you have the right constraints.
8842 However, here is a summary of the machine-dependent constraints
8843 available on some particular machines.
8845 _ARM family--`arm.h'_
8848 Floating-point register
8851 One of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0,
8855 Floating-point constant that would satisfy the constraint `F'
8859 Integer that is valid as an immediate operand in a data
8860 processing instruction. That is, an integer in the range 0
8861 to 255 rotated by a multiple of 2
8864 Integer in the range -4095 to 4095
8867 Integer that satisfies constraint `I' when inverted (ones
8871 Integer that satisfies constraint `I' when negated (twos
8875 Integer in the range 0 to 32
8878 A memory reference where the exact address is in a single
8879 register (``m'' is preferable for `asm' statements)
8882 An item in the constant pool
8885 A symbol in the text segment of the current file
8887 _AVR family--`avr.h'_
8890 Registers from r0 to r15
8893 Registers from r16 to r23
8896 Registers from r16 to r31
8899 Registers from r24 to r31. These registers can be used in
8903 Pointer register (r26-r31)
8906 Base pointer register (r28-r31)
8909 Stack pointer register (SPH:SPL)
8912 Temporary register r0
8915 Register pair X (r27:r26)
8918 Register pair Y (r29:r28)
8921 Register pair Z (r31:r30)
8924 Constant greater than -1, less than 64
8927 Constant greater than -64, less than 1
8936 Constant that fits in 8 bits
8942 Constant integer 8, 16, or 24
8948 A floating point constant 0.0
8950 _PowerPC and IBM RS6000--`rs6000.h'_
8953 Address base register
8956 Floating point register
8962 `MQ', `CTR', or `LINK' register
8974 `CR' register (condition register) number 0
8977 `CR' register (condition register)
8980 `FPMEM' stack memory for FPR-GPR transfers
8983 Signed 16-bit constant
8986 Unsigned 16-bit constant shifted left 16 bits (use `L'
8987 instead for `SImode' constants)
8990 Unsigned 16-bit constant
8993 Signed 16-bit constant shifted left 16 bits
8996 Constant larger than 31
9005 Constant whose negation is a signed 16-bit constant
9008 Floating point constant that can be loaded into a register
9009 with one instruction per word
9012 Memory operand that is an offset from a register (`m' is
9013 preferable for `asm' statements)
9019 Constant suitable as a 64-bit mask operand
9022 Constant suitable as a 32-bit mask operand
9025 System V Release 4 small data area reference
9027 _Intel 386--`i386.h'_
9030 `a', `b', `c', or `d' register for the i386. For x86-64 it
9031 is equivalent to `r' class. (for 8-bit instructions that do
9032 not use upper halves)
9035 `a', `b', `c', or `d' register. (for 8-bit instructions, that
9036 do use upper halves)
9039 Legacy register--equivalent to `r' class in i386 mode. (for
9040 non-8-bit registers used together with 8-bit upper halves in
9041 a single instruction)
9044 Specifies the `a' or `d' registers. This is primarily useful
9045 for 64-bit integer values (when in 32-bit mode) intended to
9046 be returned with the `d' register holding the most
9047 significant bits and the `a' register holding the least
9051 Floating point register
9054 First (top of stack) floating point register
9057 Second floating point register
9069 Specifies constant that can be easily constructed in SSE
9070 register without loading it from memory.
9088 Constant in range 0 to 31 (for 32-bit shifts)
9091 Constant in range 0 to 63 (for 64-bit shifts)
9100 0, 1, 2, or 3 (shifts for `lea' instruction)
9103 Constant in range 0 to 255 (for `out' instruction)
9106 Constant in range 0 to `0xffffffff' or symbolic reference
9107 known to fit specified range. (for using immediates in zero
9108 extending 32-bit to 64-bit x86-64 instructions)
9111 Constant in range -2147483648 to 2147483647 or symbolic
9112 reference known to fit specified range. (for using
9113 immediates in 64-bit x86-64 instructions)
9116 Standard 80387 floating point constant
9118 _Intel 960--`i960.h'_
9121 Floating point register (`fp0' to `fp3')
9124 Local register (`r0' to `r15')
9127 Global register (`g0' to `g15')
9130 Any local or global register
9133 Integers from 0 to 31
9139 Integers from -31 to 0
9147 _Intel IA-64--`ia64.h'_
9150 General register `r0' to `r3' for `addl' instruction
9156 Predicate register (`c' as in "conditional")
9159 Application register residing in M-unit
9162 Application register residing in I-unit
9165 Floating-point register
9168 Memory operand. Remember that `m' allows postincrement and
9169 postdecrement which require printing with `%Pn' on IA-64.
9170 Use `S' to disallow postincrement and postdecrement.
9173 Floating-point constant 0.0 or 1.0
9176 14-bit signed integer constant
9179 22-bit signed integer constant
9182 8-bit signed integer constant for logical instructions
9185 8-bit adjusted signed integer constant for compare pseudo-ops
9188 6-bit unsigned integer constant for shift counts
9191 9-bit signed integer constant for load and store
9198 0 or -1 for `dep' instruction
9201 Non-volatile memory for floating-point loads and stores
9204 Integer constant in the range 1 to 4 for `shladd' instruction
9207 Memory operand except postincrement and postdecrement
9212 Register in the class `ACC_REGS' (`acc0' to `acc7').
9215 Register in the class `EVEN_ACC_REGS' (`acc0' to `acc7').
9218 Register in the class `CC_REGS' (`fcc0' to `fcc3' and `icc0'
9222 Register in the class `GPR_REGS' (`gr0' to `gr63').
9225 Register in the class `EVEN_REGS' (`gr0' to `gr63'). Odd
9226 registers are excluded not in the class but through the use
9227 of a machine mode larger than 4 bytes.
9230 Register in the class `FPR_REGS' (`fr0' to `fr63').
9233 Register in the class `FEVEN_REGS' (`fr0' to `fr63'). Odd
9234 registers are excluded not in the class but through the use
9235 of a machine mode larger than 4 bytes.
9238 Register in the class `LR_REG' (the `lr' register).
9241 Register in the class `QUAD_REGS' (`gr2' to `gr63').
9242 Register numbers not divisible by 4 are excluded not in the
9243 class but through the use of a machine mode larger than 8
9247 Register in the class `ICC_REGS' (`icc0' to `icc3').
9250 Register in the class `FCC_REGS' (`fcc0' to `fcc3').
9253 Register in the class `ICR_REGS' (`cc4' to `cc7').
9256 Register in the class `FCR_REGS' (`cc0' to `cc3').
9259 Register in the class `QUAD_FPR_REGS' (`fr0' to `fr63').
9260 Register numbers not divisible by 4 are excluded not in the
9261 class but through the use of a machine mode larger than 8
9265 Register in the class `SPR_REGS' (`lcr' and `lr').
9268 Register in the class `QUAD_ACC_REGS' (`acc0' to `acc7').
9271 Register in the class `ACCG_REGS' (`accg0' to `accg7').
9274 Register in the class `CR_REGS' (`cc0' to `cc7').
9277 Floating point constant zero
9280 6-bit signed integer constant
9283 10-bit signed integer constant
9286 16-bit signed integer constant
9289 16-bit unsigned integer constant
9292 12-bit signed integer constant that is negative--i.e. in the
9293 range of -2048 to -1
9299 12-bit signed integer constant that is greater than
9300 zero--i.e. in the range of 1 to 2047.
9305 `DP' or `IP' registers (general address)
9329 `DP' or `SP' registers (offsettable address)
9332 Non-pointer registers (not `SP', `DP', `IP')
9335 Non-SP registers (everything except `SP')
9338 Indirect through `IP' - Avoid this except for `QImode', since
9339 we can't access extra bytes
9342 Indirect through `SP' or `DP' with short displacement (0..127)
9345 Data-section immediate value
9348 Integers from -255 to -1
9351 Integers from 0 to 7--valid bit number in a register
9354 Integers from 0 to 127--valid displacement for addressing mode
9357 Integers from 1 to 127
9369 Integers from 0 to 255
9374 General-purpose integer register
9377 Floating-point register (if available)
9386 `Hi' or `Lo' register
9389 General-purpose integer register
9392 Floating-point status register
9395 Signed 16-bit constant (for arithmetic instructions)
9401 Zero-extended 16-bit constant (for logic instructions)
9404 Constant with low 16 bits zero (can be loaded with `lui')
9407 32-bit constant which requires two instructions to load (a
9408 constant which is not `I', `K', or `L')
9411 Negative 16-bit constant
9417 Positive 16-bit constant
9423 Memory reference that can be loaded with more than one
9424 instruction (`m' is preferable for `asm' statements)
9427 Memory reference that can be loaded with one instruction (`m'
9428 is preferable for `asm' statements)
9431 Memory reference in external OSF/rose PIC format (`m' is
9432 preferable for `asm' statements)
9434 _Motorola 680x0--`m68k.h'_
9443 68881 floating-point register, if available
9446 Integer in the range 1 to 8
9449 16-bit signed number
9452 Signed number whose magnitude is greater than 0x80
9455 Integer in the range -8 to -1
9458 Signed number whose magnitude is greater than 0x100
9461 Floating point constant that is not a 68881 constant
9463 _Motorola 68HC11 & 68HC12 families--`m68hc11.h'_
9478 Temporary soft register _.tmp
9481 A soft register _.d1 to _.d31
9484 Stack pointer register
9493 Pseudo register 'z' (replaced by 'x' or 'y' at the end)
9496 An address register: x, y or z
9499 An address register: x or y
9502 Register pair (x:d) to form a 32-bit value
9505 Constants in the range -65536 to 65535
9508 Constants whose 16-bit low part is zero
9511 Constant integer 1 or -1
9517 Constants in the range -8 to 2
9522 Floating-point register on the SPARC-V8 architecture and
9523 lower floating-point register on the SPARC-V9 architecture.
9526 Floating-point register. It is equivalent to `f' on the
9527 SPARC-V8 architecture and contains both lower and upper
9528 floating-point registers on the SPARC-V9 architecture.
9531 Floating-point condition code register.
9534 Lower floating-point register. It is only valid on the
9535 SPARC-V9 architecture when the Visual Instruction Set is
9539 Floating-point register. It is only valid on the SPARC-V9
9540 architecture when the Visual Instruction Set is available.
9543 64-bit global or out register for the SPARC-V8+ architecture.
9546 Signed 13-bit constant
9552 32-bit constant with the low 12 bits clear (a constant that
9553 can be loaded with the `sethi' instruction)
9556 A constant in the range supported by `movcc' instructions
9559 A constant in the range supported by `movrcc' instructions
9562 Same as `K', except that it verifies that bits that are not
9563 in the lower 32-bit range are all zero. Must be used instead
9564 of `K' for modes wider than `SImode'
9573 Signed 13-bit constant, sign-extended to 32 or 64 bits
9576 Floating-point constant whose integral representation can be
9577 moved into an integer register using a single sethi
9581 Floating-point constant whose integral representation can be
9582 moved into an integer register using a single mov instruction
9585 Floating-point constant whose integral representation can be
9586 moved into an integer register using a high/lo_sum
9587 instruction sequence
9590 Memory address aligned to an 8-byte boundary
9596 Memory address for `e' constraint registers.
9598 _TMS320C3x/C4x--`c4x.h'_
9601 Auxiliary (address) register (ar0-ar7)
9604 Stack pointer register (sp)
9607 Standard (32-bit) precision integer register
9610 Extended (40-bit) precision register (r0-r11)
9613 Block count register (bk)
9616 Extended (40-bit) precision low register (r0-r7)
9619 Extended (40-bit) precision register (r0-r1)
9622 Extended (40-bit) precision register (r2-r3)
9625 Repeat count register (rc)
9628 Index register (ir0-ir1)
9631 Status (condition code) register (st)
9634 Data page register (dp)
9640 Immediate 16-bit floating-point constant
9643 Signed 16-bit constant
9646 Signed 8-bit constant
9649 Signed 5-bit constant
9652 Unsigned 16-bit constant
9655 Unsigned 8-bit constant
9658 Ones complement of unsigned 16-bit constant
9661 High 16-bit constant (32-bit constant with 16 LSBs zero)
9664 Indirect memory reference with signed 8-bit or index register
9668 Indirect memory reference with unsigned 5-bit displacement
9671 Indirect memory reference with 1 bit or index register
9675 Direct memory reference
9680 _S/390 and zSeries--`s390.h'_
9683 Address register (general purpose register except r0)
9686 Data register (arbitrary general purpose register)
9689 Floating-point register
9692 Unsigned 8-bit constant (0-255)
9695 Unsigned 12-bit constant (0-4095)
9698 Signed 16-bit constant (-32768-32767)
9701 Value appropriate as displacement.
9703 for short displacement
9706 for long displacement
9709 Constant integer with a value of 0x7fffffff.
9712 Multiple letter constraint followed by 4 parameter letters.
9714 number of the part counting from most to least
9721 mode of the containing operand
9724 value of the other parts (F - all bits set) The
9725 constraint matches if the specified part of a constant has a
9726 value different from it's other parts.
9729 Memory reference without index register and with short
9733 Memory reference with index register and short displacement.
9736 Memory reference without index register but with long
9740 Memory reference with index register and long displacement.
9743 Pointer with short displacement.
9746 Pointer with long displacement.
9749 Shift count operand.
9751 _Xstormy16--`stormy16.h'_
9766 Registers r0 through r7.
9769 Registers r0 and r1.
9775 Registers r8 and r9.
9778 A constant between 0 and 3 inclusive.
9781 A constant that has exactly one bit set.
9784 A constant that has exactly one bit clear.
9787 A constant between 0 and 255 inclusive.
9790 A constant between -255 and 0 inclusive.
9793 A constant between -3 and 0 inclusive.
9796 A constant between 1 and 4 inclusive.
9799 A constant between -4 and -1 inclusive.
9802 A memory reference that is a stack push.
9805 A memory reference that is a stack pop.
9808 A memory reference that refers to a constant address of known
9812 The register indicated by Rx (not implemented yet).
9815 A constant that is not between 2 and 15 inclusive.
9820 _Xtensa--`xtensa.h'_
9823 General-purpose 32-bit register
9826 One-bit boolean register
9829 MAC16 40-bit accumulator register
9832 Signed 12-bit integer constant, for use in MOVI instructions
9835 Signed 8-bit integer constant, for use in ADDI instructions
9838 Integer constant valid for BccI instructions
9841 Unsigned constant valid for BccUI instructions
9844 File: gccint.info, Node: Standard Names, Next: Pattern Ordering, Prev: Constraints, Up: Machine Desc
9846 Standard Pattern Names For Generation
9847 =====================================
9849 Here is a table of the instruction names that are meaningful in the
9850 RTL generation pass of the compiler. Giving one of these names to an
9851 instruction pattern tells the RTL generation pass that it can use the
9852 pattern to accomplish a certain task.
9855 Here M stands for a two-letter machine mode name, in lowercase.
9856 This instruction pattern moves data with that machine mode from
9857 operand 1 to operand 0. For example, `movsi' moves full-word data.
9859 If operand 0 is a `subreg' with mode M of a register whose own
9860 mode is wider than M, the effect of this instruction is to store
9861 the specified value in the part of the register that corresponds
9862 to mode M. Bits outside of M, but which are within the same
9863 target word as the `subreg' are undefined. Bits which are outside
9864 the target word are left unchanged.
9866 This class of patterns is special in several ways. First of all,
9867 each of these names up to and including full word size _must_ be
9868 defined, because there is no other way to copy a datum from one
9869 place to another. If there are patterns accepting operands in
9870 larger modes, `movM' must be defined for integer modes of those
9873 Second, these patterns are not used solely in the RTL generation
9874 pass. Even the reload pass can generate move insns to copy values
9875 from stack slots into temporary registers. When it does so, one
9876 of the operands is a hard register and the other is an operand
9877 that can need to be reloaded into a register.
9879 Therefore, when given such a pair of operands, the pattern must
9880 generate RTL which needs no reloading and needs no temporary
9881 registers--no registers other than the operands. For example, if
9882 you support the pattern with a `define_expand', then in such a
9883 case the `define_expand' mustn't call `force_reg' or any other such
9884 function which might generate new pseudo registers.
9886 This requirement exists even for subword modes on a RISC machine
9887 where fetching those modes from memory normally requires several
9888 insns and some temporary registers.
9890 During reload a memory reference with an invalid address may be
9891 passed as an operand. Such an address will be replaced with a
9892 valid address later in the reload pass. In this case, nothing may
9893 be done with the address except to use it as it stands. If it is
9894 copied, it will not be replaced with a valid address. No attempt
9895 should be made to make such an address into a valid address and no
9896 routine (such as `change_address') that will do so may be called.
9897 Note that `general_operand' will fail when applied to such an
9900 The global variable `reload_in_progress' (which must be explicitly
9901 declared if required) can be used to determine whether such special
9902 handling is required.
9904 The variety of operands that have reloads depends on the rest of
9905 the machine description, but typically on a RISC machine these can
9906 only be pseudo registers that did not get hard registers, while on
9907 other machines explicit memory references will get optional
9910 If a scratch register is required to move an object to or from
9911 memory, it can be allocated using `gen_reg_rtx' prior to life
9914 If there are cases which need scratch registers during or after
9915 reload, you must define `SECONDARY_INPUT_RELOAD_CLASS' and/or
9916 `SECONDARY_OUTPUT_RELOAD_CLASS' to detect them, and provide
9917 patterns `reload_inM' or `reload_outM' to handle them. *Note
9920 The global variable `no_new_pseudos' can be used to determine if it
9921 is unsafe to create new pseudo registers. If this variable is
9922 nonzero, then it is unsafe to call `gen_reg_rtx' to allocate a new
9925 The constraints on a `movM' must permit moving any hard register
9926 to any other hard register provided that `HARD_REGNO_MODE_OK'
9927 permits mode M in both registers and `REGISTER_MOVE_COST' applied
9928 to their classes returns a value of 2.
9930 It is obligatory to support floating point `movM' instructions
9931 into and out of any registers that can hold fixed point values,
9932 because unions and structures (which have modes `SImode' or
9933 `DImode') can be in those registers and they may have floating
9936 There may also be a need to support fixed point `movM'
9937 instructions in and out of floating point registers.
9938 Unfortunately, I have forgotten why this was so, and I don't know
9939 whether it is still true. If `HARD_REGNO_MODE_OK' rejects fixed
9940 point values in floating point registers, then the constraints of
9941 the fixed point `movM' instructions must be designed to avoid ever
9942 trying to reload into a floating point register.
9946 Like `movM', but used when a scratch register is required to move
9947 between operand 0 and operand 1. Operand 2 describes the scratch
9948 register. See the discussion of the `SECONDARY_RELOAD_CLASS'
9949 macro in *note Register Classes::.
9951 There are special restrictions on the form of the `match_operand's
9952 used in these patterns. First, only the predicate for the reload
9953 operand is examined, i.e., `reload_in' examines operand 1, but not
9954 the predicates for operand 0 or 2. Second, there may be only one
9955 alternative in the constraints. Third, only a single register
9956 class letter may be used for the constraint; subsequent constraint
9957 letters are ignored. As a special exception, an empty constraint
9958 string matches the `ALL_REGS' register class. This may relieve
9959 ports of the burden of defining an `ALL_REGS' constraint letter
9960 just for these patterns.
9963 Like `movM' except that if operand 0 is a `subreg' with mode M of
9964 a register whose natural mode is wider, the `movstrictM'
9965 instruction is guaranteed not to alter any of the register except
9966 the part which belongs to mode M.
9969 Load several consecutive memory locations into consecutive
9970 registers. Operand 0 is the first of the consecutive registers,
9971 operand 1 is the first memory location, and operand 2 is a
9972 constant: the number of consecutive registers.
9974 Define this only if the target machine really has such an
9975 instruction; do not define this if the most efficient way of
9976 loading consecutive registers from memory is to do them one at a
9979 On some machines, there are restrictions as to which consecutive
9980 registers can be stored into memory, such as particular starting or
9981 ending register numbers or only a range of valid counts. For those
9982 machines, use a `define_expand' (*note Expander Definitions::) and
9983 make the pattern fail if the restrictions are not met.
9985 Write the generated insn as a `parallel' with elements being a
9986 `set' of one register from the appropriate memory location (you may
9987 also need `use' or `clobber' elements). Use a `match_parallel'
9988 (*note RTL Template::) to recognize the insn. See `rs6000.md' for
9989 examples of the use of this insn pattern.
9992 Similar to `load_multiple', but store several consecutive registers
9993 into consecutive memory locations. Operand 0 is the first of the
9994 consecutive memory locations, operand 1 is the first register, and
9995 operand 2 is a constant: the number of consecutive registers.
9998 Output a push instruction. Operand 0 is value to push. Used only
9999 when `PUSH_ROUNDING' is defined. For historical reason, this
10000 pattern may be missing and in such case an `mov' expander is used
10001 instead, with a `MEM' expression forming the push operation. The
10002 `mov' expander method is deprecated.
10005 Add operand 2 and operand 1, storing the result in operand 0. All
10006 operands must have mode M. This can be used even on two-address
10007 machines, by means of constraints requiring operands 1 and 0 to be
10011 `divM3', `udivM3', `modM3', `umodM3'
10012 `sminM3', `smaxM3', `uminM3', `umaxM3'
10013 `andM3', `iorM3', `xorM3'
10014 Similar, for other arithmetic operations.
10017 Floating point min and max operations. If both operands are zeros,
10018 or if either operand is NaN, then it is unspecified which of the
10019 two operands is returned as the result.
10022 Multiply operands 1 and 2, which have mode `HImode', and store a
10023 `SImode' product in operand 0.
10025 `mulqihi3', `mulsidi3'
10026 Similar widening-multiplication instructions of other widths.
10028 `umulqihi3', `umulhisi3', `umulsidi3'
10029 Similar widening-multiplication instructions that do unsigned
10033 Perform a signed multiplication of operands 1 and 2, which have
10034 mode M, and store the most significant half of the product in
10035 operand 0. The least significant half of the product is discarded.
10038 Similar, but the multiplication is unsigned.
10041 Signed division that produces both a quotient and a remainder.
10042 Operand 1 is divided by operand 2 to produce a quotient stored in
10043 operand 0 and a remainder stored in operand 3.
10045 For machines with an instruction that produces both a quotient and
10046 a remainder, provide a pattern for `divmodM4' but do not provide
10047 patterns for `divM3' and `modM3'. This allows optimization in the
10048 relatively common case when both the quotient and remainder are
10051 If an instruction that just produces a quotient or just a remainder
10052 exists and is more efficient than the instruction that produces
10053 both, write the output routine of `divmodM4' to call
10054 `find_reg_note' and look for a `REG_UNUSED' note on the quotient
10055 or remainder and generate the appropriate instruction.
10058 Similar, but does unsigned division.
10061 Arithmetic-shift operand 1 left by a number of bits specified by
10062 operand 2, and store the result in operand 0. Here M is the mode
10063 of operand 0 and operand 1; operand 2's mode is specified by the
10064 instruction pattern, and the compiler will convert the operand to
10065 that mode before generating the instruction.
10067 `ashrM3', `lshrM3', `rotlM3', `rotrM3'
10068 Other shift and rotate instructions, analogous to the `ashlM3'
10072 Negate operand 1 and store the result in operand 0.
10075 Store the absolute value of operand 1 into operand 0.
10078 Store the square root of operand 1 into operand 0.
10080 The `sqrt' built-in function of C always uses the mode which
10081 corresponds to the C data type `double' and the `sqrtf' built-in
10082 function uses the mode which corresponds to the C data type
10086 Store the cosine of operand 1 into operand 0.
10088 The `cos' built-in function of C always uses the mode which
10089 corresponds to the C data type `double' and the `cosf' built-in
10090 function uses the mode which corresponds to the C data type
10094 Store the sine of operand 1 into operand 0.
10096 The `sin' built-in function of C always uses the mode which
10097 corresponds to the C data type `double' and the `sinf' built-in
10098 function uses the mode which corresponds to the C data type
10102 Store the exponential of operand 1 into operand 0.
10104 The `exp' built-in function of C always uses the mode which
10105 corresponds to the C data type `double' and the `expf' built-in
10106 function uses the mode which corresponds to the C data type
10110 Store the natural logarithm of operand 1 into operand 0.
10112 The `log' built-in function of C always uses the mode which
10113 corresponds to the C data type `double' and the `logf' built-in
10114 function uses the mode which corresponds to the C data type
10118 Store the value of operand 1 raised to the exponent operand 2 into
10121 The `pow' built-in function of C always uses the mode which
10122 corresponds to the C data type `double' and the `powf' built-in
10123 function uses the mode which corresponds to the C data type
10127 Store the arc tangent (inverse tangent) of operand 1 divided by
10128 operand 2 into operand 0, using the signs of both arguments to
10129 determine the quadrant of the result.
10131 The `atan2' built-in function of C always uses the mode which
10132 corresponds to the C data type `double' and the `atan2f' built-in
10133 function uses the mode which corresponds to the C data type
10137 Store the largest integral value not greater than argument.
10139 The `floor' built-in function of C always uses the mode which
10140 corresponds to the C data type `double' and the `floorf' built-in
10141 function uses the mode which corresponds to the C data type
10145 Store the argument rounded to integer towards zero.
10147 The `trunc' built-in function of C always uses the mode which
10148 corresponds to the C data type `double' and the `truncf' built-in
10149 function uses the mode which corresponds to the C data type
10153 Store the argument rounded to integer away from zero.
10155 The `round' built-in function of C always uses the mode which
10156 corresponds to the C data type `double' and the `roundf' built-in
10157 function uses the mode which corresponds to the C data type
10161 Store the argument rounded to integer away from zero.
10163 The `ceil' built-in function of C always uses the mode which
10164 corresponds to the C data type `double' and the `ceilf' built-in
10165 function uses the mode which corresponds to the C data type
10169 Store the argument rounded according to the default rounding mode
10171 The `nearbyint' built-in function of C always uses the mode which
10172 corresponds to the C data type `double' and the `nearbyintf'
10173 built-in function uses the mode which corresponds to the C data
10177 Store into operand 0 one plus the index of the least significant
10178 1-bit of operand 1. If operand 1 is zero, store zero. M is the
10179 mode of operand 0; operand 1's mode is specified by the instruction
10180 pattern, and the compiler will convert the operand to that mode
10181 before generating the instruction.
10183 The `ffs' built-in function of C always uses the mode which
10184 corresponds to the C data type `int'.
10187 Store into operand 0 the number of leading 0-bits in X, starting
10188 at the most significant bit position. If X is 0, the result is
10189 undefined. M is the mode of operand 0; operand 1's mode is
10190 specified by the instruction pattern, and the compiler will
10191 convert the operand to that mode before generating the instruction.
10194 Store into operand 0 the number of trailing 0-bits in X, starting
10195 at the least significant bit position. If X is 0, the result is
10196 undefined. M is the mode of operand 0; operand 1's mode is
10197 specified by the instruction pattern, and the compiler will
10198 convert the operand to that mode before generating the instruction.
10201 Store into operand 0 the number of 1-bits in X. M is the mode of
10202 operand 0; operand 1's mode is specified by the instruction
10203 pattern, and the compiler will convert the operand to that mode
10204 before generating the instruction.
10207 Store into operand 0 the parity of X, i.e. the number of 1-bits in
10208 X modulo 2. M is the mode of operand 0; operand 1's mode is
10209 specified by the instruction pattern, and the compiler will convert
10210 the operand to that mode before generating the instruction.
10213 Store the bitwise-complement of operand 1 into operand 0.
10216 Compare operand 0 and operand 1, and set the condition codes. The
10217 RTL pattern should look like this:
10219 (set (cc0) (compare (match_operand:M 0 ...)
10220 (match_operand:M 1 ...)))
10223 Compare operand 0 against zero, and set the condition codes. The
10224 RTL pattern should look like this:
10226 (set (cc0) (match_operand:M 0 ...))
10228 `tstM' patterns should not be defined for machines that do not use
10229 `(cc0)'. Doing so would confuse the optimizer since it would no
10230 longer be clear which `set' operations were comparisons. The
10231 `cmpM' patterns should be used instead.
10234 Block move instruction. The addresses of the destination and
10235 source strings are the first two operands, and both are in mode
10238 The number of bytes to move is the third operand, in mode M.
10239 Usually, you specify `word_mode' for M. However, if you can
10240 generate better code knowing the range of valid lengths is smaller
10241 than those representable in a full word, you should provide a
10242 pattern with a mode corresponding to the range of values you can
10243 handle efficiently (e.g., `QImode' for values in the range 0-127;
10244 note we avoid numbers that appear negative) and also a pattern
10247 The fourth operand is the known shared alignment of the source and
10248 destination, in the form of a `const_int' rtx. Thus, if the
10249 compiler knows that both source and destination are word-aligned,
10250 it may provide the value 4 for this operand.
10252 Descriptions of multiple `movstrM' patterns can only be beneficial
10253 if the patterns for smaller modes have fewer restrictions on their
10254 first, second and fourth operands. Note that the mode M in
10255 `movstrM' does not impose any restriction on the mode of
10256 individually moved data units in the block.
10258 These patterns need not give special consideration to the
10259 possibility that the source and destination strings might overlap.
10262 Block clear instruction. The addresses of the destination string
10263 is the first operand, in mode `Pmode'. The number of bytes to
10264 clear is the second operand, in mode M. See `movstrM' for a
10265 discussion of the choice of mode.
10267 The third operand is the known alignment of the destination, in
10268 the form of a `const_int' rtx. Thus, if the compiler knows that
10269 the destination is word-aligned, it may provide the value 4 for
10272 The use for multiple `clrstrM' is as for `movstrM'.
10275 String compare instruction, with five operands. Operand 0 is the
10276 output; it has mode M. The remaining four operands are like the
10277 operands of `movstrM'. The two memory blocks specified are
10278 compared byte by byte in lexicographic order starting at the
10279 beginning of each string. The instruction is not allowed to
10280 prefetch more than one byte at a time since either string may end
10281 in the first byte and reading past that may access an invalid page
10282 or segment and cause a fault. The effect of the instruction is to
10283 store a value in operand 0 whose sign indicates the result of the
10287 Block compare instruction, with five operands like the operands of
10288 `cmpstrM'. The two memory blocks specified are compared byte by
10289 byte in lexicographic order starting at the beginning of each
10290 block. Unlike `cmpstrM' the instruction can prefetch any bytes in
10291 the two memory blocks. The effect of the instruction is to store
10292 a value in operand 0 whose sign indicates the result of the
10296 Compute the length of a string, with three operands. Operand 0 is
10297 the result (of mode M), operand 1 is a `mem' referring to the
10298 first character of the string, operand 2 is the character to
10299 search for (normally zero), and operand 3 is a constant describing
10300 the known alignment of the beginning of the string.
10303 Convert signed integer operand 1 (valid for fixed point mode M) to
10304 floating point mode N and store in operand 0 (which has mode N).
10307 Convert unsigned integer operand 1 (valid for fixed point mode M)
10308 to floating point mode N and store in operand 0 (which has mode N).
10311 Convert operand 1 (valid for floating point mode M) to fixed point
10312 mode N as a signed number and store in operand 0 (which has mode
10313 N). This instruction's result is defined only when the value of
10314 operand 1 is an integer.
10317 Convert operand 1 (valid for floating point mode M) to fixed point
10318 mode N as an unsigned number and store in operand 0 (which has
10319 mode N). This instruction's result is defined only when the value
10320 of operand 1 is an integer.
10323 Convert operand 1 (valid for floating point mode M) to an integer
10324 value, still represented in floating point mode M, and store it in
10325 operand 0 (valid for floating point mode M).
10328 Like `fixMN2' but works for any floating point value of mode M by
10329 converting the value to an integer.
10332 Like `fixunsMN2' but works for any floating point value of mode M
10333 by converting the value to an integer.
10336 Truncate operand 1 (valid for mode M) to mode N and store in
10337 operand 0 (which has mode N). Both modes must be fixed point or
10338 both floating point.
10341 Sign-extend operand 1 (valid for mode M) to mode N and store in
10342 operand 0 (which has mode N). Both modes must be fixed point or
10343 both floating point.
10346 Zero-extend operand 1 (valid for mode M) to mode N and store in
10347 operand 0 (which has mode N). Both modes must be fixed point.
10350 Extract a bit-field from operand 1 (a register or memory operand),
10351 where operand 2 specifies the width in bits and operand 3 the
10352 starting bit, and store it in operand 0. Operand 0 must have mode
10353 `word_mode'. Operand 1 may have mode `byte_mode' or `word_mode';
10354 often `word_mode' is allowed only for registers. Operands 2 and 3
10355 must be valid for `word_mode'.
10357 The RTL generation pass generates this instruction only with
10358 constants for operands 2 and 3.
10360 The bit-field value is sign-extended to a full word integer before
10361 it is stored in operand 0.
10364 Like `extv' except that the bit-field value is zero-extended.
10367 Store operand 3 (which must be valid for `word_mode') into a
10368 bit-field in operand 0, where operand 1 specifies the width in
10369 bits and operand 2 the starting bit. Operand 0 may have mode
10370 `byte_mode' or `word_mode'; often `word_mode' is allowed only for
10371 registers. Operands 1 and 2 must be valid for `word_mode'.
10373 The RTL generation pass generates this instruction only with
10374 constants for operands 1 and 2.
10377 Conditionally move operand 2 or operand 3 into operand 0 according
10378 to the comparison in operand 1. If the comparison is true,
10379 operand 2 is moved into operand 0, otherwise operand 3 is moved.
10381 The mode of the operands being compared need not be the same as
10382 the operands being moved. Some machines, sparc64 for example,
10383 have instructions that conditionally move an integer value based
10384 on the floating point condition codes and vice versa.
10386 If the machine does not have conditional move instructions, do not
10387 define these patterns.
10390 Similar to `movMODEcc' but for conditional addition. Conditionally
10391 move operand 2 or (operands 2 + operand 3) into operand 0
10392 according to the comparison in operand 1. If the comparison is
10393 true, operand 2 is moved into operand 0, otherwise (operand 2 +
10394 operand 3) is moved.
10397 Store zero or nonzero in the operand according to the condition
10398 codes. Value stored is nonzero iff the condition COND is true.
10399 COND is the name of a comparison operation expression code, such
10400 as `eq', `lt' or `leu'.
10402 You specify the mode that the operand must have when you write the
10403 `match_operand' expression. The compiler automatically sees which
10404 mode you have used and supplies an operand of that mode.
10406 The value stored for a true condition must have 1 as its low bit,
10407 or else must be negative. Otherwise the instruction is not
10408 suitable and you should omit it from the machine description. You
10409 describe to the compiler exactly which value is stored by defining
10410 the macro `STORE_FLAG_VALUE' (*note Misc::). If a description
10411 cannot be found that can be used for all the `sCOND' patterns, you
10412 should omit those operations from the machine description.
10414 These operations may fail, but should do so only in relatively
10415 uncommon cases; if they would fail for common cases involving
10416 integer comparisons, it is best to omit these patterns.
10418 If these operations are omitted, the compiler will usually
10419 generate code that copies the constant one to the target and
10420 branches around an assignment of zero to the target. If this code
10421 is more efficient than the potential instructions used for the
10422 `sCOND' pattern followed by those required to convert the result
10423 into a 1 or a zero in `SImode', you should omit the `sCOND'
10424 operations from the machine description.
10427 Conditional branch instruction. Operand 0 is a `label_ref' that
10428 refers to the label to jump to. Jump if the condition codes meet
10431 Some machines do not follow the model assumed here where a
10432 comparison instruction is followed by a conditional branch
10433 instruction. In that case, the `cmpM' (and `tstM') patterns should
10434 simply store the operands away and generate all the required insns
10435 in a `define_expand' (*note Expander Definitions::) for the
10436 conditional branch operations. All calls to expand `bCOND'
10437 patterns are immediately preceded by calls to expand either a
10438 `cmpM' pattern or a `tstM' pattern.
10440 Machines that use a pseudo register for the condition code value,
10441 or where the mode used for the comparison depends on the condition
10442 being tested, should also use the above mechanism. *Note Jump
10445 The above discussion also applies to the `movMODEcc' and `sCOND'
10449 A jump inside a function; an unconditional branch. Operand 0 is
10450 the `label_ref' of the label to jump to. This pattern name is
10451 mandatory on all machines.
10454 Subroutine call instruction returning no value. Operand 0 is the
10455 function to call; operand 1 is the number of bytes of arguments
10456 pushed as a `const_int'; operand 2 is the number of registers used
10459 On most machines, operand 2 is not actually stored into the RTL
10460 pattern. It is supplied for the sake of some RISC machines which
10461 need to put this information into the assembler code; they can put
10462 it in the RTL instead of operand 1.
10464 Operand 0 should be a `mem' RTX whose address is the address of the
10465 function. Note, however, that this address can be a `symbol_ref'
10466 expression even if it would not be a legitimate memory address on
10467 the target machine. If it is also not a valid argument for a call
10468 instruction, the pattern for this operation should be a
10469 `define_expand' (*note Expander Definitions::) that places the
10470 address into a register and uses that register in the call
10474 Subroutine call instruction returning a value. Operand 0 is the
10475 hard register in which the value is returned. There are three more
10476 operands, the same as the three operands of the `call' instruction
10477 (but with numbers increased by one).
10479 Subroutines that return `BLKmode' objects use the `call' insn.
10481 `call_pop', `call_value_pop'
10482 Similar to `call' and `call_value', except used if defined and if
10483 `RETURN_POPS_ARGS' is nonzero. They should emit a `parallel' that
10484 contains both the function call and a `set' to indicate the
10485 adjustment made to the frame pointer.
10487 For machines where `RETURN_POPS_ARGS' can be nonzero, the use of
10488 these patterns increases the number of functions for which the
10489 frame pointer can be eliminated, if desired.
10492 Subroutine call instruction returning a value of any type.
10493 Operand 0 is the function to call; operand 1 is a memory location
10494 where the result of calling the function is to be stored; operand
10495 2 is a `parallel' expression where each element is a `set'
10496 expression that indicates the saving of a function return value
10497 into the result block.
10499 This instruction pattern should be defined to support
10500 `__builtin_apply' on machines where special instructions are needed
10501 to call a subroutine with arbitrary arguments or to save the value
10502 returned. This instruction pattern is required on machines that
10503 have multiple registers that can hold a return value (i.e.
10504 `FUNCTION_VALUE_REGNO_P' is true for more than one register).
10507 Subroutine return instruction. This instruction pattern name
10508 should be defined only if a single instruction can do all the work
10509 of returning from a function.
10511 Like the `movM' patterns, this pattern is also used after the RTL
10512 generation phase. In this case it is to support machines where
10513 multiple instructions are usually needed to return from a
10514 function, but some class of functions only requires one
10515 instruction to implement a return. Normally, the applicable
10516 functions are those which do not need to save any registers or
10517 allocate stack space.
10519 For such machines, the condition specified in this pattern should
10520 only be true when `reload_completed' is nonzero and the function's
10521 epilogue would only be a single instruction. For machines with
10522 register windows, the routine `leaf_function_p' may be used to
10523 determine if a register window push is required.
10525 Machines that have conditional return instructions should define
10530 (if_then_else (match_operator
10531 0 "comparison_operator"
10532 [(cc0) (const_int 0)])
10538 where CONDITION would normally be the same condition specified on
10539 the named `return' pattern.
10542 Untyped subroutine return instruction. This instruction pattern
10543 should be defined to support `__builtin_return' on machines where
10544 special instructions are needed to return a value of any type.
10546 Operand 0 is a memory location where the result of calling a
10547 function with `__builtin_apply' is stored; operand 1 is a
10548 `parallel' expression where each element is a `set' expression
10549 that indicates the restoring of a function return value from the
10553 No-op instruction. This instruction pattern name should always be
10554 defined to output a no-op in assembler code. `(const_int 0)' will
10555 do as an RTL pattern.
10558 An instruction to jump to an address which is operand zero. This
10559 pattern name is mandatory on all machines.
10562 Instruction to jump through a dispatch table, including bounds
10563 checking. This instruction takes five operands:
10565 1. The index to dispatch on, which has mode `SImode'.
10567 2. The lower bound for indices in the table, an integer constant.
10569 3. The total range of indices in the table--the largest index
10570 minus the smallest one (both inclusive).
10572 4. A label that precedes the table itself.
10574 5. A label to jump to if the index has a value outside the
10575 bounds. (If the machine-description macro
10576 `CASE_DROPS_THROUGH' is defined, then an out-of-bounds index
10577 drops through to the code following the jump table instead of
10578 jumping to this label. In that case, this label is not
10579 actually used by the `casesi' instruction, but it is always
10580 provided as an operand.)
10582 The table is a `addr_vec' or `addr_diff_vec' inside of a
10583 `jump_insn'. The number of elements in the table is one plus the
10584 difference between the upper bound and the lower bound.
10587 Instruction to jump to a variable address. This is a low-level
10588 capability which can be used to implement a dispatch table when
10589 there is no `casesi' pattern.
10591 This pattern requires two operands: the address or offset, and a
10592 label which should immediately precede the jump table. If the
10593 macro `CASE_VECTOR_PC_RELATIVE' evaluates to a nonzero value then
10594 the first operand is an offset which counts from the address of
10595 the table; otherwise, it is an absolute address to jump to. In
10596 either case, the first operand has mode `Pmode'.
10598 The `tablejump' insn is always the last insn before the jump table
10599 it uses. Its assembler code normally has no need to use the
10600 second operand, but you should incorporate it in the RTL pattern so
10601 that the jump optimizer will not delete the table as unreachable
10604 `decrement_and_branch_until_zero'
10605 Conditional branch instruction that decrements a register and
10606 jumps if the register is nonzero. Operand 0 is the register to
10607 decrement and test; operand 1 is the label to jump to if the
10608 register is nonzero. *Note Looping Patterns::.
10610 This optional instruction pattern is only used by the combiner,
10611 typically for loops reversed by the loop optimizer when strength
10612 reduction is enabled.
10615 Conditional branch instruction that decrements a register and
10616 jumps if the register is nonzero. This instruction takes five
10617 operands: Operand 0 is the register to decrement and test; operand
10618 1 is the number of loop iterations as a `const_int' or
10619 `const0_rtx' if this cannot be determined until run-time; operand
10620 2 is the actual or estimated maximum number of iterations as a
10621 `const_int'; operand 3 is the number of enclosed loops as a
10622 `const_int' (an innermost loop has a value of 1); operand 4 is the
10623 label to jump to if the register is nonzero. *Note Looping
10626 This optional instruction pattern should be defined for machines
10627 with low-overhead looping instructions as the loop optimizer will
10628 try to modify suitable loops to utilize it. If nested
10629 low-overhead looping is not supported, use a `define_expand'
10630 (*note Expander Definitions::) and make the pattern fail if
10631 operand 3 is not `const1_rtx'. Similarly, if the actual or
10632 estimated maximum number of iterations is too large for this
10633 instruction, make it fail.
10636 Companion instruction to `doloop_end' required for machines that
10637 need to perform some initialization, such as loading special
10638 registers used by a low-overhead looping instruction. If
10639 initialization insns do not always need to be emitted, use a
10640 `define_expand' (*note Expander Definitions::) and make it fail.
10642 `canonicalize_funcptr_for_compare'
10643 Canonicalize the function pointer in operand 1 and store the result
10646 Operand 0 is always a `reg' and has mode `Pmode'; operand 1 may be
10647 a `reg', `mem', `symbol_ref', `const_int', etc and also has mode
10650 Canonicalization of a function pointer usually involves computing
10651 the address of the function which would be called if the function
10652 pointer were used in an indirect call.
10654 Only define this pattern if function pointers on the target machine
10655 can have different values but still call the same function when
10656 used in an indirect call.
10659 `save_stack_function'
10660 `save_stack_nonlocal'
10661 `restore_stack_block'
10662 `restore_stack_function'
10663 `restore_stack_nonlocal'
10664 Most machines save and restore the stack pointer by copying it to
10665 or from an object of mode `Pmode'. Do not define these patterns on
10668 Some machines require special handling for stack pointer saves and
10669 restores. On those machines, define the patterns corresponding to
10670 the non-standard cases by using a `define_expand' (*note Expander
10671 Definitions::) that produces the required insns. The three types
10672 of saves and restores are:
10674 1. `save_stack_block' saves the stack pointer at the start of a
10675 block that allocates a variable-sized object, and
10676 `restore_stack_block' restores the stack pointer when the
10679 2. `save_stack_function' and `restore_stack_function' do a
10680 similar job for the outermost block of a function and are
10681 used when the function allocates variable-sized objects or
10682 calls `alloca'. Only the epilogue uses the restored stack
10683 pointer, allowing a simpler save or restore sequence on some
10686 3. `save_stack_nonlocal' is used in functions that contain labels
10687 branched to by nested functions. It saves the stack pointer
10688 in such a way that the inner function can use
10689 `restore_stack_nonlocal' to restore the stack pointer. The
10690 compiler generates code to restore the frame and argument
10691 pointer registers, but some machines require saving and
10692 restoring additional data such as register window information
10693 or stack backchains. Place insns in these patterns to save
10694 and restore any such required data.
10696 When saving the stack pointer, operand 0 is the save area and
10697 operand 1 is the stack pointer. The mode used to allocate the
10698 save area defaults to `Pmode' but you can override that choice by
10699 defining the `STACK_SAVEAREA_MODE' macro (*note Storage Layout::).
10700 You must specify an integral mode, or `VOIDmode' if no save area
10701 is needed for a particular type of save (either because no save is
10702 needed or because a machine-specific save area can be used).
10703 Operand 0 is the stack pointer and operand 1 is the save area for
10704 restore operations. If `save_stack_block' is defined, operand 0
10705 must not be `VOIDmode' since these saves can be arbitrarily nested.
10707 A save area is a `mem' that is at a constant offset from
10708 `virtual_stack_vars_rtx' when the stack pointer is saved for use by
10709 nonlocal gotos and a `reg' in the other two cases.
10712 Subtract (or add if `STACK_GROWS_DOWNWARD' is undefined) operand 1
10713 from the stack pointer to create space for dynamically allocated
10716 Store the resultant pointer to this space into operand 0. If you
10717 are allocating space from the main stack, do this by emitting a
10718 move insn to copy `virtual_stack_dynamic_rtx' to operand 0. If
10719 you are allocating the space elsewhere, generate code to copy the
10720 location of the space to operand 0. In the latter case, you must
10721 ensure this space gets freed when the corresponding space on the
10722 main stack is free.
10724 Do not define this pattern if all that must be done is the
10725 subtraction. Some machines require other operations such as stack
10726 probes or maintaining the back chain. Define this pattern to emit
10727 those operations in addition to updating the stack pointer.
10730 If stack checking cannot be done on your system by probing the
10731 stack with a load or store instruction (*note Stack Checking::),
10732 define this pattern to perform the needed check and signaling an
10733 error if the stack has overflowed. The single operand is the
10734 location in the stack furthest from the current stack pointer that
10735 you need to validate. Normally, on machines where this pattern is
10736 needed, you would obtain the stack limit from a global or
10737 thread-specific variable or register.
10740 Emit code to generate a non-local goto, e.g., a jump from one
10741 function to a label in an outer function. This pattern has four
10742 arguments, each representing a value to be used in the jump. The
10743 first argument is to be loaded into the frame pointer, the second
10744 is the address to branch to (code to dispatch to the actual label),
10745 the third is the address of a location where the stack is saved,
10746 and the last is the address of the label, to be placed in the
10747 location for the incoming static chain.
10749 On most machines you need not define this pattern, since GCC will
10750 already generate the correct code, which is to load the frame
10751 pointer and static chain, restore the stack (using the
10752 `restore_stack_nonlocal' pattern, if defined), and jump indirectly
10753 to the dispatcher. You need only define this pattern if this code
10754 will not work on your machine.
10756 `nonlocal_goto_receiver'
10757 This pattern, if defined, contains code needed at the target of a
10758 nonlocal goto after the code already generated by GCC. You will
10759 not normally need to define this pattern. A typical reason why
10760 you might need this pattern is if some value, such as a pointer to
10761 a global table, must be restored when the frame pointer is
10762 restored. Note that a nonlocal goto only occurs within a
10763 unit-of-translation, so a global table pointer that is shared by
10764 all functions of a given module need not be restored. There are
10767 `exception_receiver'
10768 This pattern, if defined, contains code needed at the site of an
10769 exception handler that isn't needed at the site of a nonlocal
10770 goto. You will not normally need to define this pattern. A
10771 typical reason why you might need this pattern is if some value,
10772 such as a pointer to a global table, must be restored after
10773 control flow is branched to the handler of an exception. There
10776 `builtin_setjmp_setup'
10777 This pattern, if defined, contains additional code needed to
10778 initialize the `jmp_buf'. You will not normally need to define
10779 this pattern. A typical reason why you might need this pattern is
10780 if some value, such as a pointer to a global table, must be
10781 restored. Though it is preferred that the pointer value be
10782 recalculated if possible (given the address of a label for
10783 instance). The single argument is a pointer to the `jmp_buf'.
10784 Note that the buffer is five words long and that the first three
10785 are normally used by the generic mechanism.
10787 `builtin_setjmp_receiver'
10788 This pattern, if defined, contains code needed at the site of an
10789 built-in setjmp that isn't needed at the site of a nonlocal goto.
10790 You will not normally need to define this pattern. A typical
10791 reason why you might need this pattern is if some value, such as a
10792 pointer to a global table, must be restored. It takes one
10793 argument, which is the label to which builtin_longjmp transfered
10794 control; this pattern may be emitted at a small offset from that
10798 This pattern, if defined, performs the entire action of the
10799 longjmp. You will not normally need to define this pattern unless
10800 you also define `builtin_setjmp_setup'. The single argument is a
10801 pointer to the `jmp_buf'.
10804 This pattern, if defined, affects the way `__builtin_eh_return',
10805 and thence the call frame exception handling library routines, are
10806 built. It is intended to handle non-trivial actions needed along
10807 the abnormal return path.
10809 The address of the exception handler to which the function should
10810 return is passed as operand to this pattern. It will normally
10811 need to copied by the pattern to some special register or memory
10812 location. If the pattern needs to determine the location of the
10813 target call frame in order to do so, it may use
10814 `EH_RETURN_STACKADJ_RTX', if defined; it will have already been
10817 If this pattern is not defined, the default action will be to
10818 simply copy the return address to `EH_RETURN_HANDLER_RTX'. Either
10819 that macro or this pattern needs to be defined if call frame
10820 exception handling is to be used.
10823 This pattern, if defined, emits RTL for entry to a function. The
10824 function entry is responsible for setting up the stack frame,
10825 initializing the frame pointer register, saving callee saved
10828 Using a prologue pattern is generally preferred over defining
10829 `TARGET_ASM_FUNCTION_PROLOGUE' to emit assembly code for the
10832 The `prologue' pattern is particularly useful for targets which
10833 perform instruction scheduling.
10836 This pattern emits RTL for exit from a function. The function
10837 exit is responsible for deallocating the stack frame, restoring
10838 callee saved registers and emitting the return instruction.
10840 Using an epilogue pattern is generally preferred over defining
10841 `TARGET_ASM_FUNCTION_EPILOGUE' to emit assembly code for the
10844 The `epilogue' pattern is particularly useful for targets which
10845 perform instruction scheduling or which have delay slots for their
10846 return instruction.
10849 This pattern, if defined, emits RTL for exit from a function
10850 without the final branch back to the calling function. This
10851 pattern will be emitted before any sibling call (aka tail call)
10854 The `sibcall_epilogue' pattern must not clobber any arguments used
10855 for parameter passing or any stack slots for arguments passed to
10856 the current function.
10859 This pattern, if defined, signals an error, typically by causing
10860 some kind of signal to be raised. Among other places, it is used
10861 by the Java front end to signal `invalid array index' exceptions.
10864 Conditional trap instruction. Operand 0 is a piece of RTL which
10865 performs a comparison. Operand 1 is the trap code, an integer.
10867 A typical `conditional_trap' pattern looks like
10869 (define_insn "conditional_trap"
10870 [(trap_if (match_operator 0 "trap_operator"
10871 [(cc0) (const_int 0)])
10872 (match_operand 1 "const_int_operand" "i"))]
10877 This pattern, if defined, emits code for a non-faulting data
10878 prefetch instruction. Operand 0 is the address of the memory to
10879 prefetch. Operand 1 is a constant 1 if the prefetch is preparing
10880 for a write to the memory address, or a constant 0 otherwise.
10881 Operand 2 is the expected degree of temporal locality of the data
10882 and is a value between 0 and 3, inclusive; 0 means that the data
10883 has no temporal locality, so it need not be left in the cache
10884 after the access; 3 means that the data has a high degree of
10885 temporal locality and should be left in all levels of cache
10886 possible; 1 and 2 mean, respectively, a low or moderate degree of
10889 Targets that do not support write prefetches or locality hints can
10890 ignore the values of operands 1 and 2.
10893 File: gccint.info, Node: Pattern Ordering, Next: Dependent Patterns, Prev: Standard Names, Up: Machine Desc
10895 When the Order of Patterns Matters
10896 ==================================
10898 Sometimes an insn can match more than one instruction pattern. Then
10899 the pattern that appears first in the machine description is the one
10900 used. Therefore, more specific patterns (patterns that will match
10901 fewer things) and faster instructions (those that will produce better
10902 code when they do match) should usually go first in the description.
10904 In some cases the effect of ordering the patterns can be used to hide
10905 a pattern when it is not valid. For example, the 68000 has an
10906 instruction for converting a fullword to floating point and another for
10907 converting a byte to floating point. An instruction converting an
10908 integer to floating point could match either one. We put the pattern
10909 to convert the fullword first to make sure that one will be used rather
10910 than the other. (Otherwise a large integer might be generated as a
10911 single-byte immediate quantity, which would not work.) Instead of
10912 using this pattern ordering it would be possible to make the pattern
10913 for convert-a-byte smart enough to deal properly with any constant
10917 File: gccint.info, Node: Dependent Patterns, Next: Jump Patterns, Prev: Pattern Ordering, Up: Machine Desc
10919 Interdependence of Patterns
10920 ===========================
10922 Every machine description must have a named pattern for each of the
10923 conditional branch names `bCOND'. The recognition template must always
10927 (if_then_else (COND (cc0) (const_int 0))
10928 (label_ref (match_operand 0 "" ""))
10931 In addition, every machine description must have an anonymous pattern
10932 for each of the possible reverse-conditional branches. Their templates
10936 (if_then_else (COND (cc0) (const_int 0))
10938 (label_ref (match_operand 0 "" ""))))
10940 They are necessary because jump optimization can turn direct-conditional
10941 branches into reverse-conditional branches.
10943 It is often convenient to use the `match_operator' construct to
10944 reduce the number of patterns that must be specified for branches. For
10949 (if_then_else (match_operator 0 "comparison_operator"
10950 [(cc0) (const_int 0)])
10952 (label_ref (match_operand 1 "" ""))))]
10956 In some cases machines support instructions identical except for the
10957 machine mode of one or more operands. For example, there may be
10958 "sign-extend halfword" and "sign-extend byte" instructions whose
10961 (set (match_operand:SI 0 ...)
10962 (extend:SI (match_operand:HI 1 ...)))
10964 (set (match_operand:SI 0 ...)
10965 (extend:SI (match_operand:QI 1 ...)))
10967 Constant integers do not specify a machine mode, so an instruction to
10968 extend a constant value could match either pattern. The pattern it
10969 actually will match is the one that appears first in the file. For
10970 correct results, this must be the one for the widest possible mode
10971 (`HImode', here). If the pattern matches the `QImode' instruction, the
10972 results will be incorrect if the constant value does not actually fit
10975 Such instructions to extend constants are rarely generated because
10976 they are optimized away, but they do occasionally happen in nonoptimized
10979 If a constraint in a pattern allows a constant, the reload pass may
10980 replace a register with a constant permitted by the constraint in some
10981 cases. Similarly for memory references. Because of this substitution,
10982 you should not provide separate patterns for increment and decrement
10983 instructions. Instead, they should be generated from the same pattern
10984 that supports register-register add insns by examining the operands and
10985 generating the appropriate machine instruction.
10988 File: gccint.info, Node: Jump Patterns, Next: Looping Patterns, Prev: Dependent Patterns, Up: Machine Desc
10990 Defining Jump Instruction Patterns
10991 ==================================
10993 For most machines, GCC assumes that the machine has a condition code.
10994 A comparison insn sets the condition code, recording the results of both
10995 signed and unsigned comparison of the given operands. A separate branch
10996 insn tests the condition code and branches or not according its value.
10997 The branch insns come in distinct signed and unsigned flavors. Many
10998 common machines, such as the VAX, the 68000 and the 32000, work this
11001 Some machines have distinct signed and unsigned compare
11002 instructions, and only one set of conditional branch instructions. The
11003 easiest way to handle these machines is to treat them just like the
11004 others until the final stage where assembly code is written. At this
11005 time, when outputting code for the compare instruction, peek ahead at
11006 the following branch using `next_cc0_user (insn)'. (The variable
11007 `insn' refers to the insn being output, in the output-writing code in
11008 an instruction pattern.) If the RTL says that is an unsigned branch,
11009 output an unsigned compare; otherwise output a signed compare. When
11010 the branch itself is output, you can treat signed and unsigned branches
11013 The reason you can do this is that GCC always generates a pair of
11014 consecutive RTL insns, possibly separated by `note' insns, one to set
11015 the condition code and one to test it, and keeps the pair inviolate
11018 To go with this technique, you must define the machine-description
11019 macro `NOTICE_UPDATE_CC' to do `CC_STATUS_INIT'; in other words, no
11020 compare instruction is superfluous.
11022 Some machines have compare-and-branch instructions and no condition
11023 code. A similar technique works for them. When it is time to "output"
11024 a compare instruction, record its operands in two static variables.
11025 When outputting the branch-on-condition-code instruction that follows,
11026 actually output a compare-and-branch instruction that uses the
11027 remembered operands.
11029 It also works to define patterns for compare-and-branch instructions.
11030 In optimizing compilation, the pair of compare and branch instructions
11031 will be combined according to these patterns. But this does not happen
11032 if optimization is not requested. So you must use one of the solutions
11033 above in addition to any special patterns you define.
11035 In many RISC machines, most instructions do not affect the condition
11036 code and there may not even be a separate condition code register. On
11037 these machines, the restriction that the definition and use of the
11038 condition code be adjacent insns is not necessary and can prevent
11039 important optimizations. For example, on the IBM RS/6000, there is a
11040 delay for taken branches unless the condition code register is set three
11041 instructions earlier than the conditional branch. The instruction
11042 scheduler cannot perform this optimization if it is not permitted to
11043 separate the definition and use of the condition code register.
11045 On these machines, do not use `(cc0)', but instead use a register to
11046 represent the condition code. If there is a specific condition code
11047 register in the machine, use a hard register. If the condition code or
11048 comparison result can be placed in any general register, or if there are
11049 multiple condition registers, use a pseudo register.
11051 On some machines, the type of branch instruction generated may
11052 depend on the way the condition code was produced; for example, on the
11053 68k and SPARC, setting the condition code directly from an add or
11054 subtract instruction does not clear the overflow bit the way that a test
11055 instruction does, so a different branch instruction must be used for
11056 some conditional branches. For machines that use `(cc0)', the set and
11057 use of the condition code must be adjacent (separated only by `note'
11058 insns) allowing flags in `cc_status' to be used. (*Note Condition
11059 Code::.) Also, the comparison and branch insns can be located from
11060 each other by using the functions `prev_cc0_setter' and `next_cc0_user'.
11062 However, this is not true on machines that do not use `(cc0)'. On
11063 those machines, no assumptions can be made about the adjacency of the
11064 compare and branch insns and the above methods cannot be used. Instead,
11065 we use the machine mode of the condition code register to record
11066 different formats of the condition code register.
11068 Registers used to store the condition code value should have a mode
11069 that is in class `MODE_CC'. Normally, it will be `CCmode'. If
11070 additional modes are required (as for the add example mentioned above in
11071 the SPARC), define the macro `EXTRA_CC_MODES' to list the additional
11072 modes required (*note Condition Code::). Also define `SELECT_CC_MODE'
11073 to choose a mode given an operand of a compare.
11075 If it is known during RTL generation that a different mode will be
11076 required (for example, if the machine has separate compare instructions
11077 for signed and unsigned quantities, like most IBM processors), they can
11078 be specified at that time.
11080 If the cases that require different modes would be made by
11081 instruction combination, the macro `SELECT_CC_MODE' determines which
11082 machine mode should be used for the comparison result. The patterns
11083 should be written using that mode. To support the case of the add on
11084 the SPARC discussed above, we have the pattern
11087 [(set (reg:CC_NOOV 0)
11089 (plus:SI (match_operand:SI 0 "register_operand" "%r")
11090 (match_operand:SI 1 "arith_operand" "rI"))
11095 The `SELECT_CC_MODE' macro on the SPARC returns `CC_NOOVmode' for
11096 comparisons whose argument is a `plus'.
11099 File: gccint.info, Node: Looping Patterns, Next: Insn Canonicalizations, Prev: Jump Patterns, Up: Machine Desc
11101 Defining Looping Instruction Patterns
11102 =====================================
11104 Some machines have special jump instructions that can be utilized to
11105 make loops more efficient. A common example is the 68000 `dbra'
11106 instruction which performs a decrement of a register and a branch if the
11107 result was greater than zero. Other machines, in particular digital
11108 signal processors (DSPs), have special block repeat instructions to
11109 provide low-overhead loop support. For example, the TI TMS320C3x/C4x
11110 DSPs have a block repeat instruction that loads special registers to
11111 mark the top and end of a loop and to count the number of loop
11112 iterations. This avoids the need for fetching and executing a
11113 `dbra'-like instruction and avoids pipeline stalls associated with the
11116 GCC has three special named patterns to support low overhead looping.
11117 They are `decrement_and_branch_until_zero', `doloop_begin', and
11118 `doloop_end'. The first pattern, `decrement_and_branch_until_zero', is
11119 not emitted during RTL generation but may be emitted during the
11120 instruction combination phase. This requires the assistance of the
11121 loop optimizer, using information collected during strength reduction,
11122 to reverse a loop to count down to zero. Some targets also require the
11123 loop optimizer to add a `REG_NONNEG' note to indicate that the
11124 iteration count is always positive. This is needed if the target
11125 performs a signed loop termination test. For example, the 68000 uses a
11126 pattern similar to the following for its `dbra' instruction:
11128 (define_insn "decrement_and_branch_until_zero"
11131 (ge (plus:SI (match_operand:SI 0 "general_operand" "+d*am")
11134 (label_ref (match_operand 1 "" ""))
11137 (plus:SI (match_dup 0)
11139 "find_reg_note (insn, REG_NONNEG, 0)"
11142 Note that since the insn is both a jump insn and has an output, it
11143 must deal with its own reloads, hence the `m' constraints. Also note
11144 that since this insn is generated by the instruction combination phase
11145 combining two sequential insns together into an implicit parallel insn,
11146 the iteration counter needs to be biased by the same amount as the
11147 decrement operation, in this case -1. Note that the following similar
11148 pattern will not be matched by the combiner.
11150 (define_insn "decrement_and_branch_until_zero"
11153 (ge (match_operand:SI 0 "general_operand" "+d*am")
11155 (label_ref (match_operand 1 "" ""))
11158 (plus:SI (match_dup 0)
11160 "find_reg_note (insn, REG_NONNEG, 0)"
11163 The other two special looping patterns, `doloop_begin' and
11164 `doloop_end', are emitted by the loop optimizer for certain
11165 well-behaved loops with a finite number of loop iterations using
11166 information collected during strength reduction.
11168 The `doloop_end' pattern describes the actual looping instruction
11169 (or the implicit looping operation) and the `doloop_begin' pattern is
11170 an optional companion pattern that can be used for initialization
11171 needed for some low-overhead looping instructions.
11173 Note that some machines require the actual looping instruction to be
11174 emitted at the top of the loop (e.g., the TMS320C3x/C4x DSPs). Emitting
11175 the true RTL for a looping instruction at the top of the loop can cause
11176 problems with flow analysis. So instead, a dummy `doloop' insn is
11177 emitted at the end of the loop. The machine dependent reorg pass checks
11178 for the presence of this `doloop' insn and then searches back to the
11179 top of the loop, where it inserts the true looping insn (provided there
11180 are no instructions in the loop which would cause problems). Any
11181 additional labels can be emitted at this point. In addition, if the
11182 desired special iteration counter register was not allocated, this
11183 machine dependent reorg pass could emit a traditional compare and jump
11186 The essential difference between the
11187 `decrement_and_branch_until_zero' and the `doloop_end' patterns is that
11188 the loop optimizer allocates an additional pseudo register for the
11189 latter as an iteration counter. This pseudo register cannot be used
11190 within the loop (i.e., general induction variables cannot be derived
11191 from it), however, in many cases the loop induction variable may become
11192 redundant and removed by the flow pass.
11195 File: gccint.info, Node: Insn Canonicalizations, Next: Expander Definitions, Prev: Looping Patterns, Up: Machine Desc
11197 Canonicalization of Instructions
11198 ================================
11200 There are often cases where multiple RTL expressions could represent
11201 an operation performed by a single machine instruction. This situation
11202 is most commonly encountered with logical, branch, and
11203 multiply-accumulate instructions. In such cases, the compiler attempts
11204 to convert these multiple RTL expressions into a single canonical form
11205 to reduce the number of insn patterns required.
11207 In addition to algebraic simplifications, following canonicalizations
11210 * For commutative and comparison operators, a constant is always
11211 made the second operand. If a machine only supports a constant as
11212 the second operand, only patterns that match a constant in the
11213 second operand need be supplied.
11215 For these operators, if only one operand is a `neg', `not',
11216 `mult', `plus', or `minus' expression, it will be the first
11219 * In combinations of `neg', `mult', `plus', and `minus', the `neg'
11220 operations (if any) will be moved inside the operations as far as
11221 possible. For instance, `(neg (mult A B))' is canonicalized as
11222 `(mult (neg A) B)', but `(plus (mult (neg A) B) C)' is
11223 canonicalized as `(minus A (mult B C))'.
11225 * For the `compare' operator, a constant is always the second operand
11226 on machines where `cc0' is used (*note Jump Patterns::). On other
11227 machines, there are rare cases where the compiler might want to
11228 construct a `compare' with a constant as the first operand.
11229 However, these cases are not common enough for it to be worthwhile
11230 to provide a pattern matching a constant as the first operand
11231 unless the machine actually has such an instruction.
11233 An operand of `neg', `not', `mult', `plus', or `minus' is made the
11234 first operand under the same conditions as above.
11236 * `(minus X (const_int N))' is converted to `(plus X (const_int
11239 * Within address computations (i.e., inside `mem'), a left shift is
11240 converted into the appropriate multiplication by a power of two.
11242 * De`Morgan's Law is used to move bitwise negation inside a bitwise
11243 logical-and or logical-or operation. If this results in only one
11244 operand being a `not' expression, it will be the first one.
11246 A machine that has an instruction that performs a bitwise
11247 logical-and of one operand with the bitwise negation of the other
11248 should specify the pattern for that instruction as
11251 [(set (match_operand:M 0 ...)
11252 (and:M (not:M (match_operand:M 1 ...))
11253 (match_operand:M 2 ...)))]
11257 Similarly, a pattern for a "NAND" instruction should be written
11260 [(set (match_operand:M 0 ...)
11261 (ior:M (not:M (match_operand:M 1 ...))
11262 (not:M (match_operand:M 2 ...))))]
11266 In both cases, it is not necessary to include patterns for the many
11267 logically equivalent RTL expressions.
11269 * The only possible RTL expressions involving both bitwise
11270 exclusive-or and bitwise negation are `(xor:M X Y)' and `(not:M
11273 * The sum of three items, one of which is a constant, will only
11276 (plus:M (plus:M X Y) CONSTANT)
11278 * On machines that do not use `cc0', `(compare X (const_int 0))'
11279 will be converted to X.
11281 * Equality comparisons of a group of bits (usually a single bit)
11282 with zero will be written using `zero_extract' rather than the
11283 equivalent `and' or `sign_extract' operations.
11287 File: gccint.info, Node: Expander Definitions, Next: Insn Splitting, Prev: Insn Canonicalizations, Up: Machine Desc
11289 Defining RTL Sequences for Code Generation
11290 ==========================================
11292 On some target machines, some standard pattern names for RTL
11293 generation cannot be handled with single insn, but a sequence of RTL
11294 insns can represent them. For these target machines, you can write a
11295 `define_expand' to specify how to generate the sequence of RTL.
11297 A `define_expand' is an RTL expression that looks almost like a
11298 `define_insn'; but, unlike the latter, a `define_expand' is used only
11299 for RTL generation and it can produce more than one RTL insn.
11301 A `define_expand' RTX has four operands:
11303 * The name. Each `define_expand' must have a name, since the only
11304 use for it is to refer to it by name.
11306 * The RTL template. This is a vector of RTL expressions representing
11307 a sequence of separate instructions. Unlike `define_insn', there
11308 is no implicit surrounding `PARALLEL'.
11310 * The condition, a string containing a C expression. This
11311 expression is used to express how the availability of this pattern
11312 depends on subclasses of target machine, selected by command-line
11313 options when GCC is run. This is just like the condition of a
11314 `define_insn' that has a standard name. Therefore, the condition
11315 (if present) may not depend on the data in the insn being matched,
11316 but only the target-machine-type flags. The compiler needs to
11317 test these conditions during initialization in order to learn
11318 exactly which named instructions are available in a particular run.
11320 * The preparation statements, a string containing zero or more C
11321 statements which are to be executed before RTL code is generated
11322 from the RTL template.
11324 Usually these statements prepare temporary registers for use as
11325 internal operands in the RTL template, but they can also generate
11326 RTL insns directly by calling routines such as `emit_insn', etc.
11327 Any such insns precede the ones that come from the RTL template.
11329 Every RTL insn emitted by a `define_expand' must match some
11330 `define_insn' in the machine description. Otherwise, the compiler will
11331 crash when trying to generate code for the insn or trying to optimize
11334 The RTL template, in addition to controlling generation of RTL insns,
11335 also describes the operands that need to be specified when this pattern
11336 is used. In particular, it gives a predicate for each operand.
11338 A true operand, which needs to be specified in order to generate RTL
11339 from the pattern, should be described with a `match_operand' in its
11340 first occurrence in the RTL template. This enters information on the
11341 operand's predicate into the tables that record such things. GCC uses
11342 the information to preload the operand into a register if that is
11343 required for valid RTL code. If the operand is referred to more than
11344 once, subsequent references should use `match_dup'.
11346 The RTL template may also refer to internal "operands" which are
11347 temporary registers or labels used only within the sequence made by the
11348 `define_expand'. Internal operands are substituted into the RTL
11349 template with `match_dup', never with `match_operand'. The values of
11350 the internal operands are not passed in as arguments by the compiler
11351 when it requests use of this pattern. Instead, they are computed
11352 within the pattern, in the preparation statements. These statements
11353 compute the values and store them into the appropriate elements of
11354 `operands' so that `match_dup' can find them.
11356 There are two special macros defined for use in the preparation
11357 statements: `DONE' and `FAIL'. Use them with a following semicolon, as
11361 Use the `DONE' macro to end RTL generation for the pattern. The
11362 only RTL insns resulting from the pattern on this occasion will be
11363 those already emitted by explicit calls to `emit_insn' within the
11364 preparation statements; the RTL template will not be generated.
11367 Make the pattern fail on this occasion. When a pattern fails, it
11368 means that the pattern was not truly available. The calling
11369 routines in the compiler will try other strategies for code
11370 generation using other patterns.
11372 Failure is currently supported only for binary (addition,
11373 multiplication, shifting, etc.) and bit-field (`extv', `extzv',
11374 and `insv') operations.
11376 If the preparation falls through (invokes neither `DONE' nor
11377 `FAIL'), then the `define_expand' acts like a `define_insn' in that the
11378 RTL template is used to generate the insn.
11380 The RTL template is not used for matching, only for generating the
11381 initial insn list. If the preparation statement always invokes `DONE'
11382 or `FAIL', the RTL template may be reduced to a simple list of
11383 operands, such as this example:
11385 (define_expand "addsi3"
11386 [(match_operand:SI 0 "register_operand" "")
11387 (match_operand:SI 1 "register_operand" "")
11388 (match_operand:SI 2 "register_operand" "")]
11392 handle_add (operands[0], operands[1], operands[2]);
11396 Here is an example, the definition of left-shift for the SPUR chip:
11398 (define_expand "ashlsi3"
11399 [(set (match_operand:SI 0 "register_operand" "")
11401 (match_operand:SI 1 "register_operand" "")
11402 (match_operand:SI 2 "nonmemory_operand" "")))]
11407 if (GET_CODE (operands[2]) != CONST_INT
11408 || (unsigned) INTVAL (operands[2]) > 3)
11412 This example uses `define_expand' so that it can generate an RTL insn
11413 for shifting when the shift-count is in the supported range of 0 to 3
11414 but fail in other cases where machine insns aren't available. When it
11415 fails, the compiler tries another strategy using different patterns
11416 (such as, a library call).
11418 If the compiler were able to handle nontrivial condition-strings in
11419 patterns with names, then it would be possible to use a `define_insn'
11420 in that case. Here is another case (zero-extension on the 68000) which
11421 makes more use of the power of `define_expand':
11423 (define_expand "zero_extendhisi2"
11424 [(set (match_operand:SI 0 "general_operand" "")
11426 (set (strict_low_part
11430 (match_operand:HI 1 "general_operand" ""))]
11432 "operands[1] = make_safe_from (operands[1], operands[0]);")
11434 Here two RTL insns are generated, one to clear the entire output operand
11435 and the other to copy the input operand into its low half. This
11436 sequence is incorrect if the input operand refers to [the old value of]
11437 the output operand, so the preparation statement makes sure this isn't
11438 so. The function `make_safe_from' copies the `operands[1]' into a
11439 temporary register if it refers to `operands[0]'. It does this by
11440 emitting another RTL insn.
11442 Finally, a third example shows the use of an internal operand.
11443 Zero-extension on the SPUR chip is done by `and'-ing the result against
11444 a halfword mask. But this mask cannot be represented by a `const_int'
11445 because the constant value is too large to be legitimate on this
11446 machine. So it must be copied into a register with `force_reg' and
11447 then the register used in the `and'.
11449 (define_expand "zero_extendhisi2"
11450 [(set (match_operand:SI 0 "register_operand" "")
11452 (match_operand:HI 1 "register_operand" "")
11457 = force_reg (SImode, GEN_INT (65535)); ")
11459 *Note:* If the `define_expand' is used to serve a standard binary or
11460 unary arithmetic operation or a bit-field operation, then the last insn
11461 it generates must not be a `code_label', `barrier' or `note'. It must
11462 be an `insn', `jump_insn' or `call_insn'. If you don't need a real insn
11463 at the end, emit an insn to copy the result of the operation into
11464 itself. Such an insn will generate no code, but it can avoid problems
11468 File: gccint.info, Node: Insn Splitting, Next: Including Patterns, Prev: Expander Definitions, Up: Machine Desc
11470 Defining How to Split Instructions
11471 ==================================
11473 There are two cases where you should specify how to split a pattern
11474 into multiple insns. On machines that have instructions requiring
11475 delay slots (*note Delay Slots::) or that have instructions whose
11476 output is not available for multiple cycles (*note Processor pipeline
11477 description::), the compiler phases that optimize these cases need to
11478 be able to move insns into one-instruction delay slots. However, some
11479 insns may generate more than one machine instruction. These insns
11480 cannot be placed into a delay slot.
11482 Often you can rewrite the single insn as a list of individual insns,
11483 each corresponding to one machine instruction. The disadvantage of
11484 doing so is that it will cause the compilation to be slower and require
11485 more space. If the resulting insns are too complex, it may also
11486 suppress some optimizations. The compiler splits the insn if there is a
11487 reason to believe that it might improve instruction or delay slot
11490 The insn combiner phase also splits putative insns. If three insns
11491 are merged into one insn with a complex expression that cannot be
11492 matched by some `define_insn' pattern, the combiner phase attempts to
11493 split the complex pattern into two insns that are recognized. Usually
11494 it can break the complex pattern into two patterns by splitting out some
11495 subexpression. However, in some other cases, such as performing an
11496 addition of a large constant in two insns on a RISC machine, the way to
11497 split the addition into two insns is machine-dependent.
11499 The `define_split' definition tells the compiler how to split a
11500 complex insn into several simpler insns. It looks like this:
11505 [NEW-INSN-PATTERN-1
11508 "PREPARATION-STATEMENTS")
11510 INSN-PATTERN is a pattern that needs to be split and CONDITION is
11511 the final condition to be tested, as in a `define_insn'. When an insn
11512 matching INSN-PATTERN and satisfying CONDITION is found, it is replaced
11513 in the insn list with the insns given by NEW-INSN-PATTERN-1,
11514 NEW-INSN-PATTERN-2, etc.
11516 The PREPARATION-STATEMENTS are similar to those statements that are
11517 specified for `define_expand' (*note Expander Definitions::) and are
11518 executed before the new RTL is generated to prepare for the generated
11519 code or emit some insns whose pattern is not fixed. Unlike those in
11520 `define_expand', however, these statements must not generate any new
11521 pseudo-registers. Once reload has completed, they also must not
11522 allocate any space in the stack frame.
11524 Patterns are matched against INSN-PATTERN in two different
11525 circumstances. If an insn needs to be split for delay slot scheduling
11526 or insn scheduling, the insn is already known to be valid, which means
11527 that it must have been matched by some `define_insn' and, if
11528 `reload_completed' is nonzero, is known to satisfy the constraints of
11529 that `define_insn'. In that case, the new insn patterns must also be
11530 insns that are matched by some `define_insn' and, if `reload_completed'
11531 is nonzero, must also satisfy the constraints of those definitions.
11533 As an example of this usage of `define_split', consider the following
11534 example from `a29k.md', which splits a `sign_extend' from `HImode' to
11535 `SImode' into a pair of shift insns:
11538 [(set (match_operand:SI 0 "gen_reg_operand" "")
11539 (sign_extend:SI (match_operand:HI 1 "gen_reg_operand" "")))]
11541 [(set (match_dup 0)
11542 (ashift:SI (match_dup 1)
11545 (ashiftrt:SI (match_dup 0)
11548 { operands[1] = gen_lowpart (SImode, operands[1]); }")
11550 When the combiner phase tries to split an insn pattern, it is always
11551 the case that the pattern is _not_ matched by any `define_insn'. The
11552 combiner pass first tries to split a single `set' expression and then
11553 the same `set' expression inside a `parallel', but followed by a
11554 `clobber' of a pseudo-reg to use as a scratch register. In these
11555 cases, the combiner expects exactly two new insn patterns to be
11556 generated. It will verify that these patterns match some `define_insn'
11557 definitions, so you need not do this test in the `define_split' (of
11558 course, there is no point in writing a `define_split' that will never
11559 produce insns that match).
11561 Here is an example of this use of `define_split', taken from
11565 [(set (match_operand:SI 0 "gen_reg_operand" "")
11566 (plus:SI (match_operand:SI 1 "gen_reg_operand" "")
11567 (match_operand:SI 2 "non_add_cint_operand" "")))]
11569 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
11570 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
11573 int low = INTVAL (operands[2]) & 0xffff;
11574 int high = (unsigned) INTVAL (operands[2]) >> 16;
11577 high++, low |= 0xffff0000;
11579 operands[3] = GEN_INT (high << 16);
11580 operands[4] = GEN_INT (low);
11583 Here the predicate `non_add_cint_operand' matches any `const_int'
11584 that is _not_ a valid operand of a single add insn. The add with the
11585 smaller displacement is written so that it can be substituted into the
11586 address of a subsequent operation.
11588 An example that uses a scratch register, from the same file,
11589 generates an equality comparison of a register and a large constant:
11592 [(set (match_operand:CC 0 "cc_reg_operand" "")
11593 (compare:CC (match_operand:SI 1 "gen_reg_operand" "")
11594 (match_operand:SI 2 "non_short_cint_operand" "")))
11595 (clobber (match_operand:SI 3 "gen_reg_operand" ""))]
11596 "find_single_use (operands[0], insn, 0)
11597 && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ
11598 || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)"
11599 [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4)))
11600 (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))]
11603 /* Get the constant we are comparing against, C, and see what it
11604 looks like sign-extended to 16 bits. Then see what constant
11605 could be XOR'ed with C to get the sign-extended value. */
11607 int c = INTVAL (operands[2]);
11608 int sextc = (c << 16) >> 16;
11609 int xorv = c ^ sextc;
11611 operands[4] = GEN_INT (xorv);
11612 operands[5] = GEN_INT (sextc);
11615 To avoid confusion, don't write a single `define_split' that accepts
11616 some insns that match some `define_insn' as well as some insns that
11617 don't. Instead, write two separate `define_split' definitions, one for
11618 the insns that are valid and one for the insns that are not valid.
11620 The splitter is allowed to split jump instructions into sequence of
11621 jumps or create new jumps in while splitting non-jump instructions. As
11622 the central flowgraph and branch prediction information needs to be
11623 updated, several restriction apply.
11625 Splitting of jump instruction into sequence that over by another jump
11626 instruction is always valid, as compiler expect identical behavior of
11627 new jump. When new sequence contains multiple jump instructions or new
11628 labels, more assistance is needed. Splitter is required to create only
11629 unconditional jumps, or simple conditional jump instructions.
11630 Additionally it must attach a `REG_BR_PROB' note to each conditional
11631 jump. A global variable `split_branch_probability' hold the
11632 probability of original branch in case it was an simple conditional
11633 jump, -1 otherwise. To simplify recomputing of edge frequencies, new
11634 sequence is required to have only forward jumps to the newly created
11637 For the common case where the pattern of a define_split exactly
11638 matches the pattern of a define_insn, use `define_insn_and_split'. It
11641 (define_insn_and_split
11646 [NEW-INSN-PATTERN-1
11649 "PREPARATION-STATEMENTS"
11652 INSN-PATTERN, CONDITION, OUTPUT-TEMPLATE, and INSN-ATTRIBUTES are
11653 used as in `define_insn'. The NEW-INSN-PATTERN vector and the
11654 PREPARATION-STATEMENTS are used as in a `define_split'. The
11655 SPLIT-CONDITION is also used as in `define_split', with the additional
11656 behavior that if the condition starts with `&&', the condition used for
11657 the split will be the constructed as a logical "and" of the split
11658 condition with the insn condition. For example, from i386.md:
11660 (define_insn_and_split "zero_extendhisi2_and"
11661 [(set (match_operand:SI 0 "register_operand" "=r")
11662 (zero_extend:SI (match_operand:HI 1 "register_operand" "0")))
11663 (clobber (reg:CC 17))]
11664 "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size"
11666 "&& reload_completed"
11667 [(parallel [(set (match_dup 0)
11668 (and:SI (match_dup 0) (const_int 65535)))
11669 (clobber (reg:CC 17))])]
11671 [(set_attr "type" "alu1")])
11673 In this case, the actual split condition will be
11674 `TARGET_ZERO_EXTEND_WITH_AND && !optimize_size && reload_completed'.
11676 The `define_insn_and_split' construction provides exactly the same
11677 functionality as two separate `define_insn' and `define_split'
11678 patterns. It exists for compactness, and as a maintenance tool to
11679 prevent having to ensure the two patterns' templates match.
11682 File: gccint.info, Node: Including Patterns, Next: Peephole Definitions, Prev: Insn Splitting, Up: Machine Desc
11684 Including Patterns in Machine Descriptions.
11685 ===========================================
11687 The `include' pattern tells the compiler tools where to look for
11688 patterns that are in files other than in the file `.md'. This is used
11689 only at build time and there is no preprocessing allowed.
11700 (include "filestuff")
11702 Where PATHNAME is a string that specifies the location of the file,
11703 specifies the include file to be in `gcc/config/target/filestuff'. The
11704 directory `gcc/config/target' is regarded as the default directory.
11706 Machine descriptions may be split up into smaller more manageable
11707 subsections and placed into subdirectories.
11712 (include "BOGUS/filestuff")
11714 the include file is specified to be in
11715 `gcc/config/TARGET/BOGUS/filestuff'.
11717 Specifying an absolute path for the include file such as;
11719 (include "/u2/BOGUS/filestuff")
11720 is permitted but is not encouraged.
11722 RTL Generation Tool Options for Directory Search
11723 ------------------------------------------------
11725 The `-IDIR' option specifies directories to search for machine
11726 descriptions. For example:
11729 genrecog -I/p1/abc/proc1 -I/p2/abcd/pro2 target.md
11731 Add the directory DIR to the head of the list of directories to be
11732 searched for header files. This can be used to override a system
11733 machine definition file, substituting your own version, since these
11734 directories are searched before the default machine description file
11735 directories. If you use more than one `-I' option, the directories are
11736 scanned in left-to-right order; the standard default directory come
11740 File: gccint.info, Node: Peephole Definitions, Next: Insn Attributes, Prev: Including Patterns, Up: Machine Desc
11742 Machine-Specific Peephole Optimizers
11743 ====================================
11745 In addition to instruction patterns the `md' file may contain
11746 definitions of machine-specific peephole optimizations.
11748 The combiner does not notice certain peephole optimizations when the
11749 data flow in the program does not suggest that it should try them. For
11750 example, sometimes two consecutive insns related in purpose can be
11751 combined even though the second one does not appear to use a register
11752 computed in the first one. A machine-specific peephole optimizer can
11753 detect such opportunities.
11755 There are two forms of peephole definitions that may be used. The
11756 original `define_peephole' is run at assembly output time to match
11757 insns and substitute assembly text. Use of `define_peephole' is
11760 A newer `define_peephole2' matches insns and substitutes new insns.
11761 The `peephole2' pass is run after register allocation but before
11762 scheduling, which may result in much better code for targets that do
11767 * define_peephole:: RTL to Text Peephole Optimizers
11768 * define_peephole2:: RTL to RTL Peephole Optimizers
11771 File: gccint.info, Node: define_peephole, Next: define_peephole2, Up: Peephole Definitions
11773 RTL to Text Peephole Optimizers
11774 -------------------------------
11776 A definition looks like this:
11784 "OPTIONAL-INSN-ATTRIBUTES")
11786 The last string operand may be omitted if you are not using any
11787 machine-specific information in this machine description. If present,
11788 it must obey the same rules as in a `define_insn'.
11790 In this skeleton, INSN-PATTERN-1 and so on are patterns to match
11791 consecutive insns. The optimization applies to a sequence of insns when
11792 INSN-PATTERN-1 matches the first one, INSN-PATTERN-2 matches the next,
11795 Each of the insns matched by a peephole must also match a
11796 `define_insn'. Peepholes are checked only at the last stage just
11797 before code generation, and only optionally. Therefore, any insn which
11798 would match a peephole but no `define_insn' will cause a crash in code
11799 generation in an unoptimized compilation, or at various optimization
11802 The operands of the insns are matched with `match_operands',
11803 `match_operator', and `match_dup', as usual. What is not usual is that
11804 the operand numbers apply to all the insn patterns in the definition.
11805 So, you can check for identical operands in two insns by using
11806 `match_operand' in one insn and `match_dup' in the other.
11808 The operand constraints used in `match_operand' patterns do not have
11809 any direct effect on the applicability of the peephole, but they will
11810 be validated afterward, so make sure your constraints are general enough
11811 to apply whenever the peephole matches. If the peephole matches but
11812 the constraints are not satisfied, the compiler will crash.
11814 It is safe to omit constraints in all the operands of the peephole;
11815 or you can write constraints which serve as a double-check on the
11816 criteria previously tested.
11818 Once a sequence of insns matches the patterns, the CONDITION is
11819 checked. This is a C expression which makes the final decision whether
11820 to perform the optimization (we do so if the expression is nonzero). If
11821 CONDITION is omitted (in other words, the string is empty) then the
11822 optimization is applied to every sequence of insns that matches the
11825 The defined peephole optimizations are applied after register
11826 allocation is complete. Therefore, the peephole definition can check
11827 which operands have ended up in which kinds of registers, just by
11828 looking at the operands.
11830 The way to refer to the operands in CONDITION is to write
11831 `operands[I]' for operand number I (as matched by `(match_operand I
11832 ...)'). Use the variable `insn' to refer to the last of the insns
11833 being matched; use `prev_active_insn' to find the preceding insns.
11835 When optimizing computations with intermediate results, you can use
11836 CONDITION to match only when the intermediate results are not used
11837 elsewhere. Use the C expression `dead_or_set_p (INSN, OP)', where INSN
11838 is the insn in which you expect the value to be used for the last time
11839 (from the value of `insn', together with use of `prev_nonnote_insn'),
11840 and OP is the intermediate value (from `operands[I]').
11842 Applying the optimization means replacing the sequence of insns with
11843 one new insn. The TEMPLATE controls ultimate output of assembler code
11844 for this combined insn. It works exactly like the template of a
11845 `define_insn'. Operand numbers in this template are the same ones used
11846 in matching the original sequence of insns.
11848 The result of a defined peephole optimizer does not need to match
11849 any of the insn patterns in the machine description; it does not even
11850 have an opportunity to match them. The peephole optimizer definition
11851 itself serves as the insn pattern to control how the insn is output.
11853 Defined peephole optimizers are run as assembler code is being
11854 output, so the insns they produce are never combined or rearranged in
11857 Here is an example, taken from the 68000 machine description:
11860 [(set (reg:SI 15) (plus:SI (reg:SI 15) (const_int 4)))
11861 (set (match_operand:DF 0 "register_operand" "=f")
11862 (match_operand:DF 1 "register_operand" "ad"))]
11863 "FP_REG_P (operands[0]) && ! FP_REG_P (operands[1])"
11866 xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
11868 output_asm_insn ("move.l %1,(sp)", xoperands);
11869 output_asm_insn ("move.l %1,-(sp)", operands);
11870 return "fmove.d (sp)+,%0";
11872 output_asm_insn ("movel %1,sp@", xoperands);
11873 output_asm_insn ("movel %1,sp@-", operands);
11874 return "fmoved sp@+,%0";
11878 The effect of this optimization is to change
11893 INSN-PATTERN-1 and so on look _almost_ like the second operand of
11894 `define_insn'. There is one important difference: the second operand
11895 of `define_insn' consists of one or more RTX's enclosed in square
11896 brackets. Usually, there is only one: then the same action can be
11897 written as an element of a `define_peephole'. But when there are
11898 multiple actions in a `define_insn', they are implicitly enclosed in a
11899 `parallel'. Then you must explicitly write the `parallel', and the
11900 square brackets within it, in the `define_peephole'. Thus, if an insn
11901 pattern looks like this,
11903 (define_insn "divmodsi4"
11904 [(set (match_operand:SI 0 "general_operand" "=d")
11905 (div:SI (match_operand:SI 1 "general_operand" "0")
11906 (match_operand:SI 2 "general_operand" "dmsK")))
11907 (set (match_operand:SI 3 "general_operand" "=d")
11908 (mod:SI (match_dup 1) (match_dup 2)))]
11910 "divsl%.l %2,%3:%0")
11912 then the way to mention this insn in a peephole is as follows:
11917 [(set (match_operand:SI 0 "general_operand" "=d")
11918 (div:SI (match_operand:SI 1 "general_operand" "0")
11919 (match_operand:SI 2 "general_operand" "dmsK")))
11920 (set (match_operand:SI 3 "general_operand" "=d")
11921 (mod:SI (match_dup 1) (match_dup 2)))])
11926 File: gccint.info, Node: define_peephole2, Prev: define_peephole, Up: Peephole Definitions
11928 RTL to RTL Peephole Optimizers
11929 ------------------------------
11931 The `define_peephole2' definition tells the compiler how to
11932 substitute one sequence of instructions for another sequence, what
11933 additional scratch registers may be needed and what their lifetimes
11941 [NEW-INSN-PATTERN-1
11944 "PREPARATION-STATEMENTS")
11946 The definition is almost identical to `define_split' (*note Insn
11947 Splitting::) except that the pattern to match is not a single
11948 instruction, but a sequence of instructions.
11950 It is possible to request additional scratch registers for use in the
11951 output template. If appropriate registers are not free, the pattern
11952 will simply not match.
11954 Scratch registers are requested with a `match_scratch' pattern at
11955 the top level of the input pattern. The allocated register (initially)
11956 will be dead at the point requested within the original sequence. If
11957 the scratch is used at more than a single point, a `match_dup' pattern
11958 at the top level of the input pattern marks the last position in the
11959 input sequence at which the register must be available.
11961 Here is an example from the IA-32 machine description:
11964 [(match_scratch:SI 2 "r")
11965 (parallel [(set (match_operand:SI 0 "register_operand" "")
11966 (match_operator:SI 3 "arith_or_logical_operator"
11968 (match_operand:SI 1 "memory_operand" "")]))
11969 (clobber (reg:CC 17))])]
11970 "! optimize_size && ! TARGET_READ_MODIFY"
11971 [(set (match_dup 2) (match_dup 1))
11972 (parallel [(set (match_dup 0)
11973 (match_op_dup 3 [(match_dup 0) (match_dup 2)]))
11974 (clobber (reg:CC 17))])]
11977 This pattern tries to split a load from its use in the hopes that we'll
11978 be able to schedule around the memory load latency. It allocates a
11979 single `SImode' register of class `GENERAL_REGS' (`"r"') that needs to
11980 be live only at the point just before the arithmetic.
11982 A real example requiring extended scratch lifetimes is harder to
11983 come by, so here's a silly made-up example:
11986 [(match_scratch:SI 4 "r")
11987 (set (match_operand:SI 0 "" "") (match_operand:SI 1 "" ""))
11988 (set (match_operand:SI 2 "" "") (match_dup 1))
11990 (set (match_operand:SI 3 "" "") (match_dup 1))]
11991 "/* determine 1 does not overlap 0 and 2 */"
11992 [(set (match_dup 4) (match_dup 1))
11993 (set (match_dup 0) (match_dup 4))
11994 (set (match_dup 2) (match_dup 4))]
11995 (set (match_dup 3) (match_dup 4))]
11998 If we had not added the `(match_dup 4)' in the middle of the input
11999 sequence, it might have been the case that the register we chose at the
12000 beginning of the sequence is killed by the first or second `set'.
12003 File: gccint.info, Node: Insn Attributes, Next: Conditional Execution, Prev: Peephole Definitions, Up: Machine Desc
12005 Instruction Attributes
12006 ======================
12008 In addition to describing the instruction supported by the target
12009 machine, the `md' file also defines a group of "attributes" and a set of
12010 values for each. Every generated insn is assigned a value for each
12011 attribute. One possible attribute would be the effect that the insn
12012 has on the machine's condition code. This attribute can then be used
12013 by `NOTICE_UPDATE_CC' to track the condition codes.
12017 * Defining Attributes:: Specifying attributes and their values.
12018 * Expressions:: Valid expressions for attribute values.
12019 * Tagging Insns:: Assigning attribute values to insns.
12020 * Attr Example:: An example of assigning attributes.
12021 * Insn Lengths:: Computing the length of insns.
12022 * Constant Attributes:: Defining attributes that are constant.
12023 * Delay Slots:: Defining delay slots required for a machine.
12024 * Processor pipeline description:: Specifying information for insn scheduling.
12027 File: gccint.info, Node: Defining Attributes, Next: Expressions, Up: Insn Attributes
12029 Defining Attributes and their Values
12030 ------------------------------------
12032 The `define_attr' expression is used to define each attribute
12033 required by the target machine. It looks like:
12035 (define_attr NAME LIST-OF-VALUES DEFAULT)
12037 NAME is a string specifying the name of the attribute being defined.
12039 LIST-OF-VALUES is either a string that specifies a comma-separated
12040 list of values that can be assigned to the attribute, or a null string
12041 to indicate that the attribute takes numeric values.
12043 DEFAULT is an attribute expression that gives the value of this
12044 attribute for insns that match patterns whose definition does not
12045 include an explicit value for this attribute. *Note Attr Example::,
12046 for more information on the handling of defaults. *Note Constant
12047 Attributes::, for information on attributes that do not depend on any
12050 For each defined attribute, a number of definitions are written to
12051 the `insn-attr.h' file. For cases where an explicit set of values is
12052 specified for an attribute, the following are defined:
12054 * A `#define' is written for the symbol `HAVE_ATTR_NAME'.
12056 * An enumerated class is defined for `attr_NAME' with elements of
12057 the form `UPPER-NAME_UPPER-VALUE' where the attribute name and
12058 value are first converted to uppercase.
12060 * A function `get_attr_NAME' is defined that is passed an insn and
12061 returns the attribute value for that insn.
12063 For example, if the following is present in the `md' file:
12065 (define_attr "type" "branch,fp,load,store,arith" ...)
12067 the following lines will be written to the file `insn-attr.h'.
12069 #define HAVE_ATTR_type
12070 enum attr_type {TYPE_BRANCH, TYPE_FP, TYPE_LOAD,
12071 TYPE_STORE, TYPE_ARITH};
12072 extern enum attr_type get_attr_type ();
12074 If the attribute takes numeric values, no `enum' type will be
12075 defined and the function to obtain the attribute's value will return
12079 File: gccint.info, Node: Expressions, Next: Tagging Insns, Prev: Defining Attributes, Up: Insn Attributes
12081 Attribute Expressions
12082 ---------------------
12084 RTL expressions used to define attributes use the codes described
12085 above plus a few specific to attribute definitions, to be discussed
12086 below. Attribute value expressions must have one of the following
12090 The integer I specifies the value of a numeric attribute. I must
12093 The value of a numeric attribute can be specified either with a
12094 `const_int', or as an integer represented as a string in
12095 `const_string', `eq_attr' (see below), `attr', `symbol_ref',
12096 simple arithmetic expressions, and `set_attr' overrides on
12097 specific instructions (*note Tagging Insns::).
12099 `(const_string VALUE)'
12100 The string VALUE specifies a constant attribute value. If VALUE
12101 is specified as `"*"', it means that the default value of the
12102 attribute is to be used for the insn containing this expression.
12103 `"*"' obviously cannot be used in the DEFAULT expression of a
12106 If the attribute whose value is being specified is numeric, VALUE
12107 must be a string containing a non-negative integer (normally
12108 `const_int' would be used in this case). Otherwise, it must
12109 contain one of the valid values for the attribute.
12111 `(if_then_else TEST TRUE-VALUE FALSE-VALUE)'
12112 TEST specifies an attribute test, whose format is defined below.
12113 The value of this expression is TRUE-VALUE if TEST is true,
12114 otherwise it is FALSE-VALUE.
12116 `(cond [TEST1 VALUE1 ...] DEFAULT)'
12117 The first operand of this expression is a vector containing an even
12118 number of expressions and consisting of pairs of TEST and VALUE
12119 expressions. The value of the `cond' expression is that of the
12120 VALUE corresponding to the first true TEST expression. If none of
12121 the TEST expressions are true, the value of the `cond' expression
12122 is that of the DEFAULT expression.
12124 TEST expressions can have one of the following forms:
12127 This test is true if I is nonzero and false otherwise.
12130 `(ior TEST1 TEST2)'
12131 `(and TEST1 TEST2)'
12132 These tests are true if the indicated logical function is true.
12134 `(match_operand:M N PRED CONSTRAINTS)'
12135 This test is true if operand N of the insn whose attribute value
12136 is being determined has mode M (this part of the test is ignored
12137 if M is `VOIDmode') and the function specified by the string PRED
12138 returns a nonzero value when passed operand N and mode M (this
12139 part of the test is ignored if PRED is the null string).
12141 The CONSTRAINTS operand is ignored and should be the null string.
12143 `(le ARITH1 ARITH2)'
12144 `(leu ARITH1 ARITH2)'
12145 `(lt ARITH1 ARITH2)'
12146 `(ltu ARITH1 ARITH2)'
12147 `(gt ARITH1 ARITH2)'
12148 `(gtu ARITH1 ARITH2)'
12149 `(ge ARITH1 ARITH2)'
12150 `(geu ARITH1 ARITH2)'
12151 `(ne ARITH1 ARITH2)'
12152 `(eq ARITH1 ARITH2)'
12153 These tests are true if the indicated comparison of the two
12154 arithmetic expressions is true. Arithmetic expressions are formed
12155 with `plus', `minus', `mult', `div', `mod', `abs', `neg', `and',
12156 `ior', `xor', `not', `ashift', `lshiftrt', and `ashiftrt'
12159 `const_int' and `symbol_ref' are always valid terms (*note Insn
12160 Lengths::,for additional forms). `symbol_ref' is a string
12161 denoting a C expression that yields an `int' when evaluated by the
12162 `get_attr_...' routine. It should normally be a global variable.
12164 `(eq_attr NAME VALUE)'
12165 NAME is a string specifying the name of an attribute.
12167 VALUE is a string that is either a valid value for attribute NAME,
12168 a comma-separated list of values, or `!' followed by a value or
12169 list. If VALUE does not begin with a `!', this test is true if
12170 the value of the NAME attribute of the current insn is in the list
12171 specified by VALUE. If VALUE begins with a `!', this test is true
12172 if the attribute's value is _not_ in the specified list.
12176 (eq_attr "type" "load,store")
12180 (ior (eq_attr "type" "load") (eq_attr "type" "store"))
12182 If NAME specifies an attribute of `alternative', it refers to the
12183 value of the compiler variable `which_alternative' (*note Output
12184 Statement::) and the values must be small integers. For example,
12186 (eq_attr "alternative" "2,3")
12190 (ior (eq (symbol_ref "which_alternative") (const_int 2))
12191 (eq (symbol_ref "which_alternative") (const_int 3)))
12193 Note that, for most attributes, an `eq_attr' test is simplified in
12194 cases where the value of the attribute being tested is known for
12195 all insns matching a particular pattern. This is by far the most
12199 The value of an `attr_flag' expression is true if the flag
12200 specified by NAME is true for the `insn' currently being scheduled.
12202 NAME is a string specifying one of a fixed set of flags to test.
12203 Test the flags `forward' and `backward' to determine the direction
12204 of a conditional branch. Test the flags `very_likely', `likely',
12205 `very_unlikely', and `unlikely' to determine if a conditional
12206 branch is expected to be taken.
12208 If the `very_likely' flag is true, then the `likely' flag is also
12209 true. Likewise for the `very_unlikely' and `unlikely' flags.
12211 This example describes a conditional branch delay slot which can
12212 be nullified for forward branches that are taken (annul-true) or
12213 for backward branches which are not taken (annul-false).
12215 (define_delay (eq_attr "type" "cbranch")
12216 [(eq_attr "in_branch_delay" "true")
12217 (and (eq_attr "in_branch_delay" "true")
12218 (attr_flag "forward"))
12219 (and (eq_attr "in_branch_delay" "true")
12220 (attr_flag "backward"))])
12222 The `forward' and `backward' flags are false if the current `insn'
12223 being scheduled is not a conditional branch.
12225 The `very_likely' and `likely' flags are true if the `insn' being
12226 scheduled is not a conditional branch. The `very_unlikely' and
12227 `unlikely' flags are false if the `insn' being scheduled is not a
12228 conditional branch.
12230 `attr_flag' is only used during delay slot scheduling and has no
12231 meaning to other passes of the compiler.
12234 The value of another attribute is returned. This is most useful
12235 for numeric attributes, as `eq_attr' and `attr_flag' produce more
12236 efficient code for non-numeric attributes.
12239 File: gccint.info, Node: Tagging Insns, Next: Attr Example, Prev: Expressions, Up: Insn Attributes
12241 Assigning Attribute Values to Insns
12242 -----------------------------------
12244 The value assigned to an attribute of an insn is primarily
12245 determined by which pattern is matched by that insn (or which
12246 `define_peephole' generated it). Every `define_insn' and
12247 `define_peephole' can have an optional last argument to specify the
12248 values of attributes for matching insns. The value of any attribute
12249 not specified in a particular insn is set to the default value for that
12250 attribute, as specified in its `define_attr'. Extensive use of default
12251 values for attributes permits the specification of the values for only
12252 one or two attributes in the definition of most insn patterns, as seen
12253 in the example in the next section.
12255 The optional last argument of `define_insn' and `define_peephole' is
12256 a vector of expressions, each of which defines the value for a single
12257 attribute. The most general way of assigning an attribute's value is
12258 to use a `set' expression whose first operand is an `attr' expression
12259 giving the name of the attribute being set. The second operand of the
12260 `set' is an attribute expression (*note Expressions::) giving the value
12263 When the attribute value depends on the `alternative' attribute
12264 (i.e., which is the applicable alternative in the constraint of the
12265 insn), the `set_attr_alternative' expression can be used. It allows
12266 the specification of a vector of attribute expressions, one for each
12269 When the generality of arbitrary attribute expressions is not
12270 required, the simpler `set_attr' expression can be used, which allows
12271 specifying a string giving either a single attribute value or a list of
12272 attribute values, one for each alternative.
12274 The form of each of the above specifications is shown below. In
12275 each case, NAME is a string specifying the attribute to be set.
12277 `(set_attr NAME VALUE-STRING)'
12278 VALUE-STRING is either a string giving the desired attribute value,
12279 or a string containing a comma-separated list giving the values for
12280 succeeding alternatives. The number of elements must match the
12281 number of alternatives in the constraint of the insn pattern.
12283 Note that it may be useful to specify `*' for some alternative, in
12284 which case the attribute will assume its default value for insns
12285 matching that alternative.
12287 `(set_attr_alternative NAME [VALUE1 VALUE2 ...])'
12288 Depending on the alternative of the insn, the value will be one of
12289 the specified values. This is a shorthand for using a `cond' with
12290 tests on the `alternative' attribute.
12292 `(set (attr NAME) VALUE)'
12293 The first operand of this `set' must be the special RTL expression
12294 `attr', whose sole operand is a string giving the name of the
12295 attribute being set. VALUE is the value of the attribute.
12297 The following shows three different ways of representing the same
12298 attribute value specification:
12300 (set_attr "type" "load,store,arith")
12302 (set_attr_alternative "type"
12303 [(const_string "load") (const_string "store")
12304 (const_string "arith")])
12307 (cond [(eq_attr "alternative" "1") (const_string "load")
12308 (eq_attr "alternative" "2") (const_string "store")]
12309 (const_string "arith")))
12311 The `define_asm_attributes' expression provides a mechanism to
12312 specify the attributes assigned to insns produced from an `asm'
12313 statement. It has the form:
12315 (define_asm_attributes [ATTR-SETS])
12317 where ATTR-SETS is specified the same as for both the `define_insn' and
12318 the `define_peephole' expressions.
12320 These values will typically be the "worst case" attribute values.
12321 For example, they might indicate that the condition code will be
12324 A specification for a `length' attribute is handled specially. The
12325 way to compute the length of an `asm' insn is to multiply the length
12326 specified in the expression `define_asm_attributes' by the number of
12327 machine instructions specified in the `asm' statement, determined by
12328 counting the number of semicolons and newlines in the string.
12329 Therefore, the value of the `length' attribute specified in a
12330 `define_asm_attributes' should be the maximum possible length of a
12331 single machine instruction.
12334 File: gccint.info, Node: Attr Example, Next: Insn Lengths, Prev: Tagging Insns, Up: Insn Attributes
12336 Example of Attribute Specifications
12337 -----------------------------------
12339 The judicious use of defaulting is important in the efficient use of
12340 insn attributes. Typically, insns are divided into "types" and an
12341 attribute, customarily called `type', is used to represent this value.
12342 This attribute is normally used only to define the default value for
12343 other attributes. An example will clarify this usage.
12345 Assume we have a RISC machine with a condition code and in which only
12346 full-word operations are performed in registers. Let us assume that we
12347 can divide all insns into loads, stores, (integer) arithmetic
12348 operations, floating point operations, and branches.
12350 Here we will concern ourselves with determining the effect of an
12351 insn on the condition code and will limit ourselves to the following
12352 possible effects: The condition code can be set unpredictably
12353 (clobbered), not be changed, be set to agree with the results of the
12354 operation, or only changed if the item previously set into the
12355 condition code has been modified.
12357 Here is part of a sample `md' file for such a machine:
12359 (define_attr "type" "load,store,arith,fp,branch" (const_string "arith"))
12361 (define_attr "cc" "clobber,unchanged,set,change0"
12362 (cond [(eq_attr "type" "load")
12363 (const_string "change0")
12364 (eq_attr "type" "store,branch")
12365 (const_string "unchanged")
12366 (eq_attr "type" "arith")
12367 (if_then_else (match_operand:SI 0 "" "")
12368 (const_string "set")
12369 (const_string "clobber"))]
12370 (const_string "clobber")))
12373 [(set (match_operand:SI 0 "general_operand" "=r,r,m")
12374 (match_operand:SI 1 "general_operand" "r,m,r"))]
12380 [(set_attr "type" "arith,load,store")])
12382 Note that we assume in the above example that arithmetic operations
12383 performed on quantities smaller than a machine word clobber the
12384 condition code since they will set the condition code to a value
12385 corresponding to the full-word result.
12388 File: gccint.info, Node: Insn Lengths, Next: Constant Attributes, Prev: Attr Example, Up: Insn Attributes
12390 Computing the Length of an Insn
12391 -------------------------------
12393 For many machines, multiple types of branch instructions are
12394 provided, each for different length branch displacements. In most
12395 cases, the assembler will choose the correct instruction to use.
12396 However, when the assembler cannot do so, GCC can when a special
12397 attribute, the `length' attribute, is defined. This attribute must be
12398 defined to have numeric values by specifying a null string in its
12401 In the case of the `length' attribute, two additional forms of
12402 arithmetic terms are allowed in test expressions:
12405 This refers to the address of operand N of the current insn, which
12406 must be a `label_ref'.
12409 This refers to the address of the _current_ insn. It might have
12410 been more consistent with other usage to make this the address of
12411 the _next_ insn but this would be confusing because the length of
12412 the current insn is to be computed.
12414 For normal insns, the length will be determined by value of the
12415 `length' attribute. In the case of `addr_vec' and `addr_diff_vec' insn
12416 patterns, the length is computed as the number of vectors multiplied by
12417 the size of each vector.
12419 Lengths are measured in addressable storage units (bytes).
12421 The following macros can be used to refine the length computation:
12423 `ADJUST_INSN_LENGTH (INSN, LENGTH)'
12424 If defined, modifies the length assigned to instruction INSN as a
12425 function of the context in which it is used. LENGTH is an lvalue
12426 that contains the initially computed length of the insn and should
12427 be updated with the correct length of the insn.
12429 This macro will normally not be required. A case in which it is
12430 required is the ROMP. On this machine, the size of an `addr_vec'
12431 insn must be increased by two to compensate for the fact that
12432 alignment may be required.
12434 The routine that returns `get_attr_length' (the value of the
12435 `length' attribute) can be used by the output routine to determine the
12436 form of the branch instruction to be written, as the example below
12439 As an example of the specification of variable-length branches,
12440 consider the IBM 360. If we adopt the convention that a register will
12441 be set to the starting address of a function, we can jump to labels
12442 within 4k of the start using a four-byte instruction. Otherwise, we
12443 need a six-byte sequence to load the address from memory and then
12446 On such a machine, a pattern for a branch instruction might be
12447 specified as follows:
12449 (define_insn "jump"
12451 (label_ref (match_operand 0 "" "")))]
12454 return (get_attr_length (insn) == 4
12455 ? "b %l0" : "l r15,=a(%l0); br r15");
12457 [(set (attr "length")
12458 (if_then_else (lt (match_dup 0) (const_int 4096))
12463 File: gccint.info, Node: Constant Attributes, Next: Delay Slots, Prev: Insn Lengths, Up: Insn Attributes
12465 Constant Attributes
12466 -------------------
12468 A special form of `define_attr', where the expression for the
12469 default value is a `const' expression, indicates an attribute that is
12470 constant for a given run of the compiler. Constant attributes may be
12471 used to specify which variety of processor is used. For example,
12473 (define_attr "cpu" "m88100,m88110,m88000"
12475 (cond [(symbol_ref "TARGET_88100") (const_string "m88100")
12476 (symbol_ref "TARGET_88110") (const_string "m88110")]
12477 (const_string "m88000"))))
12479 (define_attr "memory" "fast,slow"
12481 (if_then_else (symbol_ref "TARGET_FAST_MEM")
12482 (const_string "fast")
12483 (const_string "slow"))))
12485 The routine generated for constant attributes has no parameters as it
12486 does not depend on any particular insn. RTL expressions used to define
12487 the value of a constant attribute may use the `symbol_ref' form, but
12488 may not use either the `match_operand' form or `eq_attr' forms
12489 involving insn attributes.
12492 File: gccint.info, Node: Delay Slots, Next: Processor pipeline description, Prev: Constant Attributes, Up: Insn Attributes
12494 Delay Slot Scheduling
12495 ---------------------
12497 The insn attribute mechanism can be used to specify the requirements
12498 for delay slots, if any, on a target machine. An instruction is said to
12499 require a "delay slot" if some instructions that are physically after
12500 the instruction are executed as if they were located before it.
12501 Classic examples are branch and call instructions, which often execute
12502 the following instruction before the branch or call is performed.
12504 On some machines, conditional branch instructions can optionally
12505 "annul" instructions in the delay slot. This means that the
12506 instruction will not be executed for certain branch outcomes. Both
12507 instructions that annul if the branch is true and instructions that
12508 annul if the branch is false are supported.
12510 Delay slot scheduling differs from instruction scheduling in that
12511 determining whether an instruction needs a delay slot is dependent only
12512 on the type of instruction being generated, not on data flow between the
12513 instructions. See the next section for a discussion of data-dependent
12514 instruction scheduling.
12516 The requirement of an insn needing one or more delay slots is
12517 indicated via the `define_delay' expression. It has the following form:
12520 [DELAY-1 ANNUL-TRUE-1 ANNUL-FALSE-1
12521 DELAY-2 ANNUL-TRUE-2 ANNUL-FALSE-2
12524 TEST is an attribute test that indicates whether this `define_delay'
12525 applies to a particular insn. If so, the number of required delay
12526 slots is determined by the length of the vector specified as the second
12527 argument. An insn placed in delay slot N must satisfy attribute test
12528 DELAY-N. ANNUL-TRUE-N is an attribute test that specifies which insns
12529 may be annulled if the branch is true. Similarly, ANNUL-FALSE-N
12530 specifies which insns in the delay slot may be annulled if the branch
12531 is false. If annulling is not supported for that delay slot, `(nil)'
12534 For example, in the common case where branch and call insns require
12535 a single delay slot, which may contain any insn other than a branch or
12536 call, the following would be placed in the `md' file:
12538 (define_delay (eq_attr "type" "branch,call")
12539 [(eq_attr "type" "!branch,call") (nil) (nil)])
12541 Multiple `define_delay' expressions may be specified. In this case,
12542 each such expression specifies different delay slot requirements and
12543 there must be no insn for which tests in two `define_delay' expressions
12546 For example, if we have a machine that requires one delay slot for
12547 branches but two for calls, no delay slot can contain a branch or call
12548 insn, and any valid insn in the delay slot for the branch can be
12549 annulled if the branch is true, we might represent this as follows:
12551 (define_delay (eq_attr "type" "branch")
12552 [(eq_attr "type" "!branch,call")
12553 (eq_attr "type" "!branch,call")
12556 (define_delay (eq_attr "type" "call")
12557 [(eq_attr "type" "!branch,call") (nil) (nil)
12558 (eq_attr "type" "!branch,call") (nil) (nil)])
12561 File: gccint.info, Node: Processor pipeline description, Prev: Delay Slots, Up: Insn Attributes
12563 Specifying processor pipeline description
12564 -----------------------------------------
12566 To achieve better performance, most modern processors
12567 (super-pipelined, superscalar RISC, and VLIW processors) have many
12568 "functional units" on which several instructions can be executed
12569 simultaneously. An instruction starts execution if its issue
12570 conditions are satisfied. If not, the instruction is stalled until its
12571 conditions are satisfied. Such "interlock (pipeline) delay" causes
12572 interruption of the fetching of successor instructions (or demands nop
12573 instructions, e.g. for some MIPS processors).
12575 There are two major kinds of interlock delays in modern processors.
12576 The first one is a data dependence delay determining "instruction
12577 latency time". The instruction execution is not started until all
12578 source data have been evaluated by prior instructions (there are more
12579 complex cases when the instruction execution starts even when the data
12580 are not available but will be ready in given time after the instruction
12581 execution start). Taking the data dependence delays into account is
12582 simple. The data dependence (true, output, and anti-dependence) delay
12583 between two instructions is given by a constant. In most cases this
12584 approach is adequate. The second kind of interlock delays is a
12585 reservation delay. The reservation delay means that two instructions
12586 under execution will be in need of shared processors resources, i.e.
12587 buses, internal registers, and/or functional units, which are reserved
12588 for some time. Taking this kind of delay into account is complex
12589 especially for modern RISC processors.
12591 The task of exploiting more processor parallelism is solved by an
12592 instruction scheduler. For a better solution to this problem, the
12593 instruction scheduler has to have an adequate description of the
12594 processor parallelism (or "pipeline description"). Currently GCC
12595 provides two alternative ways to describe processor parallelism, both
12596 described below. The first method is outlined in the next section; it
12597 was once the only method provided by GCC, and thus is used in a number
12598 of exiting ports. The second, and preferred method, specifies
12599 functional unit reservations for groups of instructions with the aid of
12600 "regular expressions". This is called the "automaton based
12603 The GCC instruction scheduler uses a "pipeline hazard recognizer" to
12604 figure out the possibility of the instruction issue by the processor on
12605 a given simulated processor cycle. The pipeline hazard recognizer is
12606 automatically generated from the processor pipeline description. The
12607 pipeline hazard recognizer generated from the automaton based
12608 description is more sophisticated and based on a deterministic finite
12609 state automaton (DFA) and therefore faster than one generated from the
12610 old description. Furthermore, its speed is not dependent on processor
12611 complexity. The instruction issue is possible if there is a transition
12612 from one automaton state to another one.
12614 You can use either model to describe processor pipeline
12615 characteristics or even mix them. You could use the old description
12616 for some processor submodels and the DFA-based one for other processor
12619 In general, using the automaton based description is preferred. Its
12620 model is richer and makes it possible to more accurately describe
12621 pipeline characteristics of processors, which results in improved code
12622 quality (although sometimes only marginally). It will also be used as
12623 an infrastructure to implement sophisticated and practical instruction
12624 scheduling which will try many instruction sequences to choose the best
12629 * Old pipeline description:: Specifying information for insn scheduling.
12630 * Automaton pipeline description:: Describing insn pipeline characteristics.
12631 * Comparison of the two descriptions:: Drawbacks of the old pipeline description
12634 File: gccint.info, Node: Old pipeline description, Next: Automaton pipeline description, Up: Processor pipeline description
12636 Specifying Function Units
12637 .........................
12639 On most RISC machines, there are instructions whose results are not
12640 available for a specific number of cycles. Common cases are
12641 instructions that load data from memory. On many machines, a pipeline
12642 stall will result if the data is referenced too soon after the load
12645 In addition, many newer microprocessors have multiple function
12646 units, usually one for integer and one for floating point, and often
12647 will incur pipeline stalls when a result that is needed is not yet
12650 The descriptions in this section allow the specification of how much
12651 time must elapse between the execution of an instruction and the time
12652 when its result is used. It also allows specification of when the
12653 execution of an instruction will delay execution of similar instructions
12654 due to function unit conflicts.
12656 For the purposes of the specifications in this section, a machine is
12657 divided into "function units", each of which execute a specific class
12658 of instructions in first-in-first-out order. Function units that
12659 accept one instruction each cycle and allow a result to be used in the
12660 succeeding instruction (usually via forwarding) need not be specified.
12661 Classic RISC microprocessors will normally have a single function unit,
12662 which we can call `memory'. The newer "superscalar" processors will
12663 often have function units for floating point operations, usually at
12664 least a floating point adder and multiplier.
12666 Each usage of a function units by a class of insns is specified with
12667 a `define_function_unit' expression, which looks like this:
12669 (define_function_unit NAME MULTIPLICITY SIMULTANEITY
12670 TEST READY-DELAY ISSUE-DELAY
12673 NAME is a string giving the name of the function unit.
12675 MULTIPLICITY is an integer specifying the number of identical units
12676 in the processor. If more than one unit is specified, they will be
12677 scheduled independently. Only truly independent units should be
12678 counted; a pipelined unit should be specified as a single unit. (The
12679 only common example of a machine that has multiple function units for a
12680 single instruction class that are truly independent and not pipelined
12681 are the two multiply and two increment units of the CDC 6600.)
12683 SIMULTANEITY specifies the maximum number of insns that can be
12684 executing in each instance of the function unit simultaneously or zero
12685 if the unit is pipelined and has no limit.
12687 All `define_function_unit' definitions referring to function unit
12688 NAME must have the same name and values for MULTIPLICITY and
12691 TEST is an attribute test that selects the insns we are describing
12692 in this definition. Note that an insn may use more than one function
12693 unit and a function unit may be specified in more than one
12694 `define_function_unit'.
12696 READY-DELAY is an integer that specifies the number of cycles after
12697 which the result of the instruction can be used without introducing any
12700 ISSUE-DELAY is an integer that specifies the number of cycles after
12701 the instruction matching the TEST expression begins using this unit
12702 until a subsequent instruction can begin. A cost of N indicates an N-1
12703 cycle delay. A subsequent instruction may also be delayed if an
12704 earlier instruction has a longer READY-DELAY value. This blocking
12705 effect is computed using the SIMULTANEITY, READY-DELAY, ISSUE-DELAY,
12706 and CONFLICT-LIST terms. For a normal non-pipelined function unit,
12707 SIMULTANEITY is one, the unit is taken to block for the READY-DELAY
12708 cycles of the executing insn, and smaller values of ISSUE-DELAY are
12711 CONFLICT-LIST is an optional list giving detailed conflict costs for
12712 this unit. If specified, it is a list of condition test expressions to
12713 be applied to insns chosen to execute in NAME following the particular
12714 insn matching TEST that is already executing in NAME. For each insn in
12715 the list, ISSUE-DELAY specifies the conflict cost; for insns not in the
12716 list, the cost is zero. If not specified, CONFLICT-LIST defaults to
12717 all instructions that use the function unit.
12719 Typical uses of this vector are where a floating point function unit
12720 can pipeline either single- or double-precision operations, but not
12721 both, or where a memory unit can pipeline loads, but not stores, etc.
12723 As an example, consider a classic RISC machine where the result of a
12724 load instruction is not available for two cycles (a single "delay"
12725 instruction is required) and where only one load instruction can be
12726 executed simultaneously. This would be specified as:
12728 (define_function_unit "memory" 1 1 (eq_attr "type" "load") 2 0)
12730 For the case of a floating point function unit that can pipeline
12731 either single or double precision, but not both, the following could be
12734 (define_function_unit
12735 "fp" 1 0 (eq_attr "type" "sp_fp") 4 4 [(eq_attr "type" "dp_fp")])
12736 (define_function_unit
12737 "fp" 1 0 (eq_attr "type" "dp_fp") 4 4 [(eq_attr "type" "sp_fp")])
12739 *Note:* The scheduler attempts to avoid function unit conflicts and
12740 uses all the specifications in the `define_function_unit' expression.
12741 It has recently been discovered that these specifications may not allow
12742 modeling of some of the newer "superscalar" processors that have insns
12743 using multiple pipelined units. These insns will cause a potential
12744 conflict for the second unit used during their execution and there is
12745 no way of representing that conflict. Any examples of how function
12746 unit conflicts work in such processors and suggestions for their
12747 representation would be welcomed.
12750 File: gccint.info, Node: Automaton pipeline description, Next: Comparison of the two descriptions, Prev: Old pipeline description, Up: Processor pipeline description
12752 Describing instruction pipeline characteristics
12753 ...............................................
12755 This section describes constructions of the automaton based processor
12756 pipeline description. The order of constructions within the machine
12757 description file is not important.
12759 The following optional construction describes names of automata
12760 generated and used for the pipeline hazards recognition. Sometimes the
12761 generated finite state automaton used by the pipeline hazard recognizer
12762 is large. If we use more than one automaton and bind functional units
12763 to the automata, the total size of the automata is usually less than
12764 the size of the single automaton. If there is no one such
12765 construction, only one finite state automaton is generated.
12767 (define_automaton AUTOMATA-NAMES)
12769 AUTOMATA-NAMES is a string giving names of the automata. The names
12770 are separated by commas. All the automata should have unique names.
12771 The automaton name is used in the constructions `define_cpu_unit' and
12772 `define_query_cpu_unit'.
12774 Each processor functional unit used in the description of instruction
12775 reservations should be described by the following construction.
12777 (define_cpu_unit UNIT-NAMES [AUTOMATON-NAME])
12779 UNIT-NAMES is a string giving the names of the functional units
12780 separated by commas. Don't use name `nothing', it is reserved for
12783 AUTOMATON-NAME is a string giving the name of the automaton with
12784 which the unit is bound. The automaton should be described in
12785 construction `define_automaton'. You should give "automaton-name", if
12786 there is a defined automaton.
12788 The assignment of units to automata are constrained by the uses of
12789 the units in insn reservations. The most important constraint is: if a
12790 unit reservation is present on a particular cycle of an alternative for
12791 an insn reservation, then some unit from the same automaton must be
12792 present on the same cycle for the other alternatives of the insn
12793 reservation. The rest of the constraints are mentioned in the
12794 description of the subsequent constructions.
12796 The following construction describes CPU functional units analogously
12797 to `define_cpu_unit'. The reservation of such units can be queried for
12798 an automaton state. The instruction scheduler never queries
12799 reservation of functional units for given automaton state. So as a
12800 rule, you don't need this construction. This construction could be
12801 used for future code generation goals (e.g. to generate VLIW insn
12804 (define_query_cpu_unit UNIT-NAMES [AUTOMATON-NAME])
12806 UNIT-NAMES is a string giving names of the functional units
12807 separated by commas.
12809 AUTOMATON-NAME is a string giving the name of the automaton with
12810 which the unit is bound.
12812 The following construction is the major one to describe pipeline
12813 characteristics of an instruction.
12815 (define_insn_reservation INSN-NAME DEFAULT_LATENCY
12818 DEFAULT_LATENCY is a number giving latency time of the instruction.
12819 There is an important difference between the old description and the
12820 automaton based pipeline description. The latency time is used for all
12821 dependencies when we use the old description. In the automaton based
12822 pipeline description, the given latency time is only used for true
12823 dependencies. The cost of anti-dependencies is always zero and the
12824 cost of output dependencies is the difference between latency times of
12825 the producing and consuming insns (if the difference is negative, the
12826 cost is considered to be zero). You can always change the default
12827 costs for any description by using the target hook
12828 `TARGET_SCHED_ADJUST_COST' (*note Scheduling::).
12830 INSN-NAME is a string giving the internal name of the insn. The
12831 internal names are used in constructions `define_bypass' and in the
12832 automaton description file generated for debugging. The internal name
12833 has nothing in common with the names in `define_insn'. It is a good
12834 practice to use insn classes described in the processor manual.
12836 CONDITION defines what RTL insns are described by this construction.
12837 You should remember that you will be in trouble if CONDITION for two
12838 or more different `define_insn_reservation' constructions is TRUE for
12839 an insn. In this case what reservation will be used for the insn is
12840 not defined. Such cases are not checked during generation of the
12841 pipeline hazards recognizer because in general recognizing that two
12842 conditions may have the same value is quite difficult (especially if
12843 the conditions contain `symbol_ref'). It is also not checked during the
12844 pipeline hazard recognizer work because it would slow down the
12845 recognizer considerably.
12847 REGEXP is a string describing the reservation of the cpu's functional
12848 units by the instruction. The reservations are described by a regular
12849 expression according to the following syntax:
12851 regexp = regexp "," oneof
12854 oneof = oneof "|" allof
12857 allof = allof "+" repeat
12860 repeat = element "*" number
12863 element = cpu_function_unit_name
12869 * `,' is used for describing the start of the next cycle in the
12872 * `|' is used for describing a reservation described by the first
12873 regular expression *or* a reservation described by the second
12874 regular expression *or* etc.
12876 * `+' is used for describing a reservation described by the first
12877 regular expression *and* a reservation described by the second
12878 regular expression *and* etc.
12880 * `*' is used for convenience and simply means a sequence in which
12881 the regular expression are repeated NUMBER times with cycle
12882 advancing (see `,').
12884 * `cpu_function_unit_name' denotes reservation of the named
12887 * `reservation_name' -- see description of construction
12888 `define_reservation'.
12890 * `nothing' denotes no unit reservations.
12892 Sometimes unit reservations for different insns contain common parts.
12893 In such case, you can simplify the pipeline description by describing
12894 the common part by the following construction
12896 (define_reservation RESERVATION-NAME REGEXP)
12898 RESERVATION-NAME is a string giving name of REGEXP. Functional unit
12899 names and reservation names are in the same name space. So the
12900 reservation names should be different from the functional unit names
12901 and can not be the reserved name `nothing'.
12903 The following construction is used to describe exceptions in the
12904 latency time for given instruction pair. This is so called bypasses.
12906 (define_bypass NUMBER OUT_INSN_NAMES IN_INSN_NAMES
12909 NUMBER defines when the result generated by the instructions given
12910 in string OUT_INSN_NAMES will be ready for the instructions given in
12911 string IN_INSN_NAMES. The instructions in the string are separated by
12914 GUARD is an optional string giving the name of a C function which
12915 defines an additional guard for the bypass. The function will get the
12916 two insns as parameters. If the function returns zero the bypass will
12917 be ignored for this case. The additional guard is necessary to
12918 recognize complicated bypasses, e.g. when the consumer is only an
12919 address of insn `store' (not a stored value).
12921 The following five constructions are usually used to describe VLIW
12922 processors, or more precisely, to describe a placement of small
12923 instructions into VLIW instruction slots. They can be used for RISC
12926 (exclusion_set UNIT-NAMES UNIT-NAMES)
12927 (presence_set UNIT-NAMES PATTERNS)
12928 (final_presence_set UNIT-NAMES PATTERNS)
12929 (absence_set UNIT-NAMES PATTERNS)
12930 (final_absence_set UNIT-NAMES PATTERNS)
12932 UNIT-NAMES is a string giving names of functional units separated by
12935 PATTERNS is a string giving patterns of functional units separated
12936 by comma. Currently pattern is is one unit or units separated by
12939 The first construction (`exclusion_set') means that each functional
12940 unit in the first string can not be reserved simultaneously with a unit
12941 whose name is in the second string and vice versa. For example, the
12942 construction is useful for describing processors (e.g. some SPARC
12943 processors) with a fully pipelined floating point functional unit which
12944 can execute simultaneously only single floating point insns or only
12945 double floating point insns.
12947 The second construction (`presence_set') means that each functional
12948 unit in the first string can not be reserved unless at least one of
12949 pattern of units whose names are in the second string is reserved.
12950 This is an asymmetric relation. For example, it is useful for
12951 description that VLIW `slot1' is reserved after `slot0' reservation.
12952 We could describe it by the following construction
12954 (presence_set "slot1" "slot0")
12956 Or `slot1' is reserved only after `slot0' and unit `b0' reservation.
12957 In this case we could write
12959 (presence_set "slot1" "slot0 b0")
12961 The third construction (`final_presence_set') is analogous to
12962 `presence_set'. The difference between them is when checking is done.
12963 When an instruction is issued in given automaton state reflecting all
12964 current and planned unit reservations, the automaton state is changed.
12965 The first state is a source state, the second one is a result state.
12966 Checking for `presence_set' is done on the source state reservation,
12967 checking for `final_presence_set' is done on the result reservation.
12968 This construction is useful to describe a reservation which is actually
12969 two subsequent reservations. For example, if we use
12971 (presence_set "slot1" "slot0")
12973 the following insn will be never issued (because `slot1' requires
12974 `slot0' which is absent in the source state).
12976 (define_reservation "insn_and_nop" "slot0 + slot1")
12978 but it can be issued if we use analogous `final_presence_set'.
12980 The forth construction (`absence_set') means that each functional
12981 unit in the first string can be reserved only if each pattern of units
12982 whose names are in the second string is not reserved. This is an
12983 asymmetric relation (actually `exclusion_set' is analogous to this one
12984 but it is symmetric). For example, it is useful for description that
12985 VLIW `slot0' can not be reserved after `slot1' or `slot2' reservation.
12986 We could describe it by the following construction
12988 (absence_set "slot2" "slot0, slot1")
12990 Or `slot2' can not be reserved if `slot0' and unit `b0' are reserved
12991 or `slot1' and unit `b1' are reserved. In this case we could write
12993 (absence_set "slot2" "slot0 b0, slot1 b1")
12995 All functional units mentioned in a set should belong to the same
12998 The last construction (`final_absence_set') is analogous to
12999 `absence_set' but checking is done on the result (state) reservation.
13000 See comments for `final_presence_set'.
13002 You can control the generator of the pipeline hazard recognizer with
13003 the following construction.
13005 (automata_option OPTIONS)
13007 OPTIONS is a string giving options which affect the generated code.
13008 Currently there are the following options:
13010 * "no-minimization" makes no minimization of the automaton. This is
13011 only worth to do when we are debugging the description and need to
13012 look more accurately at reservations of states.
13014 * "time" means printing additional time statistics about generation
13017 * "v" means a generation of the file describing the result automata.
13018 The file has suffix `.dfa' and can be used for the description
13019 verification and debugging.
13021 * "w" means a generation of warning instead of error for
13022 non-critical errors.
13024 * "ndfa" makes nondeterministic finite state automata. This affects
13025 the treatment of operator `|' in the regular expressions. The
13026 usual treatment of the operator is to try the first alternative
13027 and, if the reservation is not possible, the second alternative.
13028 The nondeterministic treatment means trying all alternatives, some
13029 of them may be rejected by reservations in the subsequent insns.
13030 You can not query functional unit reservations in nondeterministic
13033 * "progress" means output of a progress bar showing how many states
13034 were generated so far for automaton being processed. This is
13035 useful during debugging a DFA description. If you see too many
13036 generated states, you could interrupt the generator of the pipeline
13037 hazard recognizer and try to figure out a reason for generation of
13038 the huge automaton.
13040 As an example, consider a superscalar RISC machine which can issue
13041 three insns (two integer insns and one floating point insn) on the
13042 cycle but can finish only two insns. To describe this, we define the
13043 following functional units.
13045 (define_cpu_unit "i0_pipeline, i1_pipeline, f_pipeline")
13046 (define_cpu_unit "port0, port1")
13048 All simple integer insns can be executed in any integer pipeline and
13049 their result is ready in two cycles. The simple integer insns are
13050 issued into the first pipeline unless it is reserved, otherwise they
13051 are issued into the second pipeline. Integer division and
13052 multiplication insns can be executed only in the second integer
13053 pipeline and their results are ready correspondingly in 8 and 4 cycles.
13054 The integer division is not pipelined, i.e. the subsequent integer
13055 division insn can not be issued until the current division insn
13056 finished. Floating point insns are fully pipelined and their results
13057 are ready in 3 cycles. Where the result of a floating point insn is
13058 used by an integer insn, an additional delay of one cycle is incurred.
13059 To describe all of this we could specify
13061 (define_cpu_unit "div")
13063 (define_insn_reservation "simple" 2 (eq_attr "type" "int")
13064 "(i0_pipeline | i1_pipeline), (port0 | port1)")
13066 (define_insn_reservation "mult" 4 (eq_attr "type" "mult")
13067 "i1_pipeline, nothing*2, (port0 | port1)")
13069 (define_insn_reservation "div" 8 (eq_attr "type" "div")
13070 "i1_pipeline, div*7, div + (port0 | port1)")
13072 (define_insn_reservation "float" 3 (eq_attr "type" "float")
13073 "f_pipeline, nothing, (port0 | port1))
13075 (define_bypass 4 "float" "simple,mult,div")
13077 To simplify the description we could describe the following
13080 (define_reservation "finish" "port0|port1")
13082 and use it in all `define_insn_reservation' as in the following
13085 (define_insn_reservation "simple" 2 (eq_attr "type" "int")
13086 "(i0_pipeline | i1_pipeline), finish")
13089 File: gccint.info, Node: Comparison of the two descriptions, Prev: Automaton pipeline description, Up: Processor pipeline description
13091 Drawbacks of the old pipeline description
13092 .........................................
13094 The old instruction level parallelism description and the pipeline
13095 hazards recognizer based on it have the following drawbacks in
13096 comparison with the DFA-based ones:
13098 * Each functional unit is believed to be reserved at the instruction
13099 execution start. This is a very inaccurate model for modern
13102 * An inadequate description of instruction latency times. The
13103 latency time is bound with a functional unit reserved by an
13104 instruction not with the instruction itself. In other words, the
13105 description is oriented to describe at most one unit reservation
13106 by each instruction. It also does not permit to describe special
13107 bypasses between instruction pairs.
13109 * The implementation of the pipeline hazard recognizer interface has
13110 constraints on number of functional units. This is a number of
13111 bits in integer on the host machine.
13113 * The interface to the pipeline hazard recognizer is more complex
13114 than one to the automaton based pipeline recognizer.
13116 * An unnatural description when you write a unit and a condition
13117 which selects instructions using the unit. Writing all unit
13118 reservations for an instruction (an instruction class) is more
13121 * The recognition of the interlock delays has a slow implementation.
13122 The GCC scheduler supports structures which describe the unit
13123 reservations. The more functional units a processor has, the
13124 slower its pipeline hazard recognizer will be. Such an
13125 implementation would become even slower when we allowed to reserve
13126 functional units not only at the instruction execution start. In
13127 an automaton based pipeline hazard recognizer, speed is not
13128 dependent on processor complexity.
13131 File: gccint.info, Node: Conditional Execution, Next: Constant Definitions, Prev: Insn Attributes, Up: Machine Desc
13133 Conditional Execution
13134 =====================
13136 A number of architectures provide for some form of conditional
13137 execution, or predication. The hallmark of this feature is the ability
13138 to nullify most of the instructions in the instruction set. When the
13139 instruction set is large and not entirely symmetric, it can be quite
13140 tedious to describe these forms directly in the `.md' file. An
13141 alternative is the `define_cond_exec' template.
13144 [PREDICATE-PATTERN]
13148 PREDICATE-PATTERN is the condition that must be true for the insn to
13149 be executed at runtime and should match a relational operator. One can
13150 use `match_operator' to match several relational operators at once.
13151 Any `match_operand' operands must have no more than one alternative.
13153 CONDITION is a C expression that must be true for the generated
13156 OUTPUT-TEMPLATE is a string similar to the `define_insn' output
13157 template (*note Output Template::), except that the `*' and `@' special
13158 cases do not apply. This is only useful if the assembly text for the
13159 predicate is a simple prefix to the main insn. In order to handle the
13160 general case, there is a global variable `current_insn_predicate' that
13161 will contain the entire predicate if the current insn is predicated,
13162 and will otherwise be `NULL'.
13164 When `define_cond_exec' is used, an implicit reference to the
13165 `predicable' instruction attribute is made. *Note Insn Attributes::.
13166 This attribute must be boolean (i.e. have exactly two elements in its
13167 LIST-OF-VALUES). Further, it must not be used with complex
13168 expressions. That is, the default and all uses in the insns must be a
13169 simple constant, not dependent on the alternative or anything else.
13171 For each `define_insn' for which the `predicable' attribute is true,
13172 a new `define_insn' pattern will be generated that matches a predicated
13173 version of the instruction. For example,
13175 (define_insn "addsi"
13176 [(set (match_operand:SI 0 "register_operand" "r")
13177 (plus:SI (match_operand:SI 1 "register_operand" "r")
13178 (match_operand:SI 2 "register_operand" "r")))]
13183 [(ne (match_operand:CC 0 "register_operand" "c")
13188 generates a new pattern
13192 (ne (match_operand:CC 3 "register_operand" "c") (const_int 0))
13193 (set (match_operand:SI 0 "register_operand" "r")
13194 (plus:SI (match_operand:SI 1 "register_operand" "r")
13195 (match_operand:SI 2 "register_operand" "r"))))]
13196 "(TEST2) && (TEST1)"
13197 "(%3) add %2,%1,%0")
13200 File: gccint.info, Node: Constant Definitions, Prev: Conditional Execution, Up: Machine Desc
13202 Constant Definitions
13203 ====================
13205 Using literal constants inside instruction patterns reduces
13206 legibility and can be a maintenance problem.
13208 To overcome this problem, you may use the `define_constants'
13209 expression. It contains a vector of name-value pairs. From that point
13210 on, wherever any of the names appears in the MD file, it is as if the
13211 corresponding value had been written instead. You may use
13212 `define_constants' multiple times; each appearance adds more constants
13213 to the table. It is an error to redefine a constant with a different
13216 To come back to the a29k load multiple example, instead of
13219 [(match_parallel 0 "load_multiple_operation"
13220 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
13221 (match_operand:SI 2 "memory_operand" "m"))
13223 (clobber (reg:SI 179))])]
13229 (define_constants [
13237 [(match_parallel 0 "load_multiple_operation"
13238 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
13239 (match_operand:SI 2 "memory_operand" "m"))
13240 (use (reg:SI R_CR))
13241 (clobber (reg:SI R_CR))])]
13245 The constants that are defined with a define_constant are also output
13246 in the insn-codes.h header file as #defines.
13249 File: gccint.info, Node: Target Macros, Next: Host Config, Prev: Machine Desc, Up: Top
13251 Target Description Macros and Functions
13252 ***************************************
13254 In addition to the file `MACHINE.md', a machine description includes
13255 a C header file conventionally given the name `MACHINE.h' and a C
13256 source file named `MACHINE.c'. The header file defines numerous macros
13257 that convey the information about the target machine that does not fit
13258 into the scheme of the `.md' file. The file `tm.h' should be a link to
13259 `MACHINE.h'. The header file `config.h' includes `tm.h' and most
13260 compiler source files include `config.h'. The source file defines a
13261 variable `targetm', which is a structure containing pointers to
13262 functions and data relating to the target machine. `MACHINE.c' should
13263 also contain their definitions, if they are not defined elsewhere in
13264 GCC, and other functions called through the macros defined in the `.h'
13269 * Target Structure:: The `targetm' variable.
13270 * Driver:: Controlling how the driver runs the compilation passes.
13271 * Run-time Target:: Defining `-m' options like `-m68000' and `-m68020'.
13272 * Per-Function Data:: Defining data structures for per-function information.
13273 * Storage Layout:: Defining sizes and alignments of data.
13274 * Type Layout:: Defining sizes and properties of basic user data types.
13275 * Escape Sequences:: Defining the value of target character escape sequences
13276 * Registers:: Naming and describing the hardware registers.
13277 * Register Classes:: Defining the classes of hardware registers.
13278 * Stack and Calling:: Defining which way the stack grows and by how much.
13279 * Varargs:: Defining the varargs macros.
13280 * Trampolines:: Code set up at run time to enter a nested function.
13281 * Library Calls:: Controlling how library routines are implicitly called.
13282 * Addressing Modes:: Defining addressing modes valid for memory operands.
13283 * Condition Code:: Defining how insns update the condition code.
13284 * Costs:: Defining relative costs of different operations.
13285 * Scheduling:: Adjusting the behavior of the instruction scheduler.
13286 * Sections:: Dividing storage into text, data, and other sections.
13287 * PIC:: Macros for position independent code.
13288 * Assembler Format:: Defining how to write insns and pseudo-ops to output.
13289 * Debugging Info:: Defining the format of debugging output.
13290 * Floating Point:: Handling floating point for cross-compilers.
13291 * Mode Switching:: Insertion of mode-switching instructions.
13292 * Target Attributes:: Defining target-specific uses of `__attribute__'.
13293 * MIPS Coprocessors:: MIPS coprocessor support and how to customize it.
13294 * PCH Target:: Validity checking for precompiled headers.
13295 * Misc:: Everything else.
13298 File: gccint.info, Node: Target Structure, Next: Driver, Up: Target Macros
13300 The Global `targetm' Variable
13301 =============================
13303 - Variable: struct gcc_target targetm
13304 The target `.c' file must define the global `targetm' variable
13305 which contains pointers to functions and data relating to the
13306 target machine. The variable is declared in `target.h';
13307 `target-def.h' defines the macro `TARGET_INITIALIZER' which is
13308 used to initialize the variable, and macros for the default
13309 initializers for elements of the structure. The `.c' file should
13310 override those macros for which the default definition is
13311 inappropriate. For example:
13312 #include "target.h"
13313 #include "target-def.h"
13315 /* Initialize the GCC target structure. */
13317 #undef TARGET_COMP_TYPE_ATTRIBUTES
13318 #define TARGET_COMP_TYPE_ATTRIBUTES MACHINE_comp_type_attributes
13320 struct gcc_target targetm = TARGET_INITIALIZER;
13322 Where a macro should be defined in the `.c' file in this manner to
13323 form part of the `targetm' structure, it is documented below as a
13324 "Target Hook" with a prototype. Many macros will change in future from
13325 being defined in the `.h' file to being part of the `targetm' structure.
13328 File: gccint.info, Node: Driver, Next: Run-time Target, Prev: Target Structure, Up: Target Macros
13330 Controlling the Compilation Driver, `gcc'
13331 =========================================
13333 You can control the compilation driver.
13335 - Macro: SWITCH_TAKES_ARG (CHAR)
13336 A C expression which determines whether the option `-CHAR' takes
13337 arguments. The value should be the number of arguments that
13338 option takes-zero, for many options.
13340 By default, this macro is defined as `DEFAULT_SWITCH_TAKES_ARG',
13341 which handles the standard options properly. You need not define
13342 `SWITCH_TAKES_ARG' unless you wish to add additional options which
13343 take arguments. Any redefinition should call
13344 `DEFAULT_SWITCH_TAKES_ARG' and then check for additional options.
13346 - Macro: WORD_SWITCH_TAKES_ARG (NAME)
13347 A C expression which determines whether the option `-NAME' takes
13348 arguments. The value should be the number of arguments that
13349 option takes-zero, for many options. This macro rather than
13350 `SWITCH_TAKES_ARG' is used for multi-character option names.
13352 By default, this macro is defined as
13353 `DEFAULT_WORD_SWITCH_TAKES_ARG', which handles the standard options
13354 properly. You need not define `WORD_SWITCH_TAKES_ARG' unless you
13355 wish to add additional options which take arguments. Any
13356 redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and then
13357 check for additional options.
13359 - Macro: SWITCH_CURTAILS_COMPILATION (CHAR)
13360 A C expression which determines whether the option `-CHAR' stops
13361 compilation before the generation of an executable. The value is
13362 boolean, nonzero if the option does stop an executable from being
13363 generated, zero otherwise.
13365 By default, this macro is defined as
13366 `DEFAULT_SWITCH_CURTAILS_COMPILATION', which handles the standard
13367 options properly. You need not define
13368 `SWITCH_CURTAILS_COMPILATION' unless you wish to add additional
13369 options which affect the generation of an executable. Any
13370 redefinition should call `DEFAULT_SWITCH_CURTAILS_COMPILATION' and
13371 then check for additional options.
13373 - Macro: SWITCHES_NEED_SPACES
13374 A string-valued C expression which enumerates the options for which
13375 the linker needs a space between the option and its argument.
13377 If this macro is not defined, the default value is `""'.
13379 - Macro: TARGET_OPTION_TRANSLATE_TABLE
13380 If defined, a list of pairs of strings, the first of which is a
13381 potential command line target to the `gcc' driver program, and the
13382 second of which is a space-separated (tabs and other whitespace
13383 are not supported) list of options with which to replace the first
13384 option. The target defining this list is responsible for assuring
13385 that the results are valid. Replacement options may not be the
13386 `--opt' style, they must be the `-opt' style. It is the intention
13387 of this macro to provide a mechanism for substitution that affects
13388 the multilibs chosen, such as one option that enables many
13389 options, some of which select multilibs. Example nonsensical
13390 definition, where `-malt-abi', `-EB', and `-mspoo' cause different
13391 multilibs to be chosen:
13393 #define TARGET_OPTION_TRANSLATE_TABLE \
13394 { "-fast", "-march=fast-foo -malt-abi -I/usr/fast-foo" }, \
13395 { "-compat", "-EB -malign=4 -mspoo" }
13397 - Macro: DRIVER_SELF_SPECS
13398 A list of specs for the driver itself. It should be a suitable
13399 initializer for an array of strings, with no surrounding braces.
13401 The driver applies these specs to its own command line between
13402 loading default `specs' files (but not command-line specified
13403 ones) and choosing the multilib directory or running any
13404 subcommands. It applies them in the order given, so each spec can
13405 depend on the options added by earlier ones. It is also possible
13406 to remove options using `%<OPTION' in the usual way.
13408 This macro can be useful when a port has several interdependent
13409 target options. It provides a way of standardizing the command
13410 line so that the other specs are easier to write.
13412 Do not define this macro if it does not need to do anything.
13414 - Macro: OPTION_DEFAULT_SPECS
13415 A list of specs used to support configure-time default options
13416 (i.e. `--with' options) in the driver. It should be a suitable
13417 initializer for an array of structures, each containing two
13418 strings, without the outermost pair of surrounding braces.
13420 The first item in the pair is the name of the default. This must
13421 match the code in `config.gcc' for the target. The second item is
13422 a spec to apply if a default with this name was specified. The
13423 string `%(VALUE)' in the spec will be replaced by the value of the
13424 default everywhere it occurs.
13426 The driver will apply these specs to its own command line between
13427 loading default `specs' files and processing `DRIVER_SELF_SPECS',
13428 using the same mechanism as `DRIVER_SELF_SPECS'.
13430 Do not define this macro if it does not need to do anything.
13433 A C string constant that tells the GCC driver program options to
13434 pass to CPP. It can also specify how to translate options you
13435 give to GCC into options for GCC to pass to the CPP.
13437 Do not define this macro if it does not need to do anything.
13439 - Macro: CPLUSPLUS_CPP_SPEC
13440 This macro is just like `CPP_SPEC', but is used for C++, rather
13441 than C. If you do not define this macro, then the value of
13442 `CPP_SPEC' (if any) will be used instead.
13445 A C string constant that tells the GCC driver program options to
13446 pass to `cc1', `cc1plus', `f771', and the other language front
13447 ends. It can also specify how to translate options you give to
13448 GCC into options for GCC to pass to front ends.
13450 Do not define this macro if it does not need to do anything.
13452 - Macro: CC1PLUS_SPEC
13453 A C string constant that tells the GCC driver program options to
13454 pass to `cc1plus'. It can also specify how to translate options
13455 you give to GCC into options for GCC to pass to the `cc1plus'.
13457 Do not define this macro if it does not need to do anything. Note
13458 that everything defined in CC1_SPEC is already passed to `cc1plus'
13459 so there is no need to duplicate the contents of CC1_SPEC in
13463 A C string constant that tells the GCC driver program options to
13464 pass to the assembler. It can also specify how to translate
13465 options you give to GCC into options for GCC to pass to the
13466 assembler. See the file `sun3.h' for an example of this.
13468 Do not define this macro if it does not need to do anything.
13470 - Macro: ASM_FINAL_SPEC
13471 A C string constant that tells the GCC driver program how to run
13472 any programs which cleanup after the normal assembler. Normally,
13473 this is not needed. See the file `mips.h' for an example of this.
13475 Do not define this macro if it does not need to do anything.
13477 - Macro: AS_NEEDS_DASH_FOR_PIPED_INPUT
13478 Define this macro, with no value, if the driver should give the
13479 assembler an argument consisting of a single dash, `-', to
13480 instruct it to read from its standard input (which will be a pipe
13481 connected to the output of the compiler proper). This argument is
13482 given after any `-o' option specifying the name of the output file.
13484 If you do not define this macro, the assembler is assumed to read
13485 its standard input if given no non-option arguments. If your
13486 assembler cannot read standard input at all, use a `%{pipe:%e}'
13487 construct; see `mips.h' for instance.
13490 A C string constant that tells the GCC driver program options to
13491 pass to the linker. It can also specify how to translate options
13492 you give to GCC into options for GCC to pass to the linker.
13494 Do not define this macro if it does not need to do anything.
13497 Another C string constant used much like `LINK_SPEC'. The
13498 difference between the two is that `LIB_SPEC' is used at the end
13499 of the command given to the linker.
13501 If this macro is not defined, a default is provided that loads the
13502 standard C library from the usual place. See `gcc.c'.
13504 - Macro: LIBGCC_SPEC
13505 Another C string constant that tells the GCC driver program how
13506 and when to place a reference to `libgcc.a' into the linker
13507 command line. This constant is placed both before and after the
13508 value of `LIB_SPEC'.
13510 If this macro is not defined, the GCC driver provides a default
13511 that passes the string `-lgcc' to the linker.
13513 - Macro: STARTFILE_SPEC
13514 Another C string constant used much like `LINK_SPEC'. The
13515 difference between the two is that `STARTFILE_SPEC' is used at the
13516 very beginning of the command given to the linker.
13518 If this macro is not defined, a default is provided that loads the
13519 standard C startup file from the usual place. See `gcc.c'.
13521 - Macro: ENDFILE_SPEC
13522 Another C string constant used much like `LINK_SPEC'. The
13523 difference between the two is that `ENDFILE_SPEC' is used at the
13524 very end of the command given to the linker.
13526 Do not define this macro if it does not need to do anything.
13528 - Macro: THREAD_MODEL_SPEC
13529 GCC `-v' will print the thread model GCC was configured to use.
13530 However, this doesn't work on platforms that are multilibbed on
13531 thread models, such as AIX 4.3. On such platforms, define
13532 `THREAD_MODEL_SPEC' such that it evaluates to a string without
13533 blanks that names one of the recognized thread models. `%*', the
13534 default value of this macro, will expand to the value of
13535 `thread_file' set in `config.gcc'.
13537 - Macro: SYSROOT_SUFFIX_SPEC
13538 Define this macro to add a suffix to the target sysroot when GCC is
13539 configured with a sysroot. This will cause GCC to search for
13540 usr/lib, et al, within sysroot+suffix.
13542 - Macro: SYSROOT_HEADERS_SUFFIX_SPEC
13543 Define this macro to add a headers_suffix to the target sysroot
13544 when GCC is configured with a sysroot. This will cause GCC to
13545 pass the updated sysroot+headers_suffix to CPP, causing it to
13546 search for usr/include, et al, within sysroot+headers_suffix.
13548 - Macro: EXTRA_SPECS
13549 Define this macro to provide additional specifications to put in
13550 the `specs' file that can be used in various specifications like
13553 The definition should be an initializer for an array of structures,
13554 containing a string constant, that defines the specification name,
13555 and a string constant that provides the specification.
13557 Do not define this macro if it does not need to do anything.
13559 `EXTRA_SPECS' is useful when an architecture contains several
13560 related targets, which have various `..._SPECS' which are similar
13561 to each other, and the maintainer would like one central place to
13562 keep these definitions.
13564 For example, the PowerPC System V.4 targets use `EXTRA_SPECS' to
13565 define either `_CALL_SYSV' when the System V calling sequence is
13566 used or `_CALL_AIX' when the older AIX-based calling sequence is
13569 The `config/rs6000/rs6000.h' target file defines:
13571 #define EXTRA_SPECS \
13572 { "cpp_sysv_default", CPP_SYSV_DEFAULT },
13574 #define CPP_SYS_DEFAULT ""
13576 The `config/rs6000/sysv.h' target file defines:
13579 "%{posix: -D_POSIX_SOURCE } \
13580 %{mcall-sysv: -D_CALL_SYSV } \
13581 %{!mcall-sysv: %(cpp_sysv_default) } \
13582 %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
13584 #undef CPP_SYSV_DEFAULT
13585 #define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
13587 while the `config/rs6000/eabiaix.h' target file defines
13588 `CPP_SYSV_DEFAULT' as:
13590 #undef CPP_SYSV_DEFAULT
13591 #define CPP_SYSV_DEFAULT "-D_CALL_AIX"
13593 - Macro: LINK_LIBGCC_SPECIAL
13594 Define this macro if the driver program should find the library
13595 `libgcc.a' itself and should not pass `-L' options to the linker.
13596 If you do not define this macro, the driver program will pass the
13597 argument `-lgcc' to tell the linker to do the search and will pass
13598 `-L' options to it.
13600 - Macro: LINK_LIBGCC_SPECIAL_1
13601 Define this macro if the driver program should find the library
13602 `libgcc.a'. If you do not define this macro, the driver program
13603 will pass the argument `-lgcc' to tell the linker to do the search.
13604 This macro is similar to `LINK_LIBGCC_SPECIAL', except that it does
13605 not affect `-L' options.
13607 - Macro: LINK_GCC_C_SEQUENCE_SPEC
13608 The sequence in which libgcc and libc are specified to the linker.
13609 By default this is `%G %L %G'.
13611 - Macro: LINK_COMMAND_SPEC
13612 A C string constant giving the complete command line need to
13613 execute the linker. When you do this, you will need to update
13614 your port each time a change is made to the link command line
13615 within `gcc.c'. Therefore, define this macro only if you need to
13616 completely redefine the command line for invoking the linker and
13617 there is no other way to accomplish the effect you need.
13618 Overriding this macro may be avoidable by overriding
13619 `LINK_GCC_C_SEQUENCE_SPEC' instead.
13621 - Macro: LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
13622 A nonzero value causes `collect2' to remove duplicate
13623 `-LDIRECTORY' search directories from linking commands. Do not
13624 give it a nonzero value if removing duplicate search directories
13625 changes the linker's semantics.
13627 - Macro: MULTILIB_DEFAULTS
13628 Define this macro as a C expression for the initializer of an
13629 array of string to tell the driver program which options are
13630 defaults for this target and thus do not need to be handled
13631 specially when using `MULTILIB_OPTIONS'.
13633 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
13634 the target makefile fragment or if none of the options listed in
13635 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::.
13637 - Macro: RELATIVE_PREFIX_NOT_LINKDIR
13638 Define this macro to tell `gcc' that it should only translate a
13639 `-B' prefix into a `-L' linker option if the prefix indicates an
13640 absolute file name.
13642 - Macro: MD_EXEC_PREFIX
13643 If defined, this macro is an additional prefix to try after
13644 `STANDARD_EXEC_PREFIX'. `MD_EXEC_PREFIX' is not searched when the
13645 `-b' option is used, or the compiler is built as a cross compiler.
13646 If you define `MD_EXEC_PREFIX', then be sure to add it to the
13647 list of directories used to find the assembler in `configure.in'.
13649 - Macro: STANDARD_STARTFILE_PREFIX
13650 Define this macro as a C string constant if you wish to override
13651 the standard choice of `libdir' as the default prefix to try when
13652 searching for startup files such as `crt0.o'.
13653 `STANDARD_STARTFILE_PREFIX' is not searched when the compiler is
13654 built as a cross compiler.
13656 - Macro: MD_STARTFILE_PREFIX
13657 If defined, this macro supplies an additional prefix to try after
13658 the standard prefixes. `MD_EXEC_PREFIX' is not searched when the
13659 `-b' option is used, or when the compiler is built as a cross
13662 - Macro: MD_STARTFILE_PREFIX_1
13663 If defined, this macro supplies yet another prefix to try after the
13664 standard prefixes. It is not searched when the `-b' option is
13665 used, or when the compiler is built as a cross compiler.
13667 - Macro: INIT_ENVIRONMENT
13668 Define this macro as a C string constant if you wish to set
13669 environment variables for programs called by the driver, such as
13670 the assembler and loader. The driver passes the value of this
13671 macro to `putenv' to initialize the necessary environment
13674 - Macro: LOCAL_INCLUDE_DIR
13675 Define this macro as a C string constant if you wish to override
13676 the standard choice of `/usr/local/include' as the default prefix
13677 to try when searching for local header files. `LOCAL_INCLUDE_DIR'
13678 comes before `SYSTEM_INCLUDE_DIR' in the search order.
13680 Cross compilers do not search either `/usr/local/include' or its
13683 - Macro: MODIFY_TARGET_NAME
13684 Define this macro if you wish to define command-line switches that
13685 modify the default target name.
13687 For each switch, you can include a string to be appended to the
13688 first part of the configuration name or a string to be deleted
13689 from the configuration name, if present. The definition should be
13690 an initializer for an array of structures. Each array element
13691 should have three elements: the switch name (a string constant,
13692 including the initial dash), one of the enumeration codes `ADD' or
13693 `DELETE' to indicate whether the string should be inserted or
13694 deleted, and the string to be inserted or deleted (a string
13697 For example, on a machine where `64' at the end of the
13698 configuration name denotes a 64-bit target and you want the `-32'
13699 and `-64' switches to select between 32- and 64-bit targets, you
13702 #define MODIFY_TARGET_NAME \
13703 { { "-32", DELETE, "64"}, \
13704 {"-64", ADD, "64"}}
13706 - Macro: SYSTEM_INCLUDE_DIR
13707 Define this macro as a C string constant if you wish to specify a
13708 system-specific directory to search for header files before the
13709 standard directory. `SYSTEM_INCLUDE_DIR' comes before
13710 `STANDARD_INCLUDE_DIR' in the search order.
13712 Cross compilers do not use this macro and do not search the
13713 directory specified.
13715 - Macro: STANDARD_INCLUDE_DIR
13716 Define this macro as a C string constant if you wish to override
13717 the standard choice of `/usr/include' as the default prefix to try
13718 when searching for header files.
13720 Cross compilers ignore this macro and do not search either
13721 `/usr/include' or its replacement.
13723 - Macro: STANDARD_INCLUDE_COMPONENT
13724 The "component" corresponding to `STANDARD_INCLUDE_DIR'. See
13725 `INCLUDE_DEFAULTS', below, for the description of components. If
13726 you do not define this macro, no component is used.
13728 - Macro: INCLUDE_DEFAULTS
13729 Define this macro if you wish to override the entire default
13730 search path for include files. For a native compiler, the default
13731 search path usually consists of `GCC_INCLUDE_DIR',
13732 `LOCAL_INCLUDE_DIR', `SYSTEM_INCLUDE_DIR',
13733 `GPLUSPLUS_INCLUDE_DIR', and `STANDARD_INCLUDE_DIR'. In addition,
13734 `GPLUSPLUS_INCLUDE_DIR' and `GCC_INCLUDE_DIR' are defined
13735 automatically by `Makefile', and specify private search areas for
13736 GCC. The directory `GPLUSPLUS_INCLUDE_DIR' is used only for C++
13739 The definition should be an initializer for an array of structures.
13740 Each array element should have four elements: the directory name (a
13741 string constant), the component name (also a string constant), a
13742 flag for C++-only directories, and a flag showing that the
13743 includes in the directory don't need to be wrapped in `extern `C''
13744 when compiling C++. Mark the end of the array with a null element.
13746 The component name denotes what GNU package the include file is
13747 part of, if any, in all uppercase letters. For example, it might
13748 be `GCC' or `BINUTILS'. If the package is part of a
13749 vendor-supplied operating system, code the component name as `0'.
13751 For example, here is the definition used for VAX/VMS:
13753 #define INCLUDE_DEFAULTS \
13755 { "GNU_GXX_INCLUDE:", "G++", 1, 1}, \
13756 { "GNU_CC_INCLUDE:", "GCC", 0, 0}, \
13757 { "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0}, \
13762 Here is the order of prefixes tried for exec files:
13764 1. Any prefixes specified by the user with `-B'.
13766 2. The environment variable `GCC_EXEC_PREFIX', if any.
13768 3. The directories specified by the environment variable
13771 4. The macro `STANDARD_EXEC_PREFIX'.
13773 5. `/usr/lib/gcc/'.
13775 6. The macro `MD_EXEC_PREFIX', if any.
13777 Here is the order of prefixes tried for startfiles:
13779 1. Any prefixes specified by the user with `-B'.
13781 2. The environment variable `GCC_EXEC_PREFIX', if any.
13783 3. The directories specified by the environment variable
13784 `LIBRARY_PATH' (or port-specific name; native only, cross
13785 compilers do not use this).
13787 4. The macro `STANDARD_EXEC_PREFIX'.
13789 5. `/usr/lib/gcc/'.
13791 6. The macro `MD_EXEC_PREFIX', if any.
13793 7. The macro `MD_STARTFILE_PREFIX', if any.
13795 8. The macro `STANDARD_STARTFILE_PREFIX'.
13802 File: gccint.info, Node: Run-time Target, Next: Per-Function Data, Prev: Driver, Up: Target Macros
13804 Run-time Target Specification
13805 =============================
13807 Here are run-time target specifications.
13809 - Macro: TARGET_CPU_CPP_BUILTINS ()
13810 This function-like macro expands to a block of code that defines
13811 built-in preprocessor macros and assertions for the target cpu,
13812 using the functions `builtin_define', `builtin_define_std' and
13813 `builtin_assert'. When the front end calls this macro it provides
13814 a trailing semicolon, and since it has finished command line
13815 option processing your code can use those results freely.
13817 `builtin_assert' takes a string in the form you pass to the
13818 command-line option `-A', such as `cpu=mips', and creates the
13819 assertion. `builtin_define' takes a string in the form accepted
13820 by option `-D' and unconditionally defines the macro.
13822 `builtin_define_std' takes a string representing the name of an
13823 object-like macro. If it doesn't lie in the user's namespace,
13824 `builtin_define_std' defines it unconditionally. Otherwise, it
13825 defines a version with two leading underscores, and another version
13826 with two leading and trailing underscores, and defines the original
13827 only if an ISO standard was not requested on the command line. For
13828 example, passing `unix' defines `__unix', `__unix__' and possibly
13829 `unix'; passing `_mips' defines `__mips', `__mips__' and possibly
13830 `_mips', and passing `_ABI64' defines only `_ABI64'.
13832 You can also test for the C dialect being compiled. The variable
13833 `c_language' is set to one of `clk_c', `clk_cplusplus' or
13834 `clk_objective_c'. Note that if we are preprocessing assembler,
13835 this variable will be `clk_c' but the function-like macro
13836 `preprocessing_asm_p()' will return true, so you might want to
13837 check for that first. If you need to check for strict ANSI, the
13838 variable `flag_iso' can be used. The function-like macro
13839 `preprocessing_trad_p()' can be used to check for traditional
13842 - Macro: TARGET_OS_CPP_BUILTINS ()
13843 Similarly to `TARGET_CPU_CPP_BUILTINS' but this macro is optional
13844 and is used for the target operating system instead.
13846 - Macro: TARGET_OBJFMT_CPP_BUILTINS ()
13847 Similarly to `TARGET_CPU_CPP_BUILTINS' but this macro is optional
13848 and is used for the target object format. `elfos.h' uses this
13849 macro to define `__ELF__', so you probably do not need to define
13852 - Variable: extern int target_flags
13853 This declaration should be present.
13855 - Macro: TARGET_FEATURENAME
13856 This series of macros is to allow compiler command arguments to
13857 enable or disable the use of optional features of the target
13858 machine. For example, one machine description serves both the
13859 68000 and the 68020; a command argument tells the compiler whether
13860 it should use 68020-only instructions or not. This command
13861 argument works by means of a macro `TARGET_68020' that tests a bit
13864 Define a macro `TARGET_FEATURENAME' for each such option. Its
13865 definition should test a bit in `target_flags'. It is recommended
13866 that a helper macro `MASK_FEATURENAME' is defined for each
13867 bit-value to test, and used in `TARGET_FEATURENAME' and
13868 `TARGET_SWITCHES'. For example:
13870 #define TARGET_MASK_68020 1
13871 #define TARGET_68020 (target_flags & MASK_68020)
13873 One place where these macros are used is in the
13874 condition-expressions of instruction patterns. Note how
13875 `TARGET_68020' appears frequently in the 68000 machine description
13876 file, `m68k.md'. Another place they are used is in the
13877 definitions of the other macros in the `MACHINE.h' file.
13879 - Macro: TARGET_SWITCHES
13880 This macro defines names of command options to set and clear bits
13881 in `target_flags'. Its definition is an initializer with a
13882 subgrouping for each command option.
13884 Each subgrouping contains a string constant, that defines the
13885 option name, a number, which contains the bits to set in
13886 `target_flags', and a second string which is the description
13887 displayed by `--help'. If the number is negative then the bits
13888 specified by the number are cleared instead of being set. If the
13889 description string is present but empty, then no help information
13890 will be displayed for that option, but it will not count as an
13891 undocumented option. The actual option name is made by appending
13892 `-m' to the specified name. Non-empty description strings should
13893 be marked with `N_(...)' for `xgettext'. Please do not mark empty
13894 strings because the empty string is reserved by GNU gettext.
13895 `gettext("")' returns the header entry of the message catalog with
13896 meta information, not the empty string.
13898 In addition to the description for `--help', more detailed
13899 documentation for each option should be added to `invoke.texi'.
13901 One of the subgroupings should have a null string. The number in
13902 this grouping is the default value for `target_flags'. Any target
13903 options act starting with that value.
13905 Here is an example which defines `-m68000' and `-m68020' with
13906 opposite meanings, and picks the latter as the default:
13908 #define TARGET_SWITCHES \
13909 { { "68020", MASK_68020, "" }, \
13910 { "68000", -MASK_68020, \
13911 N_("Compile for the 68000") }, \
13912 { "", MASK_68020, "" }, \
13915 - Macro: TARGET_OPTIONS
13916 This macro is similar to `TARGET_SWITCHES' but defines names of
13917 command options that have values. Its definition is an
13918 initializer with a subgrouping for each command option.
13920 Each subgrouping contains a string constant, that defines the
13921 option name, the address of a variable, a description string, and
13922 a value. Non-empty description strings should be marked with
13923 `N_(...)' for `xgettext'. Please do not mark empty strings
13924 because the empty string is reserved by GNU gettext. `gettext("")'
13925 returns the header entry of the message catalog with meta
13926 information, not the empty string.
13928 If the value listed in the table is `NULL', then the variable, type
13929 `char *', is set to the variable part of the given option if the
13930 fixed part matches. In other words, if the first part of the
13931 option matches what's in the table, the variable will be set to
13932 point to the rest of the option. This allows the user to specify
13933 a value for that option. The actual option name is made by
13934 appending `-m' to the specified name. Again, each option should
13935 also be documented in `invoke.texi'.
13937 If the value listed in the table is non-`NULL', then the option
13938 must match the option in the table exactly (with `-m'), and the
13939 variable is set to point to the value listed in the table.
13941 Here is an example which defines `-mshort-data-NUMBER'. If the
13942 given option is `-mshort-data-512', the variable `m88k_short_data'
13943 will be set to the string `"512"'.
13945 extern char *m88k_short_data;
13946 #define TARGET_OPTIONS \
13947 { { "short-data-", &m88k_short_data, \
13948 N_("Specify the size of the short data section"), 0 } }
13950 Here is a variant of the above that allows the user to also specify
13951 just `-mshort-data' where a default of `"64"' is used.
13953 extern char *m88k_short_data;
13954 #define TARGET_OPTIONS \
13955 { { "short-data-", &m88k_short_data, \
13956 N_("Specify the size of the short data section"), 0 } \
13957 { "short-data", &m88k_short_data, "", "64" },
13960 Here is an example which defines `-mno-alu', `-malu1', and
13961 `-malu2' as a three-state switch, along with suitable macros for
13962 checking the state of the option (documentation is elided for
13966 char *chip_alu = ""; /* Specify default here. */
13969 extern char *chip_alu;
13970 #define TARGET_OPTIONS \
13971 { { "no-alu", &chip_alu, "", "" }, \
13972 { "alu1", &chip_alu, "", "1" }, \
13973 { "alu2", &chip_alu, "", "2" }, }
13974 #define TARGET_ALU (chip_alu[0] != '\0')
13975 #define TARGET_ALU1 (chip_alu[0] == '1')
13976 #define TARGET_ALU2 (chip_alu[0] == '2')
13978 - Macro: TARGET_VERSION
13979 This macro is a C statement to print on `stderr' a string
13980 describing the particular machine description choice. Every
13981 machine description should define `TARGET_VERSION'. For example:
13984 #define TARGET_VERSION \
13985 fprintf (stderr, " (68k, Motorola syntax)");
13987 #define TARGET_VERSION \
13988 fprintf (stderr, " (68k, MIT syntax)");
13991 - Macro: OVERRIDE_OPTIONS
13992 Sometimes certain combinations of command options do not make
13993 sense on a particular target machine. You can define a macro
13994 `OVERRIDE_OPTIONS' to take account of this. This macro, if
13995 defined, is executed once just after all the command options have
13998 Don't use this macro to turn on various extra optimizations for
13999 `-O'. That is what `OPTIMIZATION_OPTIONS' is for.
14001 - Macro: OPTIMIZATION_OPTIONS (LEVEL, SIZE)
14002 Some machines may desire to change what optimizations are
14003 performed for various optimization levels. This macro, if
14004 defined, is executed once just after the optimization level is
14005 determined and before the remainder of the command options have
14006 been parsed. Values set in this macro are used as the default
14007 values for the other command line options.
14009 LEVEL is the optimization level specified; 2 if `-O2' is
14010 specified, 1 if `-O' is specified, and 0 if neither is specified.
14012 SIZE is nonzero if `-Os' is specified and zero otherwise.
14014 You should not use this macro to change options that are not
14015 machine-specific. These should uniformly selected by the same
14016 optimization level on all supported machines. Use this macro to
14017 enable machine-specific optimizations.
14019 *Do not examine `write_symbols' in this macro!* The debugging
14020 options are not supposed to alter the generated code.
14022 - Macro: CAN_DEBUG_WITHOUT_FP
14023 Define this macro if debugging can be performed even without a
14024 frame pointer. If this macro is defined, GCC will turn on the
14025 `-fomit-frame-pointer' option whenever `-O' is specified.
14028 File: gccint.info, Node: Per-Function Data, Next: Storage Layout, Prev: Run-time Target, Up: Target Macros
14030 Defining data structures for per-function information.
14031 ======================================================
14033 If the target needs to store information on a per-function basis, GCC
14034 provides a macro and a couple of variables to allow this. Note, just
14035 using statics to store the information is a bad idea, since GCC supports
14036 nested functions, so you can be halfway through encoding one function
14037 when another one comes along.
14039 GCC defines a data structure called `struct function' which contains
14040 all of the data specific to an individual function. This structure
14041 contains a field called `machine' whose type is `struct
14042 machine_function *', which can be used by targets to point to their own
14045 If a target needs per-function specific data it should define the
14046 type `struct machine_function' and also the macro `INIT_EXPANDERS'.
14047 This macro should be used to initialize the function pointer
14048 `init_machine_status'. This pointer is explained below.
14050 One typical use of per-function, target specific data is to create an
14051 RTX to hold the register containing the function's return address. This
14052 RTX can then be used to implement the `__builtin_return_address'
14053 function, for level 0.
14055 Note--earlier implementations of GCC used a single data area to hold
14056 all of the per-function information. Thus when processing of a nested
14057 function began the old per-function data had to be pushed onto a stack,
14058 and when the processing was finished, it had to be popped off the
14059 stack. GCC used to provide function pointers called
14060 `save_machine_status' and `restore_machine_status' to handle the saving
14061 and restoring of the target specific information. Since the single
14062 data area approach is no longer used, these pointers are no longer
14065 - Macro: INIT_EXPANDERS
14066 Macro called to initialize any target specific information. This
14067 macro is called once per function, before generation of any RTL
14068 has begun. The intention of this macro is to allow the
14069 initialization of the function pointer `init_machine_status'.
14071 - Variable: void (*)(struct function *) init_machine_status
14072 If this function pointer is non-`NULL' it will be called once per
14073 function, before function compilation starts, in order to allow the
14074 target to perform any target specific initialization of the
14075 `struct function' structure. It is intended that this would be
14076 used to initialize the `machine' of that structure.
14078 `struct machine_function' structures are expected to be freed by
14079 GC. Generally, any memory that they reference must be allocated
14080 by using `ggc_alloc', including the structure itself.
14083 File: gccint.info, Node: Storage Layout, Next: Type Layout, Prev: Per-Function Data, Up: Target Macros
14088 Note that the definitions of the macros in this table which are
14089 sizes or alignments measured in bits do not need to be constant. They
14090 can be C expressions that refer to static variables, such as the
14091 `target_flags'. *Note Run-time Target::.
14093 - Macro: BITS_BIG_ENDIAN
14094 Define this macro to have the value 1 if the most significant bit
14095 in a byte has the lowest number; otherwise define it to have the
14096 value zero. This means that bit-field instructions count from the
14097 most significant bit. If the machine has no bit-field
14098 instructions, then this must still be defined, but it doesn't
14099 matter which value it is defined to. This macro need not be a
14102 This macro does not affect the way structure fields are packed into
14103 bytes or words; that is controlled by `BYTES_BIG_ENDIAN'.
14105 - Macro: BYTES_BIG_ENDIAN
14106 Define this macro to have the value 1 if the most significant byte
14107 in a word has the lowest number. This macro need not be a
14110 - Macro: WORDS_BIG_ENDIAN
14111 Define this macro to have the value 1 if, in a multiword object,
14112 the most significant word has the lowest number. This applies to
14113 both memory locations and registers; GCC fundamentally assumes
14114 that the order of words in memory is the same as the order in
14115 registers. This macro need not be a constant.
14117 - Macro: LIBGCC2_WORDS_BIG_ENDIAN
14118 Define this macro if `WORDS_BIG_ENDIAN' is not constant. This
14119 must be a constant value with the same meaning as
14120 `WORDS_BIG_ENDIAN', which will be used only when compiling
14121 `libgcc2.c'. Typically the value will be set based on
14122 preprocessor defines.
14124 - Macro: FLOAT_WORDS_BIG_ENDIAN
14125 Define this macro to have the value 1 if `DFmode', `XFmode' or
14126 `TFmode' floating point numbers are stored in memory with the word
14127 containing the sign bit at the lowest address; otherwise define it
14128 to have the value 0. This macro need not be a constant.
14130 You need not define this macro if the ordering is the same as for
14131 multi-word integers.
14133 - Macro: BITS_PER_UNIT
14134 Define this macro to be the number of bits in an addressable
14135 storage unit (byte). If you do not define this macro the default
14138 - Macro: BITS_PER_WORD
14139 Number of bits in a word. If you do not define this macro, the
14140 default is `BITS_PER_UNIT * UNITS_PER_WORD'.
14142 - Macro: MAX_BITS_PER_WORD
14143 Maximum number of bits in a word. If this is undefined, the
14144 default is `BITS_PER_WORD'. Otherwise, it is the constant value
14145 that is the largest value that `BITS_PER_WORD' can have at
14148 - Macro: UNITS_PER_WORD
14149 Number of storage units in a word; normally 4.
14151 - Macro: MIN_UNITS_PER_WORD
14152 Minimum number of units in a word. If this is undefined, the
14153 default is `UNITS_PER_WORD'. Otherwise, it is the constant value
14154 that is the smallest value that `UNITS_PER_WORD' can have at
14157 - Macro: POINTER_SIZE
14158 Width of a pointer, in bits. You must specify a value no wider
14159 than the width of `Pmode'. If it is not equal to the width of
14160 `Pmode', you must define `POINTERS_EXTEND_UNSIGNED'. If you do
14161 not specify a value the default is `BITS_PER_WORD'.
14163 - Macro: POINTERS_EXTEND_UNSIGNED
14164 A C expression whose value is greater than zero if pointers that
14165 need to be extended from being `POINTER_SIZE' bits wide to `Pmode'
14166 are to be zero-extended and zero if they are to be sign-extended.
14167 If the value is less then zero then there must be an "ptr_extend"
14168 instruction that extends a pointer from `POINTER_SIZE' to `Pmode'.
14170 You need not define this macro if the `POINTER_SIZE' is equal to
14171 the width of `Pmode'.
14173 - Macro: PROMOTE_MODE (M, UNSIGNEDP, TYPE)
14174 A macro to update M and UNSIGNEDP when an object whose type is
14175 TYPE and which has the specified mode and signedness is to be
14176 stored in a register. This macro is only called when TYPE is a
14179 On most RISC machines, which only have operations that operate on
14180 a full register, define this macro to set M to `word_mode' if M is
14181 an integer mode narrower than `BITS_PER_WORD'. In most cases,
14182 only integer modes should be widened because wider-precision
14183 floating-point operations are usually more expensive than their
14184 narrower counterparts.
14186 For most machines, the macro definition does not change UNSIGNEDP.
14187 However, some machines, have instructions that preferentially
14188 handle either signed or unsigned quantities of certain modes. For
14189 example, on the DEC Alpha, 32-bit loads from memory and 32-bit add
14190 instructions sign-extend the result to 64 bits. On such machines,
14191 set UNSIGNEDP according to which kind of extension is more
14194 Do not define this macro if it would never modify M.
14196 - Target Hook: bool TARGET_PROMOTE_FUNCTION_ARGS (tree FNTYPE)
14197 This target hook should return `true' if the promotion described by
14198 `PROMOTE_MODE' should also be done for outgoing function arguments.
14200 - Target Hook: bool TARGET_PROMOTE_FUNCTION_RETURN (tree FNTYPE)
14201 This target hook should return `true' if the promotion described by
14202 `PROMOTE_MODE' should also be done for the return value of
14205 If this target hook returns `true', `FUNCTION_VALUE' must perform
14206 the same promotions done by `PROMOTE_MODE'.
14208 - Macro: PROMOTE_FOR_CALL_ONLY
14209 Define this macro if the promotion described by `PROMOTE_MODE'
14210 should _only_ be performed for outgoing function arguments or
14211 function return values, as specified by
14212 `TARGET_PROMOTE_FUNCTION_ARGS' and
14213 `TARGET_PROMOTE_FUNCTION_RETURN', respectively.
14215 - Macro: PARM_BOUNDARY
14216 Normal alignment required for function parameters on the stack, in
14217 bits. All stack parameters receive at least this much alignment
14218 regardless of data type. On most machines, this is the same as the
14219 size of an integer.
14221 - Macro: STACK_BOUNDARY
14222 Define this macro to the minimum alignment enforced by hardware
14223 for the stack pointer on this machine. The definition is a C
14224 expression for the desired alignment (measured in bits). This
14225 value is used as a default if `PREFERRED_STACK_BOUNDARY' is not
14226 defined. On most machines, this should be the same as
14229 - Macro: PREFERRED_STACK_BOUNDARY
14230 Define this macro if you wish to preserve a certain alignment for
14231 the stack pointer, greater than what the hardware enforces. The
14232 definition is a C expression for the desired alignment (measured
14233 in bits). This macro must evaluate to a value equal to or larger
14234 than `STACK_BOUNDARY'.
14236 - Macro: FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
14237 A C expression that evaluates true if `PREFERRED_STACK_BOUNDARY' is
14238 not guaranteed by the runtime and we should emit code to align the
14239 stack at the beginning of `main'.
14241 If `PUSH_ROUNDING' is not defined, the stack will always be aligned
14242 to the specified boundary. If `PUSH_ROUNDING' is defined and
14243 specifies a less strict alignment than `PREFERRED_STACK_BOUNDARY',
14244 the stack may be momentarily unaligned while pushing arguments.
14246 - Macro: FUNCTION_BOUNDARY
14247 Alignment required for a function entry point, in bits.
14249 - Macro: BIGGEST_ALIGNMENT
14250 Biggest alignment that any data type can require on this machine,
14253 - Macro: MINIMUM_ATOMIC_ALIGNMENT
14254 If defined, the smallest alignment, in bits, that can be given to
14255 an object that can be referenced in one operation, without
14256 disturbing any nearby object. Normally, this is `BITS_PER_UNIT',
14257 but may be larger on machines that don't have byte or half-word
14260 - Macro: BIGGEST_FIELD_ALIGNMENT
14261 Biggest alignment that any structure or union field can require on
14262 this machine, in bits. If defined, this overrides
14263 `BIGGEST_ALIGNMENT' for structure and union fields only, unless
14264 the field alignment has been set by the `__attribute__ ((aligned
14267 - Macro: ADJUST_FIELD_ALIGN (FIELD, COMPUTED)
14268 An expression for the alignment of a structure field FIELD if the
14269 alignment computed in the usual way (including applying of
14270 `BIGGEST_ALIGNMENT' and `BIGGEST_FIELD_ALIGNMENT' to the
14271 alignment) is COMPUTED. It overrides alignment only if the field
14272 alignment has not been set by the `__attribute__ ((aligned (N)))'
14275 - Macro: MAX_OFILE_ALIGNMENT
14276 Biggest alignment supported by the object file format of this
14277 machine. Use this macro to limit the alignment which can be
14278 specified using the `__attribute__ ((aligned (N)))' construct. If
14279 not defined, the default value is `BIGGEST_ALIGNMENT'.
14281 - Macro: DATA_ALIGNMENT (TYPE, BASIC-ALIGN)
14282 If defined, a C expression to compute the alignment for a variable
14283 in the static store. TYPE is the data type, and BASIC-ALIGN is
14284 the alignment that the object would ordinarily have. The value of
14285 this macro is used instead of that alignment to align the object.
14287 If this macro is not defined, then BASIC-ALIGN is used.
14289 One use of this macro is to increase alignment of medium-size data
14290 to make it all fit in fewer cache lines. Another is to cause
14291 character arrays to be word-aligned so that `strcpy' calls that
14292 copy constants to character arrays can be done inline.
14294 - Macro: CONSTANT_ALIGNMENT (CONSTANT, BASIC-ALIGN)
14295 If defined, a C expression to compute the alignment given to a
14296 constant that is being placed in memory. CONSTANT is the constant
14297 and BASIC-ALIGN is the alignment that the object would ordinarily
14298 have. The value of this macro is used instead of that alignment to
14301 If this macro is not defined, then BASIC-ALIGN is used.
14303 The typical use of this macro is to increase alignment for string
14304 constants to be word aligned so that `strcpy' calls that copy
14305 constants can be done inline.
14307 - Macro: LOCAL_ALIGNMENT (TYPE, BASIC-ALIGN)
14308 If defined, a C expression to compute the alignment for a variable
14309 in the local store. TYPE is the data type, and BASIC-ALIGN is the
14310 alignment that the object would ordinarily have. The value of this
14311 macro is used instead of that alignment to align the object.
14313 If this macro is not defined, then BASIC-ALIGN is used.
14315 One use of this macro is to increase alignment of medium-size data
14316 to make it all fit in fewer cache lines.
14318 - Macro: EMPTY_FIELD_BOUNDARY
14319 Alignment in bits to be given to a structure bit-field that
14320 follows an empty field such as `int : 0;'.
14322 If `PCC_BITFIELD_TYPE_MATTERS' is true, it overrides this macro.
14324 - Macro: STRUCTURE_SIZE_BOUNDARY
14325 Number of bits which any structure or union's size must be a
14326 multiple of. Each structure or union's size is rounded up to a
14329 If you do not define this macro, the default is the same as
14332 - Macro: STRICT_ALIGNMENT
14333 Define this macro to be the value 1 if instructions will fail to
14334 work if given data not on the nominal alignment. If instructions
14335 will merely go slower in that case, define this macro as 0.
14337 - Macro: PCC_BITFIELD_TYPE_MATTERS
14338 Define this if you wish to imitate the way many other C compilers
14339 handle alignment of bit-fields and the structures that contain
14342 The behavior is that the type written for a named bit-field (`int',
14343 `short', or other integer type) imposes an alignment for the entire
14344 structure, as if the structure really did contain an ordinary
14345 field of that type. In addition, the bit-field is placed within
14346 the structure so that it would fit within such a field, not
14347 crossing a boundary for it.
14349 Thus, on most machines, a named bit-field whose type is written as
14350 `int' would not cross a four-byte boundary, and would force
14351 four-byte alignment for the whole structure. (The alignment used
14352 may not be four bytes; it is controlled by the other alignment
14355 An unnamed bit-field will not affect the alignment of the
14356 containing structure.
14358 If the macro is defined, its definition should be a C expression;
14359 a nonzero value for the expression enables this behavior.
14361 Note that if this macro is not defined, or its value is zero, some
14362 bit-fields may cross more than one alignment boundary. The
14363 compiler can support such references if there are `insv', `extv',
14364 and `extzv' insns that can directly reference memory.
14366 The other known way of making bit-fields work is to define
14367 `STRUCTURE_SIZE_BOUNDARY' as large as `BIGGEST_ALIGNMENT'. Then
14368 every structure can be accessed with fullwords.
14370 Unless the machine has bit-field instructions or you define
14371 `STRUCTURE_SIZE_BOUNDARY' that way, you must define
14372 `PCC_BITFIELD_TYPE_MATTERS' to have a nonzero value.
14374 If your aim is to make GCC use the same conventions for laying out
14375 bit-fields as are used by another compiler, here is how to
14376 investigate what the other compiler does. Compile and run this
14395 printf ("Size of foo1 is %d\n",
14396 sizeof (struct foo1));
14397 printf ("Size of foo2 is %d\n",
14398 sizeof (struct foo2));
14402 If this prints 2 and 5, then the compiler's behavior is what you
14403 would get from `PCC_BITFIELD_TYPE_MATTERS'.
14405 - Macro: BITFIELD_NBYTES_LIMITED
14406 Like `PCC_BITFIELD_TYPE_MATTERS' except that its effect is limited
14407 to aligning a bit-field within the structure.
14409 - Macro: MEMBER_TYPE_FORCES_BLK (FIELD, MODE)
14410 Return 1 if a structure or array containing FIELD should be
14411 accessed using `BLKMODE'.
14413 If FIELD is the only field in the structure, MODE is its mode,
14414 otherwise MODE is VOIDmode. MODE is provided in the case where
14415 structures of one field would require the structure's mode to
14416 retain the field's mode.
14418 Normally, this is not needed. See the file `c4x.h' for an example
14419 of how to use this macro to prevent a structure having a floating
14420 point field from being accessed in an integer mode.
14422 - Macro: ROUND_TYPE_ALIGN (TYPE, COMPUTED, SPECIFIED)
14423 Define this macro as an expression for the alignment of a type
14424 (given by TYPE as a tree node) if the alignment computed in the
14425 usual way is COMPUTED and the alignment explicitly specified was
14428 The default is to use SPECIFIED if it is larger; otherwise, use
14429 the smaller of COMPUTED and `BIGGEST_ALIGNMENT'
14431 - Macro: MAX_FIXED_MODE_SIZE
14432 An integer expression for the size in bits of the largest integer
14433 machine mode that should actually be used. All integer machine
14434 modes of this size or smaller can be used for structures and
14435 unions with the appropriate sizes. If this macro is undefined,
14436 `GET_MODE_BITSIZE (DImode)' is assumed.
14438 - Macro: VECTOR_MODE_SUPPORTED_P (MODE)
14439 Define this macro to be nonzero if the port is prepared to handle
14440 insns involving vector mode MODE. At the very least, it must have
14441 move patterns for this mode.
14443 - Macro: STACK_SAVEAREA_MODE (SAVE_LEVEL)
14444 If defined, an expression of type `enum machine_mode' that
14445 specifies the mode of the save area operand of a
14446 `save_stack_LEVEL' named pattern (*note Standard Names::).
14447 SAVE_LEVEL is one of `SAVE_BLOCK', `SAVE_FUNCTION', or
14448 `SAVE_NONLOCAL' and selects which of the three named patterns is
14449 having its mode specified.
14451 You need not define this macro if it always returns `Pmode'. You
14452 would most commonly define this macro if the `save_stack_LEVEL'
14453 patterns need to support both a 32- and a 64-bit mode.
14455 - Macro: STACK_SIZE_MODE
14456 If defined, an expression of type `enum machine_mode' that
14457 specifies the mode of the size increment operand of an
14458 `allocate_stack' named pattern (*note Standard Names::).
14460 You need not define this macro if it always returns `word_mode'.
14461 You would most commonly define this macro if the `allocate_stack'
14462 pattern needs to support both a 32- and a 64-bit mode.
14464 - Macro: TARGET_FLOAT_FORMAT
14465 A code distinguishing the floating point format of the target
14466 machine. There are four defined values:
14468 `IEEE_FLOAT_FORMAT'
14469 This code indicates IEEE floating point. It is the default;
14470 there is no need to define `TARGET_FLOAT_FORMAT' when the
14474 This code indicates the "F float" (for `float') and "D float"
14475 or "G float" formats (for `double') used on the VAX and
14479 This code indicates the format used on the IBM System/370.
14482 This code indicates the format used on the TMS320C3x/C4x.
14484 If your target uses a floating point format other than these, you
14485 must define a new NAME_FLOAT_FORMAT code for it, and add support
14486 for it to `real.c'.
14488 The ordering of the component words of floating point values
14489 stored in memory is controlled by `FLOAT_WORDS_BIG_ENDIAN'.
14491 - Macro: MODE_HAS_NANS (MODE)
14492 When defined, this macro should be true if MODE has a NaN
14493 representation. The compiler assumes that NaNs are not equal to
14494 anything (including themselves) and that addition, subtraction,
14495 multiplication and division all return NaNs when one operand is
14498 By default, this macro is true if MODE is a floating-point mode
14499 and the target floating-point format is IEEE.
14501 - Macro: MODE_HAS_INFINITIES (MODE)
14502 This macro should be true if MODE can represent infinity. At
14503 present, the compiler uses this macro to decide whether `x - x' is
14504 always defined. By default, the macro is true when MODE is a
14505 floating-point mode and the target format is IEEE.
14507 - Macro: MODE_HAS_SIGNED_ZEROS (MODE)
14508 True if MODE distinguishes between positive and negative zero.
14509 The rules are expected to follow the IEEE standard:
14511 * `x + x' has the same sign as `x'.
14513 * If the sum of two values with opposite sign is zero, the
14514 result is positive for all rounding modes expect towards
14515 -infinity, for which it is negative.
14517 * The sign of a product or quotient is negative when exactly one
14518 of the operands is negative.
14520 The default definition is true if MODE is a floating-point mode
14521 and the target format is IEEE.
14523 - Macro: MODE_HAS_SIGN_DEPENDENT_ROUNDING (MODE)
14524 If defined, this macro should be true for MODE if it has at least
14525 one rounding mode in which `x' and `-x' can be rounded to numbers
14526 of different magnitude. Two such modes are towards -infinity and
14529 The default definition of this macro is true if MODE is a
14530 floating-point mode and the target format is IEEE.
14532 - Macro: ROUND_TOWARDS_ZERO
14533 If defined, this macro should be true if the prevailing rounding
14534 mode is towards zero. A true value has the following effects:
14536 * `MODE_HAS_SIGN_DEPENDENT_ROUNDING' will be false for all
14539 * `libgcc.a''s floating-point emulator will round towards zero
14540 rather than towards nearest.
14542 * The compiler's floating-point emulator will round towards
14543 zero after doing arithmetic, and when converting from the
14544 internal float format to the target format.
14546 The macro does not affect the parsing of string literals. When the
14547 primary rounding mode is towards zero, library functions like
14548 `strtod' might still round towards nearest, and the compiler's
14549 parser should behave like the target's `strtod' where possible.
14551 Not defining this macro is equivalent to returning zero.
14553 - Macro: LARGEST_EXPONENT_IS_NORMAL (SIZE)
14554 This macro should return true if floats with SIZE bits do not have
14555 a NaN or infinity representation, but use the largest exponent for
14556 normal numbers instead.
14558 Defining this macro to true for SIZE causes `MODE_HAS_NANS' and
14559 `MODE_HAS_INFINITIES' to be false for SIZE-bit modes. It also
14560 affects the way `libgcc.a' and `real.c' emulate floating-point
14563 The default definition of this macro returns false for all sizes.
14565 - Target Hook: bool TARGET_VECTOR_OPAQUE_P (tree TYPE)
14566 This target hook should return `true' a vector is opaque. That
14567 is, if no cast is needed when copying a vector value of type TYPE
14568 into another vector lvalue of the same size. Vector opaque types
14569 cannot be initialized. The default is that there are no such
14572 - Target Hook: bool TARGET_MS_BITFIELD_LAYOUT_P (tree RECORD_TYPE)
14573 This target hook returns `true' if bit-fields in the given
14574 RECORD_TYPE are to be laid out following the rules of Microsoft
14575 Visual C/C++, namely: (i) a bit-field won't share the same storage
14576 unit with the previous bit-field if their underlying types have
14577 different sizes, and the bit-field will be aligned to the highest
14578 alignment of the underlying types of itself and of the previous
14579 bit-field; (ii) a zero-sized bit-field will affect the alignment of
14580 the whole enclosing structure, even if it is unnamed; except that
14581 (iii) a zero-sized bit-field will be disregarded unless it follows
14582 another bit-field of nonzero size. If this hook returns `true',
14583 other macros that control bit-field layout are ignored.
14585 When a bit-field is inserted into a packed record, the whole size
14586 of the underlying type is used by one or more same-size adjacent
14587 bit-fields (that is, if its long:3, 32 bits is used in the record,
14588 and any additional adjacent long bit-fields are packed into the
14589 same chunk of 32 bits. However, if the size changes, a new field
14590 of that size is allocated). In an unpacked record, this is the
14591 same as using alignment, but not equivalent when packing.
14593 If both MS bit-fields and `__attribute__((packed))' are used, the
14594 latter will take precedence. If `__attribute__((packed))' is used
14595 on a single field when MS bit-fields are in use, it will take
14596 precedence for that field, but the alignment of the rest of the
14597 structure may affect its placement.
14599 - Target Hook: const char * TARGET_MANGLE_FUNDAMENTAL_TYPE (tree TYPE)
14600 If your target defines any fundamental types, define this hook to
14601 return the appropriate encoding for these types as part of a C++
14602 mangled name. The TYPE argument is the tree structure
14603 representing the type to be mangled. The hook may be applied to
14604 trees which are not target-specific fundamental types; it should
14605 return `NULL' for all such types, as well as arguments it does not
14606 recognize. If the return value is not `NULL', it must point to a
14607 statically-allocated string constant.
14609 Target-specific fundamental types might be new fundamental types or
14610 qualified versions of ordinary fundamental types. Encode new
14611 fundamental types as `u N NAME', where NAME is the name used for
14612 the type in source code, and N is the length of NAME in decimal.
14613 Encode qualified versions of ordinary types as `U N NAME CODE',
14614 where NAME is the name used for the type qualifier in source code,
14615 N is the length of NAME as above, and CODE is the code used to
14616 represent the unqualified version of this type. (See
14617 `write_builtin_type' in `cp/mangle.c' for the list of codes.) In
14618 both cases the spaces are for clarity; do not include any spaces
14621 The default version of this hook always returns `NULL', which is
14622 appropriate for a target that does not define any new fundamental
14626 File: gccint.info, Node: Type Layout, Next: Escape Sequences, Prev: Storage Layout, Up: Target Macros
14628 Layout of Source Language Data Types
14629 ====================================
14631 These macros define the sizes and other characteristics of the
14632 standard basic data types used in programs being compiled. Unlike the
14633 macros in the previous section, these apply to specific features of C
14634 and related languages, rather than to fundamental aspects of storage
14637 - Macro: INT_TYPE_SIZE
14638 A C expression for the size in bits of the type `int' on the
14639 target machine. If you don't define this, the default is one word.
14641 - Macro: SHORT_TYPE_SIZE
14642 A C expression for the size in bits of the type `short' on the
14643 target machine. If you don't define this, the default is half a
14644 word. (If this would be less than one storage unit, it is rounded
14647 - Macro: LONG_TYPE_SIZE
14648 A C expression for the size in bits of the type `long' on the
14649 target machine. If you don't define this, the default is one word.
14651 - Macro: ADA_LONG_TYPE_SIZE
14652 On some machines, the size used for the Ada equivalent of the type
14653 `long' by a native Ada compiler differs from that used by C. In
14654 that situation, define this macro to be a C expression to be used
14655 for the size of that type. If you don't define this, the default
14656 is the value of `LONG_TYPE_SIZE'.
14658 - Macro: MAX_LONG_TYPE_SIZE
14659 Maximum number for the size in bits of the type `long' on the
14660 target machine. If this is undefined, the default is
14661 `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the
14662 largest value that `LONG_TYPE_SIZE' can have at run-time. This is
14665 - Macro: LONG_LONG_TYPE_SIZE
14666 A C expression for the size in bits of the type `long long' on the
14667 target machine. If you don't define this, the default is two
14668 words. If you want to support GNU Ada on your machine, the value
14669 of this macro must be at least 64.
14671 - Macro: CHAR_TYPE_SIZE
14672 A C expression for the size in bits of the type `char' on the
14673 target machine. If you don't define this, the default is
14676 - Macro: BOOL_TYPE_SIZE
14677 A C expression for the size in bits of the C++ type `bool' and C99
14678 type `_Bool' on the target machine. If you don't define this, and
14679 you probably shouldn't, the default is `CHAR_TYPE_SIZE'.
14681 - Macro: FLOAT_TYPE_SIZE
14682 A C expression for the size in bits of the type `float' on the
14683 target machine. If you don't define this, the default is one word.
14685 - Macro: DOUBLE_TYPE_SIZE
14686 A C expression for the size in bits of the type `double' on the
14687 target machine. If you don't define this, the default is two
14690 - Macro: LONG_DOUBLE_TYPE_SIZE
14691 A C expression for the size in bits of the type `long double' on
14692 the target machine. If you don't define this, the default is two
14695 - Macro: MAX_LONG_DOUBLE_TYPE_SIZE
14696 Maximum number for the size in bits of the type `long double' on
14697 the target machine. If this is undefined, the default is
14698 `LONG_DOUBLE_TYPE_SIZE'. Otherwise, it is the constant value that
14699 is the largest value that `LONG_DOUBLE_TYPE_SIZE' can have at
14700 run-time. This is used in `cpp'.
14702 - Macro: TARGET_FLT_EVAL_METHOD
14703 A C expression for the value for `FLT_EVAL_METHOD' in `float.h',
14704 assuming, if applicable, that the floating-point control word is
14705 in its default state. If you do not define this macro the value of
14706 `FLT_EVAL_METHOD' will be zero.
14708 - Macro: WIDEST_HARDWARE_FP_SIZE
14709 A C expression for the size in bits of the widest floating-point
14710 format supported by the hardware. If you define this macro, you
14711 must specify a value less than or equal to the value of
14712 `LONG_DOUBLE_TYPE_SIZE'. If you do not define this macro, the
14713 value of `LONG_DOUBLE_TYPE_SIZE' is the default.
14715 - Macro: DEFAULT_SIGNED_CHAR
14716 An expression whose value is 1 or 0, according to whether the type
14717 `char' should be signed or unsigned by default. The user can
14718 always override this default with the options `-fsigned-char' and
14721 - Macro: DEFAULT_SHORT_ENUMS
14722 A C expression to determine whether to give an `enum' type only as
14723 many bytes as it takes to represent the range of possible values
14724 of that type. A nonzero value means to do that; a zero value
14725 means all `enum' types should be allocated like `int'.
14727 If you don't define the macro, the default is 0.
14730 A C expression for a string describing the name of the data type
14731 to use for size values. The typedef name `size_t' is defined
14732 using the contents of the string.
14734 The string can contain more than one keyword. If so, separate
14735 them with spaces, and write first any length keyword, then
14736 `unsigned' if appropriate, and finally `int'. The string must
14737 exactly match one of the data type names defined in the function
14738 `init_decl_processing' in the file `c-decl.c'. You may not omit
14739 `int' or change the order--that would cause the compiler to crash
14742 If you don't define this macro, the default is `"long unsigned
14745 - Macro: PTRDIFF_TYPE
14746 A C expression for a string describing the name of the data type
14747 to use for the result of subtracting two pointers. The typedef
14748 name `ptrdiff_t' is defined using the contents of the string. See
14749 `SIZE_TYPE' above for more information.
14751 If you don't define this macro, the default is `"long int"'.
14753 - Macro: WCHAR_TYPE
14754 A C expression for a string describing the name of the data type
14755 to use for wide characters. The typedef name `wchar_t' is defined
14756 using the contents of the string. See `SIZE_TYPE' above for more
14759 If you don't define this macro, the default is `"int"'.
14761 - Macro: WCHAR_TYPE_SIZE
14762 A C expression for the size in bits of the data type for wide
14763 characters. This is used in `cpp', which cannot make use of
14766 - Macro: MAX_WCHAR_TYPE_SIZE
14767 Maximum number for the size in bits of the data type for wide
14768 characters. If this is undefined, the default is
14769 `WCHAR_TYPE_SIZE'. Otherwise, it is the constant value that is the
14770 largest value that `WCHAR_TYPE_SIZE' can have at run-time. This is
14773 - Macro: GCOV_TYPE_SIZE
14774 A C expression for the size in bits of the type used for gcov
14775 counters on the target machine. If you don't define this, the
14776 default is one `LONG_TYPE_SIZE' in case it is greater or equal to
14777 64-bit and `LONG_LONG_TYPE_SIZE' otherwise. You may want to
14778 re-define the type to ensure atomicity for counters in
14779 multithreaded programs.
14782 A C expression for a string describing the name of the data type to
14783 use for wide characters passed to `printf' and returned from
14784 `getwc'. The typedef name `wint_t' is defined using the contents
14785 of the string. See `SIZE_TYPE' above for more information.
14787 If you don't define this macro, the default is `"unsigned int"'.
14789 - Macro: INTMAX_TYPE
14790 A C expression for a string describing the name of the data type
14791 that can represent any value of any standard or extended signed
14792 integer type. The typedef name `intmax_t' is defined using the
14793 contents of the string. See `SIZE_TYPE' above for more
14796 If you don't define this macro, the default is the first of
14797 `"int"', `"long int"', or `"long long int"' that has as much
14798 precision as `long long int'.
14800 - Macro: UINTMAX_TYPE
14801 A C expression for a string describing the name of the data type
14802 that can represent any value of any standard or extended unsigned
14803 integer type. The typedef name `uintmax_t' is defined using the
14804 contents of the string. See `SIZE_TYPE' above for more
14807 If you don't define this macro, the default is the first of
14808 `"unsigned int"', `"long unsigned int"', or `"long long unsigned
14809 int"' that has as much precision as `long long unsigned int'.
14811 - Macro: TARGET_PTRMEMFUNC_VBIT_LOCATION
14812 The C++ compiler represents a pointer-to-member-function with a
14813 struct that looks like:
14818 ptrdiff_t vtable_index;
14823 The C++ compiler must use one bit to indicate whether the function
14824 that will be called through a pointer-to-member-function is
14825 virtual. Normally, we assume that the low-order bit of a function
14826 pointer must always be zero. Then, by ensuring that the
14827 vtable_index is odd, we can distinguish which variant of the union
14828 is in use. But, on some platforms function pointers can be odd,
14829 and so this doesn't work. In that case, we use the low-order bit
14830 of the `delta' field, and shift the remainder of the `delta' field
14833 GCC will automatically make the right selection about where to
14834 store this bit using the `FUNCTION_BOUNDARY' setting for your
14835 platform. However, some platforms such as ARM/Thumb have
14836 `FUNCTION_BOUNDARY' set such that functions always start at even
14837 addresses, but the lowest bit of pointers to functions indicate
14838 whether the function at that address is in ARM or Thumb mode. If
14839 this is the case of your architecture, you should define this
14840 macro to `ptrmemfunc_vbit_in_delta'.
14842 In general, you should not have to define this macro. On
14843 architectures in which function addresses are always even,
14844 according to `FUNCTION_BOUNDARY', GCC will automatically define
14845 this macro to `ptrmemfunc_vbit_in_pfn'.
14847 - Macro: TARGET_VTABLE_USES_DESCRIPTORS
14848 Normally, the C++ compiler uses function pointers in vtables. This
14849 macro allows the target to change to use "function descriptors"
14850 instead. Function descriptors are found on targets for whom a
14851 function pointer is actually a small data structure. Normally the
14852 data structure consists of the actual code address plus a data
14853 pointer to which the function's data is relative.
14855 If vtables are used, the value of this macro should be the number
14856 of words that the function descriptor occupies.
14858 - Macro: TARGET_VTABLE_ENTRY_ALIGN
14859 By default, the vtable entries are void pointers, the so the
14860 alignment is the same as pointer alignment. The value of this
14861 macro specifies the alignment of the vtable entry in bits. It
14862 should be defined only when special alignment is necessary. */
14864 - Macro: TARGET_VTABLE_DATA_ENTRY_DISTANCE
14865 There are a few non-descriptor entries in the vtable at offsets
14866 below zero. If these entries must be padded (say, to preserve the
14867 alignment specified by `TARGET_VTABLE_ENTRY_ALIGN'), set this to
14868 the number of words in each data entry.
14871 File: gccint.info, Node: Escape Sequences, Next: Registers, Prev: Type Layout, Up: Target Macros
14873 Target Character Escape Sequences
14874 =================================
14876 By default, GCC assumes that the C character escape sequences take on
14877 their ASCII values for the target. If this is not correct, you must
14878 explicitly define all of the macros below. All of them must evaluate
14879 to constants; they are used in `case' statements.
14881 Macro Escape ASCII character
14882 `TARGET_BELL' `\a' `07', `BEL'
14883 `TARGET_CR' `\r' `0D', `CR'
14884 `TARGET_ESC' `\e', `1B', `ESC'
14886 `TARGET_FF' `\f' `0C', `FF'
14887 `TARGET_NEWLINE' `\n' `0A', `LF'
14888 `TARGET_TAB' `\t' `09', `HT'
14889 `TARGET_VT' `\v' `0B', `VT'
14891 Note that the `\e' and `\E' escapes are GNU extensions, not part of the
14895 File: gccint.info, Node: Registers, Next: Register Classes, Prev: Escape Sequences, Up: Target Macros
14900 This section explains how to describe what registers the target
14901 machine has, and how (in general) they can be used.
14903 The description of which registers a specific instruction can use is
14904 done with register classes; see *Note Register Classes::. For
14905 information on using registers to access a stack frame, see *Note Frame
14906 Registers::. For passing values in registers, see *Note Register
14907 Arguments::. For returning values in registers, see *Note Scalar
14912 * Register Basics:: Number and kinds of registers.
14913 * Allocation Order:: Order in which registers are allocated.
14914 * Values in Registers:: What kinds of values each reg can hold.
14915 * Leaf Functions:: Renumbering registers for leaf functions.
14916 * Stack Registers:: Handling a register stack such as 80387.
14919 File: gccint.info, Node: Register Basics, Next: Allocation Order, Up: Registers
14921 Basic Characteristics of Registers
14922 ----------------------------------
14924 Registers have various characteristics.
14926 - Macro: FIRST_PSEUDO_REGISTER
14927 Number of hardware registers known to the compiler. They receive
14928 numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first
14929 pseudo register's number really is assigned the number
14930 `FIRST_PSEUDO_REGISTER'.
14932 - Macro: FIXED_REGISTERS
14933 An initializer that says which registers are used for fixed
14934 purposes all throughout the compiled code and are therefore not
14935 available for general allocation. These would include the stack
14936 pointer, the frame pointer (except on machines where that can be
14937 used as a general register when no frame pointer is needed), the
14938 program counter on machines where that is considered one of the
14939 addressable registers, and any other numbered register with a
14942 This information is expressed as a sequence of numbers, separated
14943 by commas and surrounded by braces. The Nth number is 1 if
14944 register N is fixed, 0 otherwise.
14946 The table initialized from this macro, and the table initialized by
14947 the following one, may be overridden at run time either
14948 automatically, by the actions of the macro
14949 `CONDITIONAL_REGISTER_USAGE', or by the user with the command
14950 options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'.
14952 - Macro: CALL_USED_REGISTERS
14953 Like `FIXED_REGISTERS' but has 1 for each register that is
14954 clobbered (in general) by function calls as well as for fixed
14955 registers. This macro therefore identifies the registers that are
14956 not available for general allocation of values that must live
14957 across function calls.
14959 If a register has 0 in `CALL_USED_REGISTERS', the compiler
14960 automatically saves it on function entry and restores it on
14961 function exit, if the register is used within the function.
14963 - Macro: CALL_REALLY_USED_REGISTERS
14964 Like `CALL_USED_REGISTERS' except this macro doesn't require that
14965 the entire set of `FIXED_REGISTERS' be included.
14966 (`CALL_USED_REGISTERS' must be a superset of `FIXED_REGISTERS').
14967 This macro is optional. If not specified, it defaults to the value
14968 of `CALL_USED_REGISTERS'.
14970 - Macro: HARD_REGNO_CALL_PART_CLOBBERED (REGNO, MODE)
14971 A C expression that is nonzero if it is not permissible to store a
14972 value of mode MODE in hard register number REGNO across a call
14973 without some part of it being clobbered. For most machines this
14974 macro need not be defined. It is only required for machines that
14975 do not preserve the entire contents of a register across a call.
14977 - Macro: CONDITIONAL_REGISTER_USAGE
14978 Zero or more C statements that may conditionally modify five
14979 variables `fixed_regs', `call_used_regs', `global_regs',
14980 `reg_names', and `reg_class_contents', to take into account any
14981 dependence of these register sets on target flags. The first three
14982 of these are of type `char []' (interpreted as Boolean vectors).
14983 `global_regs' is a `const char *[]', and `reg_class_contents' is a
14984 `HARD_REG_SET'. Before the macro is called, `fixed_regs',
14985 `call_used_regs', `reg_class_contents', and `reg_names' have been
14986 initialized from `FIXED_REGISTERS', `CALL_USED_REGISTERS',
14987 `REG_CLASS_CONTENTS', and `REGISTER_NAMES', respectively.
14988 `global_regs' has been cleared, and any `-ffixed-REG',
14989 `-fcall-used-REG' and `-fcall-saved-REG' command options have been
14992 You need not define this macro if it has no work to do.
14994 If the usage of an entire class of registers depends on the target
14995 flags, you may indicate this to GCC by using this macro to modify
14996 `fixed_regs' and `call_used_regs' to 1 for each of the registers
14997 in the classes which should not be used by GCC. Also define the
14998 macro `REG_CLASS_FROM_LETTER' / `REG_CLASS_FROM_CONSTRAINT' to
14999 return `NO_REGS' if it is called with a letter for a class that
15002 (However, if this class is not included in `GENERAL_REGS' and all
15003 of the insn patterns whose constraints permit this class are
15004 controlled by target switches, then GCC will automatically avoid
15005 using these registers when the target switches are opposed to
15008 - Macro: NON_SAVING_SETJMP
15009 If this macro is defined and has a nonzero value, it means that
15010 `setjmp' and related functions fail to save the registers, or that
15011 `longjmp' fails to restore them. To compensate, the compiler
15012 avoids putting variables in registers in functions that use
15015 - Macro: INCOMING_REGNO (OUT)
15016 Define this macro if the target machine has register windows.
15017 This C expression returns the register number as seen by the
15018 called function corresponding to the register number OUT as seen
15019 by the calling function. Return OUT if register number OUT is not
15020 an outbound register.
15022 - Macro: OUTGOING_REGNO (IN)
15023 Define this macro if the target machine has register windows.
15024 This C expression returns the register number as seen by the
15025 calling function corresponding to the register number IN as seen
15026 by the called function. Return IN if register number IN is not an
15029 - Macro: LOCAL_REGNO (REGNO)
15030 Define this macro if the target machine has register windows.
15031 This C expression returns true if the register is call-saved but
15032 is in the register window. Unlike most call-saved registers, such
15033 registers need not be explicitly restored on function exit or
15034 during non-local gotos.
15037 If the program counter has a register number, define this as that
15038 register number. Otherwise, do not define it.
15041 File: gccint.info, Node: Allocation Order, Next: Values in Registers, Prev: Register Basics, Up: Registers
15043 Order of Allocation of Registers
15044 --------------------------------
15046 Registers are allocated in order.
15048 - Macro: REG_ALLOC_ORDER
15049 If defined, an initializer for a vector of integers, containing the
15050 numbers of hard registers in the order in which GCC should prefer
15051 to use them (from most preferred to least).
15053 If this macro is not defined, registers are used lowest numbered
15054 first (all else being equal).
15056 One use of this macro is on machines where the highest numbered
15057 registers must always be saved and the save-multiple-registers
15058 instruction supports only sequences of consecutive registers. On
15059 such machines, define `REG_ALLOC_ORDER' to be an initializer that
15060 lists the highest numbered allocable register first.
15062 - Macro: ORDER_REGS_FOR_LOCAL_ALLOC
15063 A C statement (sans semicolon) to choose the order in which to
15064 allocate hard registers for pseudo-registers local to a basic
15067 Store the desired register order in the array `reg_alloc_order'.
15068 Element 0 should be the register to allocate first; element 1, the
15069 next register; and so on.
15071 The macro body should not assume anything about the contents of
15072 `reg_alloc_order' before execution of the macro.
15074 On most machines, it is not necessary to define this macro.
15077 File: gccint.info, Node: Values in Registers, Next: Leaf Functions, Prev: Allocation Order, Up: Registers
15079 How Values Fit in Registers
15080 ---------------------------
15082 This section discusses the macros that describe which kinds of values
15083 (specifically, which machine modes) each register can hold, and how many
15084 consecutive registers are needed for a given mode.
15086 - Macro: HARD_REGNO_NREGS (REGNO, MODE)
15087 A C expression for the number of consecutive hard registers,
15088 starting at register number REGNO, required to hold a value of mode
15091 On a machine where all registers are exactly one word, a suitable
15092 definition of this macro is
15094 #define HARD_REGNO_NREGS(REGNO, MODE) \
15095 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
15098 - Macro: REGMODE_NATURAL_SIZE (MODE)
15099 Define this macro if the natural size of registers that hold values
15100 of mode MODE is not the word size. It is a C expression that
15101 should give the natural size in bytes for the specified mode. It
15102 is used by the register allocator to try to optimize its results.
15103 This happens for example on SPARC 64-bit where the natural size of
15104 floating-point registers is still 32-bit.
15106 - Macro: HARD_REGNO_MODE_OK (REGNO, MODE)
15107 A C expression that is nonzero if it is permissible to store a
15108 value of mode MODE in hard register number REGNO (or in several
15109 registers starting with that one). For a machine where all
15110 registers are equivalent, a suitable definition is
15112 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
15114 You need not include code to check for the numbers of fixed
15115 registers, because the allocation mechanism considers them to be
15118 On some machines, double-precision values must be kept in even/odd
15119 register pairs. You can implement that by defining this macro to
15120 reject odd register numbers for such modes.
15122 The minimum requirement for a mode to be OK in a register is that
15123 the `movMODE' instruction pattern support moves between the
15124 register and other hard register in the same class and that moving
15125 a value into the register and back out not alter it.
15127 Since the same instruction used to move `word_mode' will work for
15128 all narrower integer modes, it is not necessary on any machine for
15129 `HARD_REGNO_MODE_OK' to distinguish between these modes, provided
15130 you define patterns `movhi', etc., to take advantage of this. This
15131 is useful because of the interaction between `HARD_REGNO_MODE_OK'
15132 and `MODES_TIEABLE_P'; it is very desirable for all integer modes
15135 Many machines have special registers for floating point arithmetic.
15136 Often people assume that floating point machine modes are allowed
15137 only in floating point registers. This is not true. Any
15138 registers that can hold integers can safely _hold_ a floating
15139 point machine mode, whether or not floating arithmetic can be done
15140 on it in those registers. Integer move instructions can be used
15141 to move the values.
15143 On some machines, though, the converse is true: fixed-point machine
15144 modes may not go in floating registers. This is true if the
15145 floating registers normalize any value stored in them, because
15146 storing a non-floating value there would garble it. In this case,
15147 `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in
15148 floating registers. But if the floating registers do not
15149 automatically normalize, if you can store any bit pattern in one
15150 and retrieve it unchanged without a trap, then any machine mode
15151 may go in a floating register, so you can define this macro to say
15154 The primary significance of special floating registers is rather
15155 that they are the registers acceptable in floating point arithmetic
15156 instructions. However, this is of no concern to
15157 `HARD_REGNO_MODE_OK'. You handle it by writing the proper
15158 constraints for those instructions.
15160 On some machines, the floating registers are especially slow to
15161 access, so that it is better to store a value in a stack frame
15162 than in such a register if floating point arithmetic is not being
15163 done. As long as the floating registers are not in class
15164 `GENERAL_REGS', they will not be used unless some pattern's
15165 constraint asks for one.
15167 - Macro: MODES_TIEABLE_P (MODE1, MODE2)
15168 A C expression that is nonzero if a value of mode MODE1 is
15169 accessible in mode MODE2 without copying.
15171 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
15172 MODE2)' are always the same for any R, then `MODES_TIEABLE_P
15173 (MODE1, MODE2)' should be nonzero. If they differ for any R, you
15174 should define this macro to return zero unless some other
15175 mechanism ensures the accessibility of the value in a narrower
15178 You should define this macro to return nonzero in as many cases as
15179 possible since doing so will allow GCC to perform better register
15182 - Macro: AVOID_CCMODE_COPIES
15183 Define this macro if the compiler should avoid copies to/from
15184 `CCmode' registers. You should only define this macro if support
15185 for copying to/from `CCmode' is incomplete.
15188 File: gccint.info, Node: Leaf Functions, Next: Stack Registers, Prev: Values in Registers, Up: Registers
15190 Handling Leaf Functions
15191 -----------------------
15193 On some machines, a leaf function (i.e., one which makes no calls)
15194 can run more efficiently if it does not make its own register window.
15195 Often this means it is required to receive its arguments in the
15196 registers where they are passed by the caller, instead of the registers
15197 where they would normally arrive.
15199 The special treatment for leaf functions generally applies only when
15200 other conditions are met; for example, often they may use only those
15201 registers for its own variables and temporaries. We use the term "leaf
15202 function" to mean a function that is suitable for this special
15203 handling, so that functions with no calls are not necessarily "leaf
15206 GCC assigns register numbers before it knows whether the function is
15207 suitable for leaf function treatment. So it needs to renumber the
15208 registers in order to output a leaf function. The following macros
15211 - Macro: LEAF_REGISTERS
15212 Name of a char vector, indexed by hard register number, which
15213 contains 1 for a register that is allowable in a candidate for leaf
15214 function treatment.
15216 If leaf function treatment involves renumbering the registers,
15217 then the registers marked here should be the ones before
15218 renumbering--those that GCC would ordinarily allocate. The
15219 registers which will actually be used in the assembler code, after
15220 renumbering, should not be marked with 1 in this vector.
15222 Define this macro only if the target machine offers a way to
15223 optimize the treatment of leaf functions.
15225 - Macro: LEAF_REG_REMAP (REGNO)
15226 A C expression whose value is the register number to which REGNO
15227 should be renumbered, when a function is treated as a leaf
15230 If REGNO is a register number which should not appear in a leaf
15231 function before renumbering, then the expression should yield -1,
15232 which will cause the compiler to abort.
15234 Define this macro only if the target machine offers a way to
15235 optimize the treatment of leaf functions, and registers need to be
15236 renumbered to do this.
15238 `TARGET_ASM_FUNCTION_PROLOGUE' and `TARGET_ASM_FUNCTION_EPILOGUE'
15239 must usually treat leaf functions specially. They can test the C
15240 variable `current_function_is_leaf' which is nonzero for leaf
15241 functions. `current_function_is_leaf' is set prior to local register
15242 allocation and is valid for the remaining compiler passes. They can
15243 also test the C variable `current_function_uses_only_leaf_regs' which
15244 is nonzero for leaf functions which only use leaf registers.
15245 `current_function_uses_only_leaf_regs' is valid after reload and is
15246 only useful if `LEAF_REGISTERS' is defined.
15249 File: gccint.info, Node: Stack Registers, Prev: Leaf Functions, Up: Registers
15251 Registers That Form a Stack
15252 ---------------------------
15254 There are special features to handle computers where some of the
15255 "registers" form a stack. Stack registers are normally written by
15256 pushing onto the stack, and are numbered relative to the top of the
15259 Currently, GCC can only handle one group of stack-like registers, and
15260 they must be consecutively numbered. Furthermore, the existing support
15261 for stack-like registers is specific to the 80387 floating point
15262 coprocessor. If you have a new architecture that uses stack-like
15263 registers, you will need to do substantial work on `reg-stack.c' and
15264 write your machine description to cooperate with it, as well as
15265 defining these macros.
15267 - Macro: STACK_REGS
15268 Define this if the machine has any stack-like registers.
15270 - Macro: FIRST_STACK_REG
15271 The number of the first stack-like register. This one is the top
15274 - Macro: LAST_STACK_REG
15275 The number of the last stack-like register. This one is the
15276 bottom of the stack.
15279 File: gccint.info, Node: Register Classes, Next: Stack and Calling, Prev: Registers, Up: Target Macros
15284 On many machines, the numbered registers are not all equivalent.
15285 For example, certain registers may not be allowed for indexed
15286 addressing; certain registers may not be allowed in some instructions.
15287 These machine restrictions are described to the compiler using
15288 "register classes".
15290 You define a number of register classes, giving each one a name and
15291 saying which of the registers belong to it. Then you can specify
15292 register classes that are allowed as operands to particular instruction
15295 In general, each register will belong to several classes. In fact,
15296 one class must be named `ALL_REGS' and contain all the registers.
15297 Another class must be named `NO_REGS' and contain no registers. Often
15298 the union of two classes will be another class; however, this is not
15301 One of the classes must be named `GENERAL_REGS'. There is nothing
15302 terribly special about the name, but the operand constraint letters `r'
15303 and `g' specify this class. If `GENERAL_REGS' is the same as
15304 `ALL_REGS', just define it as a macro which expands to `ALL_REGS'.
15306 Order the classes so that if class X is contained in class Y then X
15307 has a lower class number than Y.
15309 The way classes other than `GENERAL_REGS' are specified in operand
15310 constraints is through machine-dependent operand constraint letters.
15311 You can define such letters to correspond to various classes, then use
15312 them in operand constraints.
15314 You should define a class for the union of two classes whenever some
15315 instruction allows both classes. For example, if an instruction allows
15316 either a floating point (coprocessor) register or a general register
15317 for a certain operand, you should define a class `FLOAT_OR_GENERAL_REGS'
15318 which includes both of them. Otherwise you will get suboptimal code.
15320 You must also specify certain redundant information about the
15321 register classes: for each class, which classes contain it and which
15322 ones are contained in it; for each pair of classes, the largest class
15323 contained in their union.
15325 When a value occupying several consecutive registers is expected in a
15326 certain class, all the registers used must belong to that class.
15327 Therefore, register classes cannot be used to enforce a requirement for
15328 a register pair to start with an even-numbered register. The way to
15329 specify this requirement is with `HARD_REGNO_MODE_OK'.
15331 Register classes used for input-operands of bitwise-and or shift
15332 instructions have a special requirement: each such class must have, for
15333 each fixed-point machine mode, a subclass whose registers can transfer
15334 that mode to or from memory. For example, on some machines, the
15335 operations for single-byte values (`QImode') are limited to certain
15336 registers. When this is so, each register class that is used in a
15337 bitwise-and or shift instruction must have a subclass consisting of
15338 registers from which single-byte values can be loaded or stored. This
15339 is so that `PREFERRED_RELOAD_CLASS' can always have a possible value to
15342 - Data type: enum reg_class
15343 An enumerated type that must be defined with all the register
15344 class names as enumerated values. `NO_REGS' must be first.
15345 `ALL_REGS' must be the last register class, followed by one more
15346 enumerated value, `LIM_REG_CLASSES', which is not a register class
15347 but rather tells how many classes there are.
15349 Each register class has a number, which is the value of casting
15350 the class name to type `int'. The number serves as an index in
15351 many of the tables described below.
15353 - Macro: N_REG_CLASSES
15354 The number of distinct register classes, defined as follows:
15356 #define N_REG_CLASSES (int) LIM_REG_CLASSES
15358 - Macro: REG_CLASS_NAMES
15359 An initializer containing the names of the register classes as C
15360 string constants. These names are used in writing some of the
15363 - Macro: REG_CLASS_CONTENTS
15364 An initializer containing the contents of the register classes, as
15365 integers which are bit masks. The Nth integer specifies the
15366 contents of class N. The way the integer MASK is interpreted is
15367 that register R is in the class if `MASK & (1 << R)' is 1.
15369 When the machine has more than 32 registers, an integer does not
15370 suffice. Then the integers are replaced by sub-initializers,
15371 braced groupings containing several integers. Each
15372 sub-initializer must be suitable as an initializer for the type
15373 `HARD_REG_SET' which is defined in `hard-reg-set.h'. In this
15374 situation, the first integer in each sub-initializer corresponds to
15375 registers 0 through 31, the second integer to registers 32 through
15378 - Macro: REGNO_REG_CLASS (REGNO)
15379 A C expression whose value is a register class containing hard
15380 register REGNO. In general there is more than one such class;
15381 choose a class which is "minimal", meaning that no smaller class
15382 also contains the register.
15384 - Macro: BASE_REG_CLASS
15385 A macro whose definition is the name of the class to which a valid
15386 base register must belong. A base register is one used in an
15387 address which is the register value plus a displacement.
15389 - Macro: MODE_BASE_REG_CLASS (MODE)
15390 This is a variation of the `BASE_REG_CLASS' macro which allows the
15391 selection of a base register in a mode dependent manner. If MODE
15392 is VOIDmode then it should return the same value as
15395 - Macro: INDEX_REG_CLASS
15396 A macro whose definition is the name of the class to which a valid
15397 index register must belong. An index register is one used in an
15398 address where its value is either multiplied by a scale factor or
15399 added to another register (as well as added to a displacement).
15401 - Macro: CONSTRAINT_LEN (CHAR, STR)
15402 For the constraint at the start of STR, which starts with the
15403 letter C, return the length. This allows you to have register
15404 class / constant / extra constraints that are longer than a single
15405 letter; you don't need to define this macro if you can do with
15406 single-letter constraints only. The definition of this macro
15407 should use DEFAULT_CONSTRAINT_LEN for all the characters that you
15408 don't want to handle specially. There are some sanity checks in
15409 genoutput.c that check the constraint lengths for the md file, so
15410 you can also use this macro to help you while you are
15411 transitioning from a byzantine single-letter-constraint scheme:
15412 when you return a negative length for a constraint you want to
15413 re-use, genoutput will complain about every instance where it is
15414 used in the md file.
15416 - Macro: REG_CLASS_FROM_LETTER (CHAR)
15417 A C expression which defines the machine-dependent operand
15418 constraint letters for register classes. If CHAR is such a
15419 letter, the value should be the register class corresponding to
15420 it. Otherwise, the value should be `NO_REGS'. The register
15421 letter `r', corresponding to class `GENERAL_REGS', will not be
15422 passed to this macro; you do not need to handle it.
15424 - Macro: REG_CLASS_FROM_CONSTRAINT (CHAR, STR)
15425 Like `REG_CLASS_FROM_LETTER', but you also get the constraint
15426 string passed in STR, so that you can use suffixes to distinguish
15427 between different variants.
15429 - Macro: REGNO_OK_FOR_BASE_P (NUM)
15430 A C expression which is nonzero if register number NUM is suitable
15431 for use as a base register in operand addresses. It may be either
15432 a suitable hard register or a pseudo register that has been
15433 allocated such a hard register.
15435 - Macro: REGNO_MODE_OK_FOR_BASE_P (NUM, MODE)
15436 A C expression that is just like `REGNO_OK_FOR_BASE_P', except that
15437 that expression may examine the mode of the memory reference in
15438 MODE. You should define this macro if the mode of the memory
15439 reference affects whether a register may be used as a base
15440 register. If you define this macro, the compiler will use it
15441 instead of `REGNO_OK_FOR_BASE_P'.
15443 - Macro: REGNO_OK_FOR_INDEX_P (NUM)
15444 A C expression which is nonzero if register number NUM is suitable
15445 for use as an index register in operand addresses. It may be
15446 either a suitable hard register or a pseudo register that has been
15447 allocated such a hard register.
15449 The difference between an index register and a base register is
15450 that the index register may be scaled. If an address involves the
15451 sum of two registers, neither one of them scaled, then either one
15452 may be labeled the "base" and the other the "index"; but whichever
15453 labeling is used must fit the machine's constraints of which
15454 registers may serve in each capacity. The compiler will try both
15455 labelings, looking for one that is valid, and will reload one or
15456 both registers only if neither labeling works.
15458 - Macro: PREFERRED_RELOAD_CLASS (X, CLASS)
15459 A C expression that places additional restrictions on the register
15460 class to use when it is necessary to copy value X into a register
15461 in class CLASS. The value is a register class; perhaps CLASS, or
15462 perhaps another, smaller class. On many machines, the following
15463 definition is safe:
15465 #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
15467 Sometimes returning a more restrictive class makes better code.
15468 For example, on the 68000, when X is an integer constant that is
15469 in range for a `moveq' instruction, the value of this macro is
15470 always `DATA_REGS' as long as CLASS includes the data registers.
15471 Requiring a data register guarantees that a `moveq' will be used.
15473 One case where `PREFERRED_RELOAD_CLASS' must not return CLASS is
15474 if X is a legitimate constant which cannot be loaded into some
15475 register class. By returning `NO_REGS' you can force X into a
15476 memory location. For example, rs6000 can load immediate values
15477 into general-purpose registers, but does not have an instruction
15478 for loading an immediate value into a floating-point register, so
15479 `PREFERRED_RELOAD_CLASS' returns `NO_REGS' when X is a
15480 floating-point constant. If the constant can't be loaded into any
15481 kind of register, code generation will be better if
15482 `LEGITIMATE_CONSTANT_P' makes the constant illegitimate instead of
15483 using `PREFERRED_RELOAD_CLASS'.
15485 - Macro: PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)
15486 Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of
15487 input reloads. If you don't define this macro, the default is to
15488 use CLASS, unchanged.
15490 - Macro: LIMIT_RELOAD_CLASS (MODE, CLASS)
15491 A C expression that places additional restrictions on the register
15492 class to use when it is necessary to be able to hold a value of
15493 mode MODE in a reload register for which class CLASS would
15494 ordinarily be used.
15496 Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when
15497 there are certain modes that simply can't go in certain reload
15500 The value is a register class; perhaps CLASS, or perhaps another,
15503 Don't define this macro unless the target machine has limitations
15504 which require the macro to do something nontrivial.
15506 - Macro: SECONDARY_RELOAD_CLASS (CLASS, MODE, X)
15507 - Macro: SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X)
15508 - Macro: SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)
15509 Many machines have some registers that cannot be copied directly
15510 to or from memory or even from other types of registers. An
15511 example is the `MQ' register, which on most machines, can only be
15512 copied to or from general registers, but not memory. Some
15513 machines allow copying all registers to and from memory, but
15514 require a scratch register for stores to some memory locations
15515 (e.g., those with symbolic address on the RT, and those with
15516 certain symbolic address on the SPARC when compiling PIC). In
15517 some cases, both an intermediate and a scratch register are
15520 You should define these macros to indicate to the reload phase
15521 that it may need to allocate at least one register for a reload in
15522 addition to the register to contain the data. Specifically, if
15523 copying X to a register CLASS in MODE requires an intermediate
15524 register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to
15525 return the largest register class all of whose registers can be
15526 used as intermediate registers or scratch registers.
15528 If copying a register CLASS in MODE to X requires an intermediate
15529 or scratch register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be
15530 defined to return the largest register class required. If the
15531 requirements for input and output reloads are the same, the macro
15532 `SECONDARY_RELOAD_CLASS' should be used instead of defining both
15533 macros identically.
15535 The values returned by these macros are often `GENERAL_REGS'.
15536 Return `NO_REGS' if no spare register is needed; i.e., if X can be
15537 directly copied to or from a register of CLASS in MODE without
15538 requiring a scratch register. Do not define this macro if it
15539 would always return `NO_REGS'.
15541 If a scratch register is required (either with or without an
15542 intermediate register), you should define patterns for
15543 `reload_inM' or `reload_outM', as required (*note Standard
15544 Names::. These patterns, which will normally be implemented with
15545 a `define_expand', should be similar to the `movM' patterns,
15546 except that operand 2 is the scratch register.
15548 Define constraints for the reload register and scratch register
15549 that contain a single register class. If the original reload
15550 register (whose class is CLASS) can meet the constraint given in
15551 the pattern, the value returned by these macros is used for the
15552 class of the scratch register. Otherwise, two additional reload
15553 registers are required. Their classes are obtained from the
15554 constraints in the insn pattern.
15556 X might be a pseudo-register or a `subreg' of a pseudo-register,
15557 which could either be in a hard register or in memory. Use
15558 `true_regnum' to find out; it will return -1 if the pseudo is in
15559 memory and the hard register number if it is in a register.
15561 These macros should not be used in the case where a particular
15562 class of registers can only be copied to memory and not to another
15563 class of registers. In that case, secondary reload registers are
15564 not needed and would not be helpful. Instead, a stack location
15565 must be used to perform the copy and the `movM' pattern should use
15566 memory as an intermediate storage. This case often occurs between
15567 floating-point and general registers.
15569 - Macro: SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)
15570 Certain machines have the property that some registers cannot be
15571 copied to some other registers without using memory. Define this
15572 macro on those machines to be a C expression that is nonzero if
15573 objects of mode M in registers of CLASS1 can only be copied to
15574 registers of class CLASS2 by storing a register of CLASS1 into
15575 memory and loading that memory location into a register of CLASS2.
15577 Do not define this macro if its value would always be zero.
15579 - Macro: SECONDARY_MEMORY_NEEDED_RTX (MODE)
15580 Normally when `SECONDARY_MEMORY_NEEDED' is defined, the compiler
15581 allocates a stack slot for a memory location needed for register
15582 copies. If this macro is defined, the compiler instead uses the
15583 memory location defined by this macro.
15585 Do not define this macro if you do not define
15586 `SECONDARY_MEMORY_NEEDED'.
15588 - Macro: SECONDARY_MEMORY_NEEDED_MODE (MODE)
15589 When the compiler needs a secondary memory location to copy
15590 between two registers of mode MODE, it normally allocates
15591 sufficient memory to hold a quantity of `BITS_PER_WORD' bits and
15592 performs the store and load operations in a mode that many bits
15593 wide and whose class is the same as that of MODE.
15595 This is right thing to do on most machines because it ensures that
15596 all bits of the register are copied and prevents accesses to the
15597 registers in a narrower mode, which some machines prohibit for
15598 floating-point registers.
15600 However, this default behavior is not correct on some machines,
15601 such as the DEC Alpha, that store short integers in floating-point
15602 registers differently than in integer registers. On those
15603 machines, the default widening will not work correctly and you
15604 must define this macro to suppress that widening in some cases.
15605 See the file `alpha.h' for details.
15607 Do not define this macro if you do not define
15608 `SECONDARY_MEMORY_NEEDED' or if widening MODE to a mode that is
15609 `BITS_PER_WORD' bits wide is correct for your machine.
15611 - Macro: SMALL_REGISTER_CLASSES
15612 On some machines, it is risky to let hard registers live across
15613 arbitrary insns. Typically, these machines have instructions that
15614 require values to be in specific registers (like an accumulator),
15615 and reload will fail if the required hard register is used for
15616 another purpose across such an insn.
15618 Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero
15619 value on these machines. When this macro has a nonzero value, the
15620 compiler will try to minimize the lifetime of hard registers.
15622 It is always safe to define this macro with a nonzero value, but
15623 if you unnecessarily define it, you will reduce the amount of
15624 optimizations that can be performed in some cases. If you do not
15625 define this macro with a nonzero value when it is required, the
15626 compiler will run out of spill registers and print a fatal error
15627 message. For most machines, you should not define this macro at
15630 - Macro: CLASS_LIKELY_SPILLED_P (CLASS)
15631 A C expression whose value is nonzero if pseudos that have been
15632 assigned to registers of class CLASS would likely be spilled
15633 because registers of CLASS are needed for spill registers.
15635 The default value of this macro returns 1 if CLASS has exactly one
15636 register and zero otherwise. On most machines, this default
15637 should be used. Only define this macro to some other expression
15638 if pseudos allocated by `local-alloc.c' end up in memory because
15639 their hard registers were needed for spill registers. If this
15640 macro returns nonzero for those classes, those pseudos will only
15641 be allocated by `global.c', which knows how to reallocate the
15642 pseudo to another register. If there would not be another
15643 register available for reallocation, you should not change the
15644 definition of this macro since the only effect of such a
15645 definition would be to slow down register allocation.
15647 - Macro: CLASS_MAX_NREGS (CLASS, MODE)
15648 A C expression for the maximum number of consecutive registers of
15649 class CLASS needed to hold a value of mode MODE.
15651 This is closely related to the macro `HARD_REGNO_NREGS'. In fact,
15652 the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be
15653 the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all
15654 REGNO values in the class CLASS.
15656 This macro helps control the handling of multiple-word values in
15659 - Macro: CANNOT_CHANGE_MODE_CLASS (FROM, TO, CLASS)
15660 If defined, a C expression that returns nonzero for a CLASS for
15661 which a change from mode FROM to mode TO is invalid.
15663 For the example, loading 32-bit integer or floating-point objects
15664 into floating-point registers on the Alpha extends them to 64 bits.
15665 Therefore loading a 64-bit object and then storing it as a 32-bit
15666 object does not store the low-order 32 bits, as would be the case
15667 for a normal register. Therefore, `alpha.h' defines
15668 `CANNOT_CHANGE_MODE_CLASS' as below:
15670 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
15671 (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
15672 ? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0)
15674 Three other special macros describe which operands fit which
15675 constraint letters.
15677 - Macro: CONST_OK_FOR_LETTER_P (VALUE, C)
15678 A C expression that defines the machine-dependent operand
15679 constraint letters (`I', `J', `K', ... `P') that specify
15680 particular ranges of integer values. If C is one of those
15681 letters, the expression should check that VALUE, an integer, is in
15682 the appropriate range and return 1 if so, 0 otherwise. If C is
15683 not one of those letters, the value should be 0 regardless of
15686 - Macro: CONST_OK_FOR_CONSTRAINT_P (VALUE, C, STR)
15687 Like `CONST_OK_FOR_LETTER_P', but you also get the constraint
15688 string passed in STR, so that you can use suffixes to distinguish
15689 between different variants.
15691 - Macro: CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)
15692 A C expression that defines the machine-dependent operand
15693 constraint letters that specify particular ranges of
15694 `const_double' values (`G' or `H').
15696 If C is one of those letters, the expression should check that
15697 VALUE, an RTX of code `const_double', is in the appropriate range
15698 and return 1 if so, 0 otherwise. If C is not one of those
15699 letters, the value should be 0 regardless of VALUE.
15701 `const_double' is used for all floating-point constants and for
15702 `DImode' fixed-point constants. A given letter can accept either
15703 or both kinds of values. It can use `GET_MODE' to distinguish
15704 between these kinds.
15706 - Macro: CONST_DOUBLE_OK_FOR_CONSTRAINT_P (VALUE, C, STR)
15707 Like `CONST_DOUBLE_OK_FOR_LETTER_P', but you also get the
15708 constraint string passed in STR, so that you can use suffixes to
15709 distinguish between different variants.
15711 - Macro: EXTRA_CONSTRAINT (VALUE, C)
15712 A C expression that defines the optional machine-dependent
15713 constraint letters that can be used to segregate specific types of
15714 operands, usually memory references, for the target machine. Any
15715 letter that is not elsewhere defined and not matched by
15716 `REG_CLASS_FROM_LETTER' / `REG_CLASS_FROM_CONSTRAINT' may be used.
15717 Normally this macro will not be defined.
15719 If it is required for a particular target machine, it should
15720 return 1 if VALUE corresponds to the operand type represented by
15721 the constraint letter C. If C is not defined as an extra
15722 constraint, the value returned should be 0 regardless of VALUE.
15724 For example, on the ROMP, load instructions cannot have their
15725 output in r0 if the memory reference contains a symbolic address.
15726 Constraint letter `Q' is defined as representing a memory address
15727 that does _not_ contain a symbolic address. An alternative is
15728 specified with a `Q' constraint on the input and `r' on the
15729 output. The next alternative specifies `m' on the input and a
15730 register class that does not include r0 on the output.
15732 - Macro: EXTRA_CONSTRAINT_STR (VALUE, C, STR)
15733 Like `EXTRA_CONSTRAINT', but you also get the constraint string
15734 passed in STR, so that you can use suffixes to distinguish between
15735 different variants.
15737 - Macro: EXTRA_MEMORY_CONSTRAINT (C, STR)
15738 A C expression that defines the optional machine-dependent
15739 constraint letters, amongst those accepted by `EXTRA_CONSTRAINT',
15740 that should be treated like memory constraints by the reload pass.
15742 It should return 1 if the operand type represented by the
15743 constraint at the start of STR, the first letter of which is the
15744 letter C, comprises a subset of all memory references including
15745 all those whose address is simply a base register. This allows
15746 the reload pass to reload an operand, if it does not directly
15747 correspond to the operand type of C, by copying its address into a
15750 For example, on the S/390, some instructions do not accept
15751 arbitrary memory references, but only those that do not make use
15752 of an index register. The constraint letter `Q' is defined via
15753 `EXTRA_CONSTRAINT' as representing a memory address of this type.
15754 If the letter `Q' is marked as `EXTRA_MEMORY_CONSTRAINT', a `Q'
15755 constraint can handle any memory operand, because the reload pass
15756 knows it can be reloaded by copying the memory address into a base
15757 register if required. This is analogous to the way a `o'
15758 constraint can handle any memory operand.
15760 - Macro: EXTRA_ADDRESS_CONSTRAINT (C, STR)
15761 A C expression that defines the optional machine-dependent
15762 constraint letters, amongst those accepted by `EXTRA_CONSTRAINT' /
15763 `EXTRA_CONSTRAINT_STR', that should be treated like address
15764 constraints by the reload pass.
15766 It should return 1 if the operand type represented by the
15767 constraint at the start of STR, which starts with the letter C,
15768 comprises a subset of all memory addresses including all those
15769 that consist of just a base register. This allows the reload pass
15770 to reload an operand, if it does not directly correspond to the
15771 operand type of STR, by copying it into a base register.
15773 Any constraint marked as `EXTRA_ADDRESS_CONSTRAINT' can only be
15774 used with the `address_operand' predicate. It is treated
15775 analogously to the `p' constraint.
15778 File: gccint.info, Node: Stack and Calling, Next: Varargs, Prev: Register Classes, Up: Target Macros
15780 Stack Layout and Calling Conventions
15781 ====================================
15783 This describes the stack layout and calling conventions.
15788 * Exception Handling::
15790 * Frame Registers::
15792 * Stack Arguments::
15793 * Register Arguments::
15795 * Aggregate Return::
15802 File: gccint.info, Node: Frame Layout, Next: Exception Handling, Up: Stack and Calling
15807 Here is the basic stack layout.
15809 - Macro: STACK_GROWS_DOWNWARD
15810 Define this macro if pushing a word onto the stack moves the stack
15811 pointer to a smaller address.
15813 When we say, "define this macro if ...," it means that the
15814 compiler checks this macro only with `#ifdef' so the precise
15815 definition used does not matter.
15817 - Macro: STACK_PUSH_CODE
15818 This macro defines the operation used when something is pushed on
15819 the stack. In RTL, a push operation will be `(set (mem
15820 (STACK_PUSH_CODE (reg sp))) ...)'
15822 The choices are `PRE_DEC', `POST_DEC', `PRE_INC', and `POST_INC'.
15823 Which of these is correct depends on the stack direction and on
15824 whether the stack pointer points to the last item on the stack or
15825 whether it points to the space for the next item on the stack.
15827 The default is `PRE_DEC' when `STACK_GROWS_DOWNWARD' is defined,
15828 which is almost always right, and `PRE_INC' otherwise, which is
15831 - Macro: FRAME_GROWS_DOWNWARD
15832 Define this macro if the addresses of local variable slots are at
15833 negative offsets from the frame pointer.
15835 - Macro: ARGS_GROW_DOWNWARD
15836 Define this macro if successive arguments to a function occupy
15837 decreasing addresses on the stack.
15839 - Macro: STARTING_FRAME_OFFSET
15840 Offset from the frame pointer to the first local variable slot to
15843 If `FRAME_GROWS_DOWNWARD', find the next slot's offset by
15844 subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
15845 Otherwise, it is found by adding the length of the first slot to
15846 the value `STARTING_FRAME_OFFSET'.
15848 - Macro: STACK_ALIGNMENT_NEEDED
15849 Define to zero to disable final alignment of the stack during
15850 reload. The nonzero default for this macro is suitable for most
15853 On ports where `STARTING_FRAME_OFFSET' is nonzero or where there
15854 is a register save block following the local block that doesn't
15855 require alignment to `STACK_BOUNDARY', it may be beneficial to
15856 disable stack alignment and do it in the backend.
15858 - Macro: STACK_POINTER_OFFSET
15859 Offset from the stack pointer register to the first location at
15860 which outgoing arguments are placed. If not specified, the
15861 default value of zero is used. This is the proper value for most
15864 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
15865 the first location at which outgoing arguments are placed.
15867 - Macro: FIRST_PARM_OFFSET (FUNDECL)
15868 Offset from the argument pointer register to the first argument's
15869 address. On some machines it may depend on the data type of the
15872 If `ARGS_GROW_DOWNWARD', this is the offset to the location above
15873 the first argument's address.
15875 - Macro: STACK_DYNAMIC_OFFSET (FUNDECL)
15876 Offset from the stack pointer register to an item dynamically
15877 allocated on the stack, e.g., by `alloca'.
15879 The default value for this macro is `STACK_POINTER_OFFSET' plus the
15880 length of the outgoing arguments. The default is correct for most
15881 machines. See `function.c' for details.
15883 - Macro: DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)
15884 A C expression whose value is RTL representing the address in a
15885 stack frame where the pointer to the caller's frame is stored.
15886 Assume that FRAMEADDR is an RTL expression for the address of the
15887 stack frame itself.
15889 If you don't define this macro, the default is to return the value
15890 of FRAMEADDR--that is, the stack frame address is also the address
15891 of the stack word that points to the previous frame.
15893 - Macro: SETUP_FRAME_ADDRESSES
15894 If defined, a C expression that produces the machine-specific code
15895 to setup the stack so that arbitrary frames can be accessed. For
15896 example, on the SPARC, we must flush all of the register windows
15897 to the stack before we can access arbitrary stack frames. You
15898 will seldom need to define this macro.
15900 - Macro: BUILTIN_SETJMP_FRAME_VALUE
15901 If defined, a C expression that contains an rtx that is used to
15902 store the address of the current frame into the built in `setjmp'
15903 buffer. The default value, `virtual_stack_vars_rtx', is correct
15904 for most machines. One reason you may need to define this macro
15905 is if `hard_frame_pointer_rtx' is the appropriate value on your
15908 - Macro: RETURN_ADDR_RTX (COUNT, FRAMEADDR)
15909 A C expression whose value is RTL representing the value of the
15910 return address for the frame COUNT steps up from the current
15911 frame, after the prologue. FRAMEADDR is the frame pointer of the
15912 COUNT frame, or the frame pointer of the COUNT - 1 frame if
15913 `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined.
15915 The value of the expression must always be the correct address when
15916 COUNT is zero, but may be `NULL_RTX' if there is not way to
15917 determine the return address of other frames.
15919 - Macro: RETURN_ADDR_IN_PREVIOUS_FRAME
15920 Define this if the return address of a particular stack frame is
15921 accessed from the frame pointer of the previous stack frame.
15923 - Macro: INCOMING_RETURN_ADDR_RTX
15924 A C expression whose value is RTL representing the location of the
15925 incoming return address at the beginning of any function, before
15926 the prologue. This RTL is either a `REG', indicating that the
15927 return value is saved in `REG', or a `MEM' representing a location
15930 You only need to define this macro if you want to support call
15931 frame debugging information like that provided by DWARF 2.
15933 If this RTL is a `REG', you should also define
15934 `DWARF_FRAME_RETURN_COLUMN' to `DWARF_FRAME_REGNUM (REGNO)'.
15936 - Macro: DWARF_ALT_FRAME_RETURN_COLUMN
15937 A C expression whose value is an integer giving a DWARF 2 column
15938 number that may be used as an alternate return column. This should
15939 be defined only if `DWARF_FRAME_RETURN_COLUMN' is set to a general
15940 register, but an alternate column needs to be used for signal
15943 - Macro: INCOMING_FRAME_SP_OFFSET
15944 A C expression whose value is an integer giving the offset, in
15945 bytes, from the value of the stack pointer register to the top of
15946 the stack frame at the beginning of any function, before the
15947 prologue. The top of the frame is defined to be the value of the
15948 stack pointer in the previous frame, just before the call
15951 You only need to define this macro if you want to support call
15952 frame debugging information like that provided by DWARF 2.
15954 - Macro: ARG_POINTER_CFA_OFFSET (FUNDECL)
15955 A C expression whose value is an integer giving the offset, in
15956 bytes, from the argument pointer to the canonical frame address
15957 (cfa). The final value should coincide with that calculated by
15958 `INCOMING_FRAME_SP_OFFSET'. Which is unfortunately not usable
15959 during virtual register instantiation.
15961 The default value for this macro is `FIRST_PARM_OFFSET (fundecl)',
15962 which is correct for most machines; in general, the arguments are
15963 found immediately before the stack frame. Note that this is not
15964 the case on some targets that save registers into the caller's
15965 frame, such as SPARC and rs6000, and so such targets need to
15968 You only need to define this macro if the default is incorrect,
15969 and you want to support call frame debugging information like that
15970 provided by DWARF 2.
15973 File: gccint.info, Node: Exception Handling, Next: Stack Checking, Prev: Frame Layout, Up: Stack and Calling
15975 Exception Handling Support
15976 --------------------------
15978 - Macro: EH_RETURN_DATA_REGNO (N)
15979 A C expression whose value is the Nth register number used for
15980 data by exception handlers, or `INVALID_REGNUM' if fewer than N
15981 registers are usable.
15983 The exception handling library routines communicate with the
15984 exception handlers via a set of agreed upon registers. Ideally
15985 these registers should be call-clobbered; it is possible to use
15986 call-saved registers, but may negatively impact code size. The
15987 target must support at least 2 data registers, but should define 4
15988 if there are enough free registers.
15990 You must define this macro if you want to support call frame
15991 exception handling like that provided by DWARF 2.
15993 - Macro: EH_RETURN_STACKADJ_RTX
15994 A C expression whose value is RTL representing a location in which
15995 to store a stack adjustment to be applied before function return.
15996 This is used to unwind the stack to an exception handler's call
15997 frame. It will be assigned zero on code paths that return
16000 Typically this is a call-clobbered hard register that is otherwise
16001 untouched by the epilogue, but could also be a stack slot.
16003 Do not define this macro if the stack pointer is saved and restored
16004 by the regular prolog and epilog code in the call frame itself; in
16005 this case, the exception handling library routines will update the
16006 stack location to be restored in place. Otherwise, you must define
16007 this macro if you want to support call frame exception handling
16008 like that provided by DWARF 2.
16010 - Macro: EH_RETURN_HANDLER_RTX
16011 A C expression whose value is RTL representing a location in which
16012 to store the address of an exception handler to which we should
16013 return. It will not be assigned on code paths that return
16016 Typically this is the location in the call frame at which the
16017 normal return address is stored. For targets that return by
16018 popping an address off the stack, this might be a memory address
16019 just below the _target_ call frame rather than inside the current
16020 call frame. If defined, `EH_RETURN_STACKADJ_RTX' will have already
16021 been assigned, so it may be used to calculate the location of the
16024 Some targets have more complex requirements than storing to an
16025 address calculable during initial code generation. In that case
16026 the `eh_return' instruction pattern should be used instead.
16028 If you want to support call frame exception handling, you must
16029 define either this macro or the `eh_return' instruction pattern.
16031 - Macro: RETURN_ADDR_OFFSET
16032 If defined, an integer-valued C expression for which rtl will be
16033 generated to add it to the exception handler address before it is
16034 searched in the exception handling tables, and to subtract it
16035 again from the address before using it to return to the exception
16038 - Macro: ASM_PREFERRED_EH_DATA_FORMAT (CODE, GLOBAL)
16039 This macro chooses the encoding of pointers embedded in the
16040 exception handling sections. If at all possible, this should be
16041 defined such that the exception handling section will not require
16042 dynamic relocations, and so may be read-only.
16044 CODE is 0 for data, 1 for code labels, 2 for function pointers.
16045 GLOBAL is true if the symbol may be affected by dynamic
16046 relocations. The macro should return a combination of the
16047 `DW_EH_PE_*' defines as found in `dwarf2.h'.
16049 If this macro is not defined, pointers will not be encoded but
16050 represented directly.
16052 - Macro: ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX (FILE, ENCODING, SIZE,
16054 This macro allows the target to emit whatever special magic is
16055 required to represent the encoding chosen by
16056 `ASM_PREFERRED_EH_DATA_FORMAT'. Generic code takes care of
16057 pc-relative and indirect encodings; this must be defined if the
16058 target uses text-relative or data-relative encodings.
16060 This is a C statement that branches to DONE if the format was
16061 handled. ENCODING is the format chosen, SIZE is the number of
16062 bytes that the format occupies, ADDR is the `SYMBOL_REF' to be
16065 - Macro: MD_FALLBACK_FRAME_STATE_FOR (CONTEXT, FS, SUCCESS)
16066 This macro allows the target to add cpu and operating system
16067 specific code to the call-frame unwinder for use when there is no
16068 unwind data available. The most common reason to implement this
16069 macro is to unwind through signal frames.
16071 This macro is called from `uw_frame_state_for' in `unwind-dw2.c'
16072 and `unwind-ia64.c'. CONTEXT is an `_Unwind_Context'; FS is an
16073 `_Unwind_FrameState'. Examine `context->ra' for the address of
16074 the code being executed and `context->cfa' for the stack pointer
16075 value. If the frame can be decoded, the register save addresses
16076 should be updated in FS and the macro should branch to SUCCESS.
16077 If the frame cannot be decoded, the macro should do nothing.
16079 For proper signal handling in Java this macro is accompanied by
16080 `MAKE_THROW_FRAME', defined in `libjava/include/*-signal.h'
16083 - Macro: MD_HANDLE_UNWABI (CONTEXT, FS)
16084 This macro allows the target to add operating system specific code
16085 to the call-frame unwinder to handle the IA-64 `.unwabi' unwinding
16086 directive, usually used for signal or interrupt frames.
16088 This macro is called from `uw_update_context' in `unwind-ia64.c'.
16089 CONTEXT is an `_Unwind_Context'; FS is an `_Unwind_FrameState'.
16090 Examine `fs->unwabi' for the abi and context in the `.unwabi'
16091 directive. If the `.unwabi' directive can be handled, the
16092 register save addresses should be updated in FS.
16095 File: gccint.info, Node: Stack Checking, Next: Frame Registers, Prev: Exception Handling, Up: Stack and Calling
16097 Specifying How Stack Checking is Done
16098 -------------------------------------
16100 GCC will check that stack references are within the boundaries of
16101 the stack, if the `-fstack-check' is specified, in one of three ways:
16103 1. If the value of the `STACK_CHECK_BUILTIN' macro is nonzero, GCC
16104 will assume that you have arranged for stack checking to be done at
16105 appropriate places in the configuration files, e.g., in
16106 `TARGET_ASM_FUNCTION_PROLOGUE'. GCC will do not other special
16109 2. If `STACK_CHECK_BUILTIN' is zero and you defined a named pattern
16110 called `check_stack' in your `md' file, GCC will call that pattern
16111 with one argument which is the address to compare the stack value
16112 against. You must arrange for this pattern to report an error if
16113 the stack pointer is out of range.
16115 3. If neither of the above are true, GCC will generate code to
16116 periodically "probe" the stack pointer using the values of the
16117 macros defined below.
16119 Normally, you will use the default values of these macros, so GCC
16120 will use the third approach.
16122 - Macro: STACK_CHECK_BUILTIN
16123 A nonzero value if stack checking is done by the configuration
16124 files in a machine-dependent manner. You should define this macro
16125 if stack checking is require by the ABI of your machine or if you
16126 would like to have to stack checking in some more efficient way
16127 than GCC's portable approach. The default value of this macro is
16130 - Macro: STACK_CHECK_PROBE_INTERVAL
16131 An integer representing the interval at which GCC must generate
16132 stack probe instructions. You will normally define this macro to
16133 be no larger than the size of the "guard pages" at the end of a
16134 stack area. The default value of 4096 is suitable for most
16137 - Macro: STACK_CHECK_PROBE_LOAD
16138 A integer which is nonzero if GCC should perform the stack probe
16139 as a load instruction and zero if GCC should use a store
16140 instruction. The default is zero, which is the most efficient
16141 choice on most systems.
16143 - Macro: STACK_CHECK_PROTECT
16144 The number of bytes of stack needed to recover from a stack
16145 overflow, for languages where such a recovery is supported. The
16146 default value of 75 words should be adequate for most machines.
16148 - Macro: STACK_CHECK_MAX_FRAME_SIZE
16149 The maximum size of a stack frame, in bytes. GCC will generate
16150 probe instructions in non-leaf functions to ensure at least this
16151 many bytes of stack are available. If a stack frame is larger
16152 than this size, stack checking will not be reliable and GCC will
16153 issue a warning. The default is chosen so that GCC only generates
16154 one instruction on most systems. You should normally not change
16155 the default value of this macro.
16157 - Macro: STACK_CHECK_FIXED_FRAME_SIZE
16158 GCC uses this value to generate the above warning message. It
16159 represents the amount of fixed frame used by a function, not
16160 including space for any callee-saved registers, temporaries and
16161 user variables. You need only specify an upper bound for this
16162 amount and will normally use the default of four words.
16164 - Macro: STACK_CHECK_MAX_VAR_SIZE
16165 The maximum size, in bytes, of an object that GCC will place in the
16166 fixed area of the stack frame when the user specifies
16167 `-fstack-check'. GCC computed the default from the values of the
16168 above macros and you will normally not need to override that
16172 File: gccint.info, Node: Frame Registers, Next: Elimination, Prev: Stack Checking, Up: Stack and Calling
16174 Registers That Address the Stack Frame
16175 --------------------------------------
16177 This discusses registers that address the stack frame.
16179 - Macro: STACK_POINTER_REGNUM
16180 The register number of the stack pointer register, which must also
16181 be a fixed register according to `FIXED_REGISTERS'. On most
16182 machines, the hardware determines which register this is.
16184 - Macro: FRAME_POINTER_REGNUM
16185 The register number of the frame pointer register, which is used to
16186 access automatic variables in the stack frame. On some machines,
16187 the hardware determines which register this is. On other
16188 machines, you can choose any register you wish for this purpose.
16190 - Macro: HARD_FRAME_POINTER_REGNUM
16191 On some machines the offset between the frame pointer and starting
16192 offset of the automatic variables is not known until after register
16193 allocation has been done (for example, because the saved registers
16194 are between these two locations). On those machines, define
16195 `FRAME_POINTER_REGNUM' the number of a special, fixed register to
16196 be used internally until the offset is known, and define
16197 `HARD_FRAME_POINTER_REGNUM' to be the actual hard register number
16198 used for the frame pointer.
16200 You should define this macro only in the very rare circumstances
16201 when it is not possible to calculate the offset between the frame
16202 pointer and the automatic variables until after register
16203 allocation has been completed. When this macro is defined, you
16204 must also indicate in your definition of `ELIMINABLE_REGS' how to
16205 eliminate `FRAME_POINTER_REGNUM' into either
16206 `HARD_FRAME_POINTER_REGNUM' or `STACK_POINTER_REGNUM'.
16208 Do not define this macro if it would be the same as
16209 `FRAME_POINTER_REGNUM'.
16211 - Macro: ARG_POINTER_REGNUM
16212 The register number of the arg pointer register, which is used to
16213 access the function's argument list. On some machines, this is
16214 the same as the frame pointer register. On some machines, the
16215 hardware determines which register this is. On other machines,
16216 you can choose any register you wish for this purpose. If this is
16217 not the same register as the frame pointer register, then you must
16218 mark it as a fixed register according to `FIXED_REGISTERS', or
16219 arrange to be able to eliminate it (*note Elimination::).
16221 - Macro: RETURN_ADDRESS_POINTER_REGNUM
16222 The register number of the return address pointer register, which
16223 is used to access the current function's return address from the
16224 stack. On some machines, the return address is not at a fixed
16225 offset from the frame pointer or stack pointer or argument
16226 pointer. This register can be defined to point to the return
16227 address on the stack, and then be converted by `ELIMINABLE_REGS'
16228 into either the frame pointer or stack pointer.
16230 Do not define this macro unless there is no other way to get the
16231 return address from the stack.
16233 - Macro: STATIC_CHAIN_REGNUM
16234 - Macro: STATIC_CHAIN_INCOMING_REGNUM
16235 Register numbers used for passing a function's static chain
16236 pointer. If register windows are used, the register number as
16237 seen by the called function is `STATIC_CHAIN_INCOMING_REGNUM',
16238 while the register number as seen by the calling function is
16239 `STATIC_CHAIN_REGNUM'. If these registers are the same,
16240 `STATIC_CHAIN_INCOMING_REGNUM' need not be defined.
16242 The static chain register need not be a fixed register.
16244 If the static chain is passed in memory, these macros should not be
16245 defined; instead, the next two macros should be defined.
16247 - Macro: STATIC_CHAIN
16248 - Macro: STATIC_CHAIN_INCOMING
16249 If the static chain is passed in memory, these macros provide rtx
16250 giving `mem' expressions that denote where they are stored.
16251 `STATIC_CHAIN' and `STATIC_CHAIN_INCOMING' give the locations as
16252 seen by the calling and called functions, respectively. Often the
16253 former will be at an offset from the stack pointer and the latter
16254 at an offset from the frame pointer.
16256 The variables `stack_pointer_rtx', `frame_pointer_rtx', and
16257 `arg_pointer_rtx' will have been initialized prior to the use of
16258 these macros and should be used to refer to those items.
16260 If the static chain is passed in a register, the two previous
16261 macros should be defined instead.
16263 - Macro: DWARF_FRAME_REGISTERS
16264 This macro specifies the maximum number of hard registers that can
16265 be saved in a call frame. This is used to size data structures
16266 used in DWARF2 exception handling.
16268 Prior to GCC 3.0, this macro was needed in order to establish a
16269 stable exception handling ABI in the face of adding new hard
16270 registers for ISA extensions. In GCC 3.0 and later, the EH ABI is
16271 insulated from changes in the number of hard registers.
16272 Nevertheless, this macro can still be used to reduce the runtime
16273 memory requirements of the exception handling routines, which can
16274 be substantial if the ISA contains a lot of registers that are not
16277 If this macro is not defined, it defaults to
16278 `FIRST_PSEUDO_REGISTER'.
16280 - Macro: PRE_GCC3_DWARF_FRAME_REGISTERS
16281 This macro is similar to `DWARF_FRAME_REGISTERS', but is provided
16282 for backward compatibility in pre GCC 3.0 compiled code.
16284 If this macro is not defined, it defaults to
16285 `DWARF_FRAME_REGISTERS'.
16287 - Macro: DWARF_REG_TO_UNWIND_COLUMN (REGNO)
16288 Define this macro if the target's representation for dwarf
16289 registers is different than the internal representation for unwind
16290 column. Given a dwarf register, this macro should return the
16291 internal unwind column number to use instead.
16293 See the PowerPC's SPE target for an example.
16295 - Macro: DWARF_FRAME_REGNUM (REGNO)
16296 Define this macro if the target's representation for dwarf
16297 registers used in .eh_frame or .debug_frame is different from that
16298 used in other debug info sections. Given a GCC hard register
16299 number, this macro should return the .eh_frame register number.
16300 The default is `DBX_REGISTER_NUMBER (REGNO)'.
16303 - Macro: DWARF2_FRAME_REG_OUT (REGNO, FOR_EH)
16304 Define this macro to map register numbers held in the call frame
16305 info that GCC has collected using `DWARF_FRAME_REGNUM' to those
16306 that should be output in .debug_frame (`FOR_EH' is zero) and
16307 .eh_frame (`FOR_EH' is nonzero). The default is to return `REGNO'.
16311 File: gccint.info, Node: Elimination, Next: Stack Arguments, Prev: Frame Registers, Up: Stack and Calling
16313 Eliminating Frame Pointer and Arg Pointer
16314 -----------------------------------------
16316 This is about eliminating the frame pointer and arg pointer.
16318 - Macro: FRAME_POINTER_REQUIRED
16319 A C expression which is nonzero if a function must have and use a
16320 frame pointer. This expression is evaluated in the reload pass.
16321 If its value is nonzero the function will have a frame pointer.
16323 The expression can in principle examine the current function and
16324 decide according to the facts, but on most machines the constant 0
16325 or the constant 1 suffices. Use 0 when the machine allows code to
16326 be generated with no frame pointer, and doing so saves some time
16327 or space. Use 1 when there is no possible advantage to avoiding a
16330 In certain cases, the compiler does not know how to produce valid
16331 code without a frame pointer. The compiler recognizes those cases
16332 and automatically gives the function a frame pointer regardless of
16333 what `FRAME_POINTER_REQUIRED' says. You don't need to worry about
16336 In a function that does not require a frame pointer, the frame
16337 pointer register can be allocated for ordinary usage, unless you
16338 mark it as a fixed register. See `FIXED_REGISTERS' for more
16341 - Macro: INITIAL_FRAME_POINTER_OFFSET (DEPTH-VAR)
16342 A C statement to store in the variable DEPTH-VAR the difference
16343 between the frame pointer and the stack pointer values immediately
16344 after the function prologue. The value would be computed from
16345 information such as the result of `get_frame_size ()' and the
16346 tables of registers `regs_ever_live' and `call_used_regs'.
16348 If `ELIMINABLE_REGS' is defined, this macro will be not be used and
16349 need not be defined. Otherwise, it must be defined even if
16350 `FRAME_POINTER_REQUIRED' is defined to always be true; in that
16351 case, you may set DEPTH-VAR to anything.
16353 - Macro: ELIMINABLE_REGS
16354 If defined, this macro specifies a table of register pairs used to
16355 eliminate unneeded registers that point into the stack frame. If
16356 it is not defined, the only elimination attempted by the compiler
16357 is to replace references to the frame pointer with references to
16360 The definition of this macro is a list of structure
16361 initializations, each of which specifies an original and
16362 replacement register.
16364 On some machines, the position of the argument pointer is not
16365 known until the compilation is completed. In such a case, a
16366 separate hard register must be used for the argument pointer.
16367 This register can be eliminated by replacing it with either the
16368 frame pointer or the argument pointer, depending on whether or not
16369 the frame pointer has been eliminated.
16371 In this case, you might specify:
16372 #define ELIMINABLE_REGS \
16373 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
16374 {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
16375 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
16377 Note that the elimination of the argument pointer with the stack
16378 pointer is specified first since that is the preferred elimination.
16380 - Macro: CAN_ELIMINATE (FROM-REG, TO-REG)
16381 A C expression that returns nonzero if the compiler is allowed to
16382 try to replace register number FROM-REG with register number
16383 TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is
16384 defined, and will usually be the constant 1, since most of the
16385 cases preventing register elimination are things that the compiler
16386 already knows about.
16388 - Macro: INITIAL_ELIMINATION_OFFSET (FROM-REG, TO-REG, OFFSET-VAR)
16389 This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
16390 specifies the initial difference between the specified pair of
16391 registers. This macro must be defined if `ELIMINABLE_REGS' is
16395 File: gccint.info, Node: Stack Arguments, Next: Register Arguments, Prev: Elimination, Up: Stack and Calling
16397 Passing Function Arguments on the Stack
16398 ---------------------------------------
16400 The macros in this section control how arguments are passed on the
16401 stack. See the following section for other macros that control passing
16402 certain arguments in registers.
16404 - Target Hook: bool TARGET_PROMOTE_PROTOTYPES (tree FNTYPE)
16405 This target hook returns `true' if an argument declared in a
16406 prototype as an integral type smaller than `int' should actually be
16407 passed as an `int'. In addition to avoiding errors in certain
16408 cases of mismatch, it also makes for better code on certain
16409 machines. The default is to not promote prototypes.
16412 A C expression. If nonzero, push insns will be used to pass
16413 outgoing arguments. If the target machine does not have a push
16414 instruction, set it to zero. That directs GCC to use an alternate
16415 strategy: to allocate the entire argument block and then store the
16416 arguments into it. When `PUSH_ARGS' is nonzero, `PUSH_ROUNDING'
16417 must be defined too.
16419 - Macro: PUSH_ARGS_REVERSED
16420 A C expression. If nonzero, function arguments will be evaluated
16421 from last to first, rather than from first to last. If this macro
16422 is not defined, it defaults to `PUSH_ARGS' on targets where the
16423 stack and args grow in opposite directions, and 0 otherwise.
16425 - Macro: PUSH_ROUNDING (NPUSHED)
16426 A C expression that is the number of bytes actually pushed onto the
16427 stack when an instruction attempts to push NPUSHED bytes.
16429 On some machines, the definition
16431 #define PUSH_ROUNDING(BYTES) (BYTES)
16433 will suffice. But on other machines, instructions that appear to
16434 push one byte actually push two bytes in an attempt to maintain
16435 alignment. Then the definition should be
16437 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
16439 - Macro: ACCUMULATE_OUTGOING_ARGS
16440 A C expression. If nonzero, the maximum amount of space required
16441 for outgoing arguments will be computed and placed into the
16442 variable `current_function_outgoing_args_size'. No space will be
16443 pushed onto the stack for each call; instead, the function
16444 prologue should increase the stack frame size by this amount.
16446 Setting both `PUSH_ARGS' and `ACCUMULATE_OUTGOING_ARGS' is not
16449 - Macro: REG_PARM_STACK_SPACE (FNDECL)
16450 Define this macro if functions should assume that stack space has
16451 been allocated for arguments even when their values are passed in
16454 The value of this macro is the size, in bytes, of the area
16455 reserved for arguments passed in registers for the function
16456 represented by FNDECL, which can be zero if GCC is calling a
16459 This space can be allocated by the caller, or be a part of the
16460 machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says
16463 - Macro: MAYBE_REG_PARM_STACK_SPACE
16464 - Macro: FINAL_REG_PARM_STACK_SPACE (CONST_SIZE, VAR_SIZE)
16465 Define these macros in addition to the one above if functions might
16466 allocate stack space for arguments even when their values are
16467 passed in registers. These should be used when the stack space
16468 allocated for arguments in registers is not a simple constant
16469 independent of the function declaration.
16471 The value of the first macro is the size, in bytes, of the area
16472 that we should initially assume would be reserved for arguments
16473 passed in registers.
16475 The value of the second macro is the actual size, in bytes, of the
16476 area that will be reserved for arguments passed in registers.
16477 This takes two arguments: an integer representing the number of
16478 bytes of fixed sized arguments on the stack, and a tree
16479 representing the number of bytes of variable sized arguments on
16482 When these macros are defined, `REG_PARM_STACK_SPACE' will only be
16483 called for libcall functions, the current function, or for a
16484 function being called when it is known that such stack space must
16485 be allocated. In each case this value can be easily computed.
16487 When deciding whether a called function needs such stack space,
16488 and how much space to reserve, GCC uses these two macros instead of
16489 `REG_PARM_STACK_SPACE'.
16491 - Macro: OUTGOING_REG_PARM_STACK_SPACE
16492 Define this if it is the responsibility of the caller to allocate
16493 the area reserved for arguments passed in registers.
16495 If `ACCUMULATE_OUTGOING_ARGS' is defined, this macro controls
16496 whether the space for these arguments counts in the value of
16497 `current_function_outgoing_args_size'.
16499 - Macro: STACK_PARMS_IN_REG_PARM_AREA
16500 Define this macro if `REG_PARM_STACK_SPACE' is defined, but the
16501 stack parameters don't skip the area specified by it.
16503 Normally, when a parameter is not passed in registers, it is
16504 placed on the stack beyond the `REG_PARM_STACK_SPACE' area.
16505 Defining this macro suppresses this behavior and causes the
16506 parameter to be passed on the stack in its natural location.
16508 - Macro: RETURN_POPS_ARGS (FUNDECL, FUNTYPE, STACK-SIZE)
16509 A C expression that should indicate the number of bytes of its own
16510 arguments that a function pops on returning, or 0 if the function
16511 pops no arguments and the caller must therefore pop them all after
16512 the function returns.
16514 FUNDECL is a C variable whose value is a tree node that describes
16515 the function in question. Normally it is a node of type
16516 `FUNCTION_DECL' that describes the declaration of the function.
16517 From this you can obtain the `DECL_ATTRIBUTES' of the function.
16519 FUNTYPE is a C variable whose value is a tree node that describes
16520 the function in question. Normally it is a node of type
16521 `FUNCTION_TYPE' that describes the data type of the function.
16522 From this it is possible to obtain the data types of the value and
16523 arguments (if known).
16525 When a call to a library function is being considered, FUNDECL
16526 will contain an identifier node for the library function. Thus, if
16527 you need to distinguish among various library functions, you can
16528 do so by their names. Note that "library function" in this
16529 context means a function used to perform arithmetic, whose name is
16530 known specially in the compiler and was not mentioned in the C
16531 code being compiled.
16533 STACK-SIZE is the number of bytes of arguments passed on the
16534 stack. If a variable number of bytes is passed, it is zero, and
16535 argument popping will always be the responsibility of the calling
16538 On the VAX, all functions always pop their arguments, so the
16539 definition of this macro is STACK-SIZE. On the 68000, using the
16540 standard calling convention, no functions pop their arguments, so
16541 the value of the macro is always 0 in this case. But an
16542 alternative calling convention is available in which functions
16543 that take a fixed number of arguments pop them but other functions
16544 (such as `printf') pop nothing (the caller pops all). When this
16545 convention is in use, FUNTYPE is examined to determine whether a
16546 function takes a fixed number of arguments.
16548 - Macro: CALL_POPS_ARGS (CUM)
16549 A C expression that should indicate the number of bytes a call
16550 sequence pops off the stack. It is added to the value of
16551 `RETURN_POPS_ARGS' when compiling a function call.
16553 CUM is the variable in which all arguments to the called function
16554 have been accumulated.
16556 On certain architectures, such as the SH5, a call trampoline is
16557 used that pops certain registers off the stack, depending on the
16558 arguments that have been passed to the function. Since this is a
16559 property of the call site, not of the called function,
16560 `RETURN_POPS_ARGS' is not appropriate.
16563 File: gccint.info, Node: Register Arguments, Next: Scalar Return, Prev: Stack Arguments, Up: Stack and Calling
16565 Passing Arguments in Registers
16566 ------------------------------
16568 This section describes the macros which let you control how various
16569 types of arguments are passed in registers or how they are arranged in
16572 - Macro: FUNCTION_ARG (CUM, MODE, TYPE, NAMED)
16573 A C expression that controls whether a function argument is passed
16574 in a register, and which register.
16576 The arguments are CUM, which summarizes all the previous
16577 arguments; MODE, the machine mode of the argument; TYPE, the data
16578 type of the argument as a tree node or 0 if that is not known
16579 (which happens for C support library functions); and NAMED, which
16580 is 1 for an ordinary argument and 0 for nameless arguments that
16581 correspond to `...' in the called function's prototype. TYPE can
16582 be an incomplete type if a syntax error has previously occurred.
16584 The value of the expression is usually either a `reg' RTX for the
16585 hard register in which to pass the argument, or zero to pass the
16586 argument on the stack.
16588 For machines like the VAX and 68000, where normally all arguments
16589 are pushed, zero suffices as a definition.
16591 The value of the expression can also be a `parallel' RTX. This is
16592 used when an argument is passed in multiple locations. The mode
16593 of the `parallel' should be the mode of the entire argument. The
16594 `parallel' holds any number of `expr_list' pairs; each one
16595 describes where part of the argument is passed. In each
16596 `expr_list' the first operand must be a `reg' RTX for the hard
16597 register in which to pass this part of the argument, and the mode
16598 of the register RTX indicates how large this part of the argument
16599 is. The second operand of the `expr_list' is a `const_int' which
16600 gives the offset in bytes into the entire argument of where this
16601 part starts. As a special exception the first `expr_list' in the
16602 `parallel' RTX may have a first operand of zero. This indicates
16603 that the entire argument is also stored on the stack.
16605 The last time this macro is called, it is called with `MODE ==
16606 VOIDmode', and its result is passed to the `call' or `call_value'
16607 pattern as operands 2 and 3 respectively.
16609 The usual way to make the ISO library `stdarg.h' work on a machine
16610 where some arguments are usually passed in registers, is to cause
16611 nameless arguments to be passed on the stack instead. This is done
16612 by making `FUNCTION_ARG' return 0 whenever NAMED is 0.
16614 You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the
16615 definition of this macro to determine if this argument is of a
16616 type that must be passed in the stack. If `REG_PARM_STACK_SPACE'
16617 is not defined and `FUNCTION_ARG' returns nonzero for such an
16618 argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is
16619 defined, the argument will be computed in the stack and then
16620 loaded into a register.
16622 - Macro: MUST_PASS_IN_STACK (MODE, TYPE)
16623 Define as a C expression that evaluates to nonzero if we do not
16624 know how to pass TYPE solely in registers. The file `expr.h'
16625 defines a definition that is usually appropriate, refer to
16626 `expr.h' for additional documentation.
16628 - Macro: FUNCTION_INCOMING_ARG (CUM, MODE, TYPE, NAMED)
16629 Define this macro if the target machine has "register windows", so
16630 that the register in which a function sees an arguments is not
16631 necessarily the same as the one in which the caller passed the
16634 For such machines, `FUNCTION_ARG' computes the register in which
16635 the caller passes the value, and `FUNCTION_INCOMING_ARG' should be
16636 defined in a similar fashion to tell the function being called
16637 where the arguments will arrive.
16639 If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves
16642 - Macro: FUNCTION_ARG_PARTIAL_NREGS (CUM, MODE, TYPE, NAMED)
16643 A C expression for the number of words, at the beginning of an
16644 argument, that must be put in registers. The value must be zero
16645 for arguments that are passed entirely in registers or that are
16646 entirely pushed on the stack.
16648 On some machines, certain arguments must be passed partially in
16649 registers and partially in memory. On these machines, typically
16650 the first N words of arguments are passed in registers, and the
16651 rest on the stack. If a multi-word argument (a `double' or a
16652 structure) crosses that boundary, its first few words must be
16653 passed in registers and the rest must be pushed. This macro tells
16654 the compiler when this occurs, and how many of the words should go
16657 `FUNCTION_ARG' for these arguments should return the first
16658 register to be used by the caller for this argument; likewise
16659 `FUNCTION_INCOMING_ARG', for the called function.
16661 - Macro: FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)
16662 A C expression that indicates when an argument must be passed by
16663 reference. If nonzero for an argument, a copy of that argument is
16664 made in memory and a pointer to the argument is passed instead of
16665 the argument itself. The pointer is passed in whatever way is
16666 appropriate for passing a pointer to that type.
16668 On machines where `REG_PARM_STACK_SPACE' is not defined, a suitable
16669 definition of this macro might be
16670 #define FUNCTION_ARG_PASS_BY_REFERENCE\
16671 (CUM, MODE, TYPE, NAMED) \
16672 MUST_PASS_IN_STACK (MODE, TYPE)
16674 - Macro: FUNCTION_ARG_CALLEE_COPIES (CUM, MODE, TYPE, NAMED)
16675 If defined, a C expression that indicates when it is the called
16676 function's responsibility to make a copy of arguments passed by
16677 invisible reference. Normally, the caller makes a copy and passes
16678 the address of the copy to the routine being called. When
16679 `FUNCTION_ARG_CALLEE_COPIES' is defined and is nonzero, the caller
16680 does not make a copy. Instead, it passes a pointer to the "live"
16681 value. The called function must not modify this value. If it can
16682 be determined that the value won't be modified, it need not make a
16683 copy; otherwise a copy must be made.
16685 - Macro: CUMULATIVE_ARGS
16686 A C type for declaring a variable that is used as the first
16687 argument of `FUNCTION_ARG' and other related values. For some
16688 target machines, the type `int' suffices and can hold the number
16689 of bytes of argument so far.
16691 There is no need to record in `CUMULATIVE_ARGS' anything about the
16692 arguments that have been passed on the stack. The compiler has
16693 other variables to keep track of that. For target machines on
16694 which all arguments are passed on the stack, there is no need to
16695 store anything in `CUMULATIVE_ARGS'; however, the data structure
16696 must exist and should not be empty, so use `int'.
16698 - Macro: INIT_CUMULATIVE_ARGS (CUM, FNTYPE, LIBNAME, FNDECL,
16700 A C statement (sans semicolon) for initializing the variable CUM
16701 for the state at the beginning of the argument list. The variable
16702 has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node
16703 for the data type of the function which will receive the args, or
16704 0 if the args are to a compiler support library function. For
16705 direct calls that are not libcalls, FNDECL contain the declaration
16706 node of the function. FNDECL is also set when
16707 `INIT_CUMULATIVE_ARGS' is used to find arguments for the function
16708 being compiled. N_NAMED_ARGS is set to the number of named
16709 arguments, including a structure return address if it is passed as
16710 a parameter, when making a call. When processing incoming
16711 arguments, N_NAMED_ARGS is set to -1.
16713 When processing a call to a compiler support library function,
16714 LIBNAME identifies which one. It is a `symbol_ref' rtx which
16715 contains the name of the function, as a string. LIBNAME is 0 when
16716 an ordinary C function call is being processed. Thus, each time
16717 this macro is called, either LIBNAME or FNTYPE is nonzero, but
16718 never both of them at once.
16720 - Macro: INIT_CUMULATIVE_LIBCALL_ARGS (CUM, MODE, LIBNAME)
16721 Like `INIT_CUMULATIVE_ARGS' but only used for outgoing libcalls,
16722 it gets a `MODE' argument instead of FNTYPE, that would be `NULL'.
16723 INDIRECT would always be zero, too. If this macro is not
16724 defined, `INIT_CUMULATIVE_ARGS (cum, NULL_RTX, libname, 0)' is
16727 - Macro: INIT_CUMULATIVE_INCOMING_ARGS (CUM, FNTYPE, LIBNAME)
16728 Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of
16729 finding the arguments for the function being compiled. If this
16730 macro is undefined, `INIT_CUMULATIVE_ARGS' is used instead.
16732 The value passed for LIBNAME is always 0, since library routines
16733 with special calling conventions are never compiled with GCC. The
16734 argument LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'.
16736 - Macro: FUNCTION_ARG_ADVANCE (CUM, MODE, TYPE, NAMED)
16737 A C statement (sans semicolon) to update the summarizer variable
16738 CUM to advance past an argument in the argument list. The values
16739 MODE, TYPE and NAMED describe that argument. Once this is done,
16740 the variable CUM is suitable for analyzing the _following_
16741 argument with `FUNCTION_ARG', etc.
16743 This macro need not do anything if the argument in question was
16744 passed on the stack. The compiler knows how to track the amount
16745 of stack space used for arguments without any special help.
16747 - Macro: FUNCTION_ARG_PADDING (MODE, TYPE)
16748 If defined, a C expression which determines whether, and in which
16749 direction, to pad out an argument with extra space. The value
16750 should be of type `enum direction': either `upward' to pad above
16751 the argument, `downward' to pad below, or `none' to inhibit
16754 The _amount_ of padding is always just enough to reach the next
16755 multiple of `FUNCTION_ARG_BOUNDARY'; this macro does not control
16758 This macro has a default definition which is right for most
16759 systems. For little-endian machines, the default is to pad
16760 upward. For big-endian machines, the default is to pad downward
16761 for an argument of constant size shorter than an `int', and upward
16764 - Macro: PAD_VARARGS_DOWN
16765 If defined, a C expression which determines whether the default
16766 implementation of va_arg will attempt to pad down before reading
16767 the next argument, if that argument is smaller than its aligned
16768 space as controlled by `PARM_BOUNDARY'. If this macro is not
16769 defined, all such arguments are padded down if `BYTES_BIG_ENDIAN'
16772 - Macro: BLOCK_REG_PADDING (MODE, TYPE, FIRST)
16773 Specify padding for the last element of a block move between
16774 registers and memory. FIRST is nonzero if this is the only
16775 element. Defining this macro allows better control of register
16776 function parameters on big-endian machines, without using
16777 `PARALLEL' rtl. In particular, `MUST_PASS_IN_STACK' need not test
16778 padding and mode of types in registers, as there is no longer a
16779 "wrong" part of a register; For example, a three byte aggregate
16780 may be passed in the high part of a register if so required.
16782 - Macro: FUNCTION_ARG_BOUNDARY (MODE, TYPE)
16783 If defined, a C expression that gives the alignment boundary, in
16784 bits, of an argument with the specified mode and type. If it is
16785 not defined, `PARM_BOUNDARY' is used for all arguments.
16787 - Macro: FUNCTION_ARG_REGNO_P (REGNO)
16788 A C expression that is nonzero if REGNO is the number of a hard
16789 register in which function arguments are sometimes passed. This
16790 does _not_ include implicit arguments such as the static chain and
16791 the structure-value address. On many machines, no registers can be
16792 used for this purpose since all function arguments are pushed on
16795 - Target Hook: bool TARGET_SPLIT_COMPLEX_ARG (tree TYPE)
16796 This hook should return true if parameter of type TYPE are passed
16797 as two scalar parameters. By default, GCC will attempt to pack
16798 complex arguments into the target's word size. Some ABIs require
16799 complex arguments to be split and treated as their individual
16800 components. For example, on AIX64, complex floats should be
16801 passed in a pair of floating point registers, even though a
16802 complex float would fit in one 64-bit floating point register.
16804 The default value of this hook is `NULL', which is treated as
16808 File: gccint.info, Node: Scalar Return, Next: Aggregate Return, Prev: Register Arguments, Up: Stack and Calling
16810 How Scalar Function Values Are Returned
16811 ---------------------------------------
16813 This section discusses the macros that control returning scalars as
16814 values--values that can fit in registers.
16816 - Macro: FUNCTION_VALUE (VALTYPE, FUNC)
16817 A C expression to create an RTX representing the place where a
16818 function returns a value of data type VALTYPE. VALTYPE is a tree
16819 node representing a data type. Write `TYPE_MODE (VALTYPE)' to get
16820 the machine mode used to represent that type. On many machines,
16821 only the mode is relevant. (Actually, on most machines, scalar
16822 values are returned in the same place regardless of mode).
16824 The value of the expression is usually a `reg' RTX for the hard
16825 register where the return value is stored. The value can also be a
16826 `parallel' RTX, if the return value is in multiple places. See
16827 `FUNCTION_ARG' for an explanation of the `parallel' form.
16829 If `TARGET_PROMOTE_FUNCTION_RETURN' returns true, you must apply
16830 the same promotion rules specified in `PROMOTE_MODE' if VALTYPE is
16833 If the precise function being called is known, FUNC is a tree node
16834 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
16835 makes it possible to use a different value-returning convention
16836 for specific functions when all their calls are known.
16838 `FUNCTION_VALUE' is not used for return vales with aggregate data
16839 types, because these are returned in another way. See
16840 `TARGET_STRUCT_VALUE_RTX' and related macros, below.
16842 - Macro: FUNCTION_OUTGOING_VALUE (VALTYPE, FUNC)
16843 Define this macro if the target machine has "register windows" so
16844 that the register in which a function returns its value is not the
16845 same as the one in which the caller sees the value.
16847 For such machines, `FUNCTION_VALUE' computes the register in which
16848 the caller will see the value. `FUNCTION_OUTGOING_VALUE' should be
16849 defined in a similar fashion to tell the function where to put the
16852 If `FUNCTION_OUTGOING_VALUE' is not defined, `FUNCTION_VALUE'
16853 serves both purposes.
16855 `FUNCTION_OUTGOING_VALUE' is not used for return vales with
16856 aggregate data types, because these are returned in another way.
16857 See `TARGET_STRUCT_VALUE_RTX' and related macros, below.
16859 - Macro: LIBCALL_VALUE (MODE)
16860 A C expression to create an RTX representing the place where a
16861 library function returns a value of mode MODE. If the precise
16862 function being called is known, FUNC is a tree node
16863 (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This
16864 makes it possible to use a different value-returning convention
16865 for specific functions when all their calls are known.
16867 Note that "library function" in this context means a compiler
16868 support routine, used to perform arithmetic, whose name is known
16869 specially by the compiler and was not mentioned in the C code being
16872 The definition of `LIBRARY_VALUE' need not be concerned aggregate
16873 data types, because none of the library functions returns such
16876 - Macro: FUNCTION_VALUE_REGNO_P (REGNO)
16877 A C expression that is nonzero if REGNO is the number of a hard
16878 register in which the values of called function may come back.
16880 A register whose use for returning values is limited to serving as
16881 the second of a pair (for a value of type `double', say) need not
16882 be recognized by this macro. So for most machines, this definition
16885 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
16887 If the machine has register windows, so that the caller and the
16888 called function use different registers for the return value, this
16889 macro should recognize only the caller's register numbers.
16891 - Macro: APPLY_RESULT_SIZE
16892 Define this macro if `untyped_call' and `untyped_return' need more
16893 space than is implied by `FUNCTION_VALUE_REGNO_P' for saving and
16894 restoring an arbitrary return value.
16896 - Target Hook: bool TARGET_RETURN_IN_MSB (tree TYPE)
16897 This hook should return true if values of type TYPE are returned
16898 at the most significant end of a register (in other words, if they
16899 are padded at the least significant end). You can assume that TYPE
16900 is returned in a register; the caller is required to check this.
16902 Note that the register provided by `FUNCTION_VALUE' must be able
16903 to hold the complete return value. For example, if a 1-, 2- or
16904 3-byte structure is returned at the most significant end of a
16905 4-byte register, `FUNCTION_VALUE' should provide an `SImode' rtx.
16908 File: gccint.info, Node: Aggregate Return, Next: Caller Saves, Prev: Scalar Return, Up: Stack and Calling
16910 How Large Values Are Returned
16911 -----------------------------
16913 When a function value's mode is `BLKmode' (and in some other cases),
16914 the value is not returned according to `FUNCTION_VALUE' (*note Scalar
16915 Return::). Instead, the caller passes the address of a block of memory
16916 in which the value should be stored. This address is called the
16917 "structure value address".
16919 This section describes how to control returning structure values in
16922 - Target Hook: bool TARGET_RETURN_IN_MEMORY (tree TYPE, tree FNTYPE)
16923 This target hook should return a nonzero value to say to return the
16924 function value in memory, just as large structures are always
16925 returned. Here TYPE will be the data type of the value, and FNTYPE
16926 will be the type of the function doing the returning, or `NULL' for
16929 Note that values of mode `BLKmode' must be explicitly handled by
16930 this function. Also, the option `-fpcc-struct-return' takes
16931 effect regardless of this macro. On most systems, it is possible
16932 to leave the hook undefined; this causes a default definition to
16933 be used, whose value is the constant 1 for `BLKmode' values, and 0
16936 Do not use this hook to indicate that structures and unions should
16937 always be returned in memory. You should instead use
16938 `DEFAULT_PCC_STRUCT_RETURN' to indicate this.
16940 - Macro: DEFAULT_PCC_STRUCT_RETURN
16941 Define this macro to be 1 if all structure and union return values
16942 must be in memory. Since this results in slower code, this should
16943 be defined only if needed for compatibility with other compilers
16944 or with an ABI. If you define this macro to be 0, then the
16945 conventions used for structure and union return values are decided
16946 by the `TARGET_RETURN_IN_MEMORY' target hook.
16948 If not defined, this defaults to the value 1.
16950 - Target Hook: rtx TARGET_STRUCT_VALUE_RTX (tree FNDECL, int INCOMING)
16951 This target hook should return the location of the structure value
16952 address (normally a `mem' or `reg'), or 0 if the address is passed
16953 as an "invisible" first argument. Note that FNDECL may be `NULL',
16956 On some architectures the place where the structure value address
16957 is found by the called function is not the same place that the
16958 caller put it. This can be due to register windows, or it could
16959 be because the function prologue moves it to a different place.
16960 INCOMING is `true' when the location is needed in the context of
16961 the called function, and `false' in the context of the caller.
16963 If INCOMING is `true' and the address is to be found on the stack,
16964 return a `mem' which refers to the frame pointer.
16966 - Macro: PCC_STATIC_STRUCT_RETURN
16967 Define this macro if the usual system convention on the target
16968 machine for returning structures and unions is for the called
16969 function to return the address of a static variable containing the
16972 Do not define this if the usual system convention is for the
16973 caller to pass an address to the subroutine.
16975 This macro has effect in `-fpcc-struct-return' mode, but it does
16976 nothing when you use `-freg-struct-return' mode.
16979 File: gccint.info, Node: Caller Saves, Next: Function Entry, Prev: Aggregate Return, Up: Stack and Calling
16981 Caller-Saves Register Allocation
16982 --------------------------------
16984 If you enable it, GCC can save registers around function calls. This
16985 makes it possible to use call-clobbered registers to hold variables that
16986 must live across calls.
16988 - Macro: CALLER_SAVE_PROFITABLE (REFS, CALLS)
16989 A C expression to determine whether it is worthwhile to consider
16990 placing a pseudo-register in a call-clobbered hard register and
16991 saving and restoring it around each function call. The expression
16992 should be 1 when this is worth doing, and 0 otherwise.
16994 If you don't define this macro, a default is used which is good on
16995 most machines: `4 * CALLS < REFS'.
16997 - Macro: HARD_REGNO_CALLER_SAVE_MODE (REGNO, NREGS)
16998 A C expression specifying which mode is required for saving NREGS
16999 of a pseudo-register in call-clobbered hard register REGNO. If
17000 REGNO is unsuitable for caller save, `VOIDmode' should be
17001 returned. For most machines this macro need not be defined since
17002 GCC will select the smallest suitable mode.
17005 File: gccint.info, Node: Function Entry, Next: Profiling, Prev: Caller Saves, Up: Stack and Calling
17007 Function Entry and Exit
17008 -----------------------
17010 This section describes the macros that output function entry
17011 ("prologue") and exit ("epilogue") code.
17013 - Target Hook: void TARGET_ASM_FUNCTION_PROLOGUE (FILE *FILE,
17014 HOST_WIDE_INT SIZE)
17015 If defined, a function that outputs the assembler code for entry
17016 to a function. The prologue is responsible for setting up the
17017 stack frame, initializing the frame pointer register, saving
17018 registers that must be saved, and allocating SIZE additional bytes
17019 of storage for the local variables. SIZE is an integer. FILE is
17020 a stdio stream to which the assembler code should be output.
17022 The label for the beginning of the function need not be output by
17023 this macro. That has already been done when the macro is run.
17025 To determine which registers to save, the macro can refer to the
17026 array `regs_ever_live': element R is nonzero if hard register R is
17027 used anywhere within the function. This implies the function
17028 prologue should save register R, provided it is not one of the
17029 call-used registers. (`TARGET_ASM_FUNCTION_EPILOGUE' must
17030 likewise use `regs_ever_live'.)
17032 On machines that have "register windows", the function entry code
17033 does not save on the stack the registers that are in the windows,
17034 even if they are supposed to be preserved by function calls;
17035 instead it takes appropriate steps to "push" the register stack,
17036 if any non-call-used registers are used in the function.
17038 On machines where functions may or may not have frame-pointers, the
17039 function entry code must vary accordingly; it must set up the frame
17040 pointer if one is wanted, and not otherwise. To determine whether
17041 a frame pointer is in wanted, the macro can refer to the variable
17042 `frame_pointer_needed'. The variable's value will be 1 at run
17043 time in a function that needs a frame pointer. *Note
17046 The function entry code is responsible for allocating any stack
17047 space required for the function. This stack space consists of the
17048 regions listed below. In most cases, these regions are allocated
17049 in the order listed, with the last listed region closest to the
17050 top of the stack (the lowest address if `STACK_GROWS_DOWNWARD' is
17051 defined, and the highest address if it is not defined). You can
17052 use a different order for a machine if doing so is more convenient
17053 or required for compatibility reasons. Except in cases where
17054 required by standard or by a debugger, there is no reason why the
17055 stack layout used by GCC need agree with that used by other
17056 compilers for a machine.
17058 - Target Hook: void TARGET_ASM_FUNCTION_END_PROLOGUE (FILE *FILE)
17059 If defined, a function that outputs assembler code at the end of a
17060 prologue. This should be used when the function prologue is being
17061 emitted as RTL, and you have some extra assembler that needs to be
17062 emitted. *Note prologue instruction pattern::.
17064 - Target Hook: void TARGET_ASM_FUNCTION_BEGIN_EPILOGUE (FILE *FILE)
17065 If defined, a function that outputs assembler code at the start of
17066 an epilogue. This should be used when the function epilogue is
17067 being emitted as RTL, and you have some extra assembler that needs
17068 to be emitted. *Note epilogue instruction pattern::.
17070 - Target Hook: void TARGET_ASM_FUNCTION_EPILOGUE (FILE *FILE,
17071 HOST_WIDE_INT SIZE)
17072 If defined, a function that outputs the assembler code for exit
17073 from a function. The epilogue is responsible for restoring the
17074 saved registers and stack pointer to their values when the
17075 function was called, and returning control to the caller. This
17076 macro takes the same arguments as the macro
17077 `TARGET_ASM_FUNCTION_PROLOGUE', and the registers to restore are
17078 determined from `regs_ever_live' and `CALL_USED_REGISTERS' in the
17081 On some machines, there is a single instruction that does all the
17082 work of returning from the function. On these machines, give that
17083 instruction the name `return' and do not define the macro
17084 `TARGET_ASM_FUNCTION_EPILOGUE' at all.
17086 Do not define a pattern named `return' if you want the
17087 `TARGET_ASM_FUNCTION_EPILOGUE' to be used. If you want the target
17088 switches to control whether return instructions or epilogues are
17089 used, define a `return' pattern with a validity condition that
17090 tests the target switches appropriately. If the `return'
17091 pattern's validity condition is false, epilogues will be used.
17093 On machines where functions may or may not have frame-pointers, the
17094 function exit code must vary accordingly. Sometimes the code for
17095 these two cases is completely different. To determine whether a
17096 frame pointer is wanted, the macro can refer to the variable
17097 `frame_pointer_needed'. The variable's value will be 1 when
17098 compiling a function that needs a frame pointer.
17100 Normally, `TARGET_ASM_FUNCTION_PROLOGUE' and
17101 `TARGET_ASM_FUNCTION_EPILOGUE' must treat leaf functions specially.
17102 The C variable `current_function_is_leaf' is nonzero for such a
17103 function. *Note Leaf Functions::.
17105 On some machines, some functions pop their arguments on exit while
17106 others leave that for the caller to do. For example, the 68020
17107 when given `-mrtd' pops arguments in functions that take a fixed
17108 number of arguments.
17110 Your definition of the macro `RETURN_POPS_ARGS' decides which
17111 functions pop their own arguments. `TARGET_ASM_FUNCTION_EPILOGUE'
17112 needs to know what was decided. The variable that is called
17113 `current_function_pops_args' is the number of bytes of its
17114 arguments that a function should pop. *Note Scalar Return::.
17116 * A region of `current_function_pretend_args_size' bytes of
17117 uninitialized space just underneath the first argument arriving on
17118 the stack. (This may not be at the very start of the allocated
17119 stack region if the calling sequence has pushed anything else
17120 since pushing the stack arguments. But usually, on such machines,
17121 nothing else has been pushed yet, because the function prologue
17122 itself does all the pushing.) This region is used on machines
17123 where an argument may be passed partly in registers and partly in
17124 memory, and, in some cases to support the features in `<stdarg.h>'.
17126 * An area of memory used to save certain registers used by the
17127 function. The size of this area, which may also include space for
17128 such things as the return address and pointers to previous stack
17129 frames, is machine-specific and usually depends on which registers
17130 have been used in the function. Machines with register windows
17131 often do not require a save area.
17133 * A region of at least SIZE bytes, possibly rounded up to an
17134 allocation boundary, to contain the local variables of the
17135 function. On some machines, this region and the save area may
17136 occur in the opposite order, with the save area closer to the top
17139 * Optionally, when `ACCUMULATE_OUTGOING_ARGS' is defined, a region of
17140 `current_function_outgoing_args_size' bytes to be used for outgoing
17141 argument lists of the function. *Note Stack Arguments::.
17143 Normally, it is necessary for the macros
17144 `TARGET_ASM_FUNCTION_PROLOGUE' and `TARGET_ASM_FUNCTION_EPILOGUE' to
17145 treat leaf functions specially. The C variable
17146 `current_function_is_leaf' is nonzero for such a function.
17148 - Macro: EXIT_IGNORE_STACK
17149 Define this macro as a C expression that is nonzero if the return
17150 instruction or the function epilogue ignores the value of the stack
17151 pointer; in other words, if it is safe to delete an instruction to
17152 adjust the stack pointer before a return from the function. The
17155 Note that this macro's value is relevant only for functions for
17156 which frame pointers are maintained. It is never safe to delete a
17157 final stack adjustment in a function that has no frame pointer,
17158 and the compiler knows this regardless of `EXIT_IGNORE_STACK'.
17160 - Macro: EPILOGUE_USES (REGNO)
17161 Define this macro as a C expression that is nonzero for registers
17162 that are used by the epilogue or the `return' pattern. The stack
17163 and frame pointer registers are already be assumed to be used as
17166 - Macro: EH_USES (REGNO)
17167 Define this macro as a C expression that is nonzero for registers
17168 that are used by the exception handling mechanism, and so should
17169 be considered live on entry to an exception edge.
17171 - Macro: DELAY_SLOTS_FOR_EPILOGUE
17172 Define this macro if the function epilogue contains delay slots to
17173 which instructions from the rest of the function can be "moved".
17174 The definition should be a C expression whose value is an integer
17175 representing the number of delay slots there.
17177 - Macro: ELIGIBLE_FOR_EPILOGUE_DELAY (INSN, N)
17178 A C expression that returns 1 if INSN can be placed in delay slot
17179 number N of the epilogue.
17181 The argument N is an integer which identifies the delay slot now
17182 being considered (since different slots may have different rules of
17183 eligibility). It is never negative and is always less than the
17184 number of epilogue delay slots (what `DELAY_SLOTS_FOR_EPILOGUE'
17185 returns). If you reject a particular insn for a given delay slot,
17186 in principle, it may be reconsidered for a subsequent delay slot.
17187 Also, other insns may (at least in principle) be considered for
17188 the so far unfilled delay slot.
17190 The insns accepted to fill the epilogue delay slots are put in an
17191 RTL list made with `insn_list' objects, stored in the variable
17192 `current_function_epilogue_delay_list'. The insn for the first
17193 delay slot comes first in the list. Your definition of the macro
17194 `TARGET_ASM_FUNCTION_EPILOGUE' should fill the delay slots by
17195 outputting the insns in this list, usually by calling
17198 You need not define this macro if you did not define
17199 `DELAY_SLOTS_FOR_EPILOGUE'.
17201 - Target Hook: void TARGET_ASM_OUTPUT_MI_THUNK (FILE *FILE, tree
17202 THUNK_FNDECL, HOST_WIDE_INT DELTA, tree FUNCTION)
17203 A function that outputs the assembler code for a thunk function,
17204 used to implement C++ virtual function calls with multiple
17205 inheritance. The thunk acts as a wrapper around a virtual
17206 function, adjusting the implicit object parameter before handing
17207 control off to the real function.
17209 First, emit code to add the integer DELTA to the location that
17210 contains the incoming first argument. Assume that this argument
17211 contains a pointer, and is the one used to pass the `this' pointer
17212 in C++. This is the incoming argument _before_ the function
17213 prologue, e.g. `%o0' on a sparc. The addition must preserve the
17214 values of all other incoming arguments.
17216 After the addition, emit code to jump to FUNCTION, which is a
17217 `FUNCTION_DECL'. This is a direct pure jump, not a call, and does
17218 not touch the return address. Hence returning from FUNCTION will
17219 return to whoever called the current `thunk'.
17221 The effect must be as if FUNCTION had been called directly with
17222 the adjusted first argument. This macro is responsible for
17223 emitting all of the code for a thunk function;
17224 `TARGET_ASM_FUNCTION_PROLOGUE' and `TARGET_ASM_FUNCTION_EPILOGUE'
17227 The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already
17228 been extracted from it.) It might possibly be useful on some
17229 targets, but probably not.
17231 If you do not define this macro, the target-independent code in
17232 the C++ front end will generate a less efficient heavyweight thunk
17233 that calls FUNCTION instead of jumping to it. The generic
17234 approach does not support varargs.
17236 - Target Hook: void TARGET_ASM_OUTPUT_MI_VCALL_THUNK (FILE *FILE, tree
17237 THUNK_FNDECL, HOST_WIDE_INT DELTA, int VCALL_OFFSET, tree
17239 A function like `TARGET_ASM_OUTPUT_MI_THUNK', except that if
17240 VCALL_OFFSET is nonzero, an additional adjustment should be made
17241 after adding `delta'. In particular, if P is the adjusted
17242 pointer, the following adjustment should be made:
17244 p += (*((ptrdiff_t **)p))[vcall_offset/sizeof(ptrdiff_t)]
17246 If this function is defined, it will always be used in place of
17247 `TARGET_ASM_OUTPUT_MI_THUNK'.
17250 File: gccint.info, Node: Profiling, Next: Tail Calls, Prev: Function Entry, Up: Stack and Calling
17252 Generating Code for Profiling
17253 -----------------------------
17255 These macros will help you generate code for profiling.
17257 - Macro: FUNCTION_PROFILER (FILE, LABELNO)
17258 A C statement or compound statement to output to FILE some
17259 assembler code to call the profiling subroutine `mcount'.
17261 The details of how `mcount' expects to be called are determined by
17262 your operating system environment, not by GCC. To figure them out,
17263 compile a small program for profiling using the system's installed
17264 C compiler and look at the assembler code that results.
17266 Older implementations of `mcount' expect the address of a counter
17267 variable to be loaded into some register. The name of this
17268 variable is `LP' followed by the number LABELNO, so you would
17269 generate the name using `LP%d' in a `fprintf'.
17271 - Macro: PROFILE_HOOK
17272 A C statement or compound statement to output to FILE some assembly
17273 code to call the profiling subroutine `mcount' even the target does
17274 not support profiling.
17276 - Macro: NO_PROFILE_COUNTERS
17277 Define this macro if the `mcount' subroutine on your system does
17278 not need a counter variable allocated for each function. This is
17279 true for almost all modern implementations. If you define this
17280 macro, you must not use the LABELNO argument to
17281 `FUNCTION_PROFILER'.
17283 - Macro: PROFILE_BEFORE_PROLOGUE
17284 Define this macro if the code for function profiling should come
17285 before the function prologue. Normally, the profiling code comes
17289 File: gccint.info, Node: Tail Calls, Prev: Profiling, Up: Stack and Calling
17291 Permitting tail calls
17292 ---------------------
17294 - Target Hook: bool TARGET_FUNCTION_OK_FOR_SIBCALL (tree DECL, tree
17296 True if it is ok to do sibling call optimization for the specified
17297 call expression EXP. DECL will be the called function, or `NULL'
17298 if this is an indirect call.
17300 It is not uncommon for limitations of calling conventions to
17301 prevent tail calls to functions outside the current unit of
17302 translation, or during PIC compilation. The hook is used to
17303 enforce these restrictions, as the `sibcall' md pattern can not
17304 fail, or fall over to a "normal" call. The criteria for
17305 successful sibling call optimization may vary greatly between
17306 different architectures.
17309 File: gccint.info, Node: Varargs, Next: Trampolines, Prev: Stack and Calling, Up: Target Macros
17311 Implementing the Varargs Macros
17312 ===============================
17314 GCC comes with an implementation of `<varargs.h>' and `<stdarg.h>'
17315 that work without change on machines that pass arguments on the stack.
17316 Other machines require their own implementations of varargs, and the
17317 two machine independent header files must have conditionals to include
17320 ISO `<stdarg.h>' differs from traditional `<varargs.h>' mainly in
17321 the calling convention for `va_start'. The traditional implementation
17322 takes just one argument, which is the variable in which to store the
17323 argument pointer. The ISO implementation of `va_start' takes an
17324 additional second argument. The user is supposed to write the last
17325 named argument of the function here.
17327 However, `va_start' should not use this argument. The way to find
17328 the end of the named arguments is with the built-in functions described
17331 - Macro: __builtin_saveregs ()
17332 Use this built-in function to save the argument registers in
17333 memory so that the varargs mechanism can access them. Both ISO
17334 and traditional versions of `va_start' must use
17335 `__builtin_saveregs', unless you use `SETUP_INCOMING_VARARGS' (see
17338 On some machines, `__builtin_saveregs' is open-coded under the
17339 control of the macro `EXPAND_BUILTIN_SAVEREGS'. On other machines,
17340 it calls a routine written in assembler language, found in
17343 Code generated for the call to `__builtin_saveregs' appears at the
17344 beginning of the function, as opposed to where the call to
17345 `__builtin_saveregs' is written, regardless of what the code is.
17346 This is because the registers must be saved before the function
17347 starts to use them for its own purposes.
17349 - Macro: __builtin_args_info (CATEGORY)
17350 Use this built-in function to find the first anonymous arguments in
17353 In general, a machine may have several categories of registers
17354 used for arguments, each for a particular category of data types.
17355 (For example, on some machines, floating-point registers are used
17356 for floating-point arguments while other arguments are passed in
17357 the general registers.) To make non-varargs functions use the
17358 proper calling convention, you have defined the `CUMULATIVE_ARGS'
17359 data type to record how many registers in each category have been
17362 `__builtin_args_info' accesses the same data structure of type
17363 `CUMULATIVE_ARGS' after the ordinary argument layout is finished
17364 with it, with CATEGORY specifying which word to access. Thus, the
17365 value indicates the first unused register in a given category.
17367 Normally, you would use `__builtin_args_info' in the implementation
17368 of `va_start', accessing each category just once and storing the
17369 value in the `va_list' object. This is because `va_list' will
17370 have to update the values, and there is no way to alter the values
17371 accessed by `__builtin_args_info'.
17373 - Macro: __builtin_next_arg (LASTARG)
17374 This is the equivalent of `__builtin_args_info', for stack
17375 arguments. It returns the address of the first anonymous stack
17376 argument, as type `void *'. If `ARGS_GROW_DOWNWARD', it returns
17377 the address of the location above the first anonymous stack
17378 argument. Use it in `va_start' to initialize the pointer for
17379 fetching arguments from the stack. Also use it in `va_start' to
17380 verify that the second parameter LASTARG is the last named argument
17381 of the current function.
17383 - Macro: __builtin_classify_type (OBJECT)
17384 Since each machine has its own conventions for which data types are
17385 passed in which kind of register, your implementation of `va_arg'
17386 has to embody these conventions. The easiest way to categorize the
17387 specified data type is to use `__builtin_classify_type' together
17388 with `sizeof' and `__alignof__'.
17390 `__builtin_classify_type' ignores the value of OBJECT, considering
17391 only its data type. It returns an integer describing what kind of
17392 type that is--integer, floating, pointer, structure, and so on.
17394 The file `typeclass.h' defines an enumeration that you can use to
17395 interpret the values of `__builtin_classify_type'.
17397 These machine description macros help implement varargs:
17399 - Target Hook: rtx TARGET_EXPAND_BUILTIN_SAVEREGS (void)
17400 If defined, this hook produces the machine-specific code for a
17401 call to `__builtin_saveregs'. This code will be moved to the very
17402 beginning of the function, before any parameter access are made.
17403 The return value of this function should be an RTX that contains
17404 the value to use as the return of `__builtin_saveregs'.
17406 - Target Hook: void TARGET_SETUP_INCOMING_VARARGS (CUMULATIVE_ARGS
17407 *ARGS_SO_FAR, enum machine_mode MODE, tree TYPE, int
17408 *PRETEND_ARGS_SIZE, int SECOND_TIME)
17409 This target hook offers an alternative to using
17410 `__builtin_saveregs' and defining the hook
17411 `TARGET_EXPAND_BUILTIN_SAVEREGS'. Use it to store the anonymous
17412 register arguments into the stack so that all the arguments appear
17413 to have been passed consecutively on the stack. Once this is
17414 done, you can use the standard implementation of varargs that
17415 works for machines that pass all their arguments on the stack.
17417 The argument ARGS_SO_FAR points to the `CUMULATIVE_ARGS' data
17418 structure, containing the values that are obtained after
17419 processing the named arguments. The arguments MODE and TYPE
17420 describe the last named argument--its machine mode and its data
17421 type as a tree node.
17423 The target hook should do two things: first, push onto the stack
17424 all the argument registers _not_ used for the named arguments, and
17425 second, store the size of the data thus pushed into the
17426 `int'-valued variable pointed to by PRETEND_ARGS_SIZE. The value
17427 that you store here will serve as additional offset for setting up
17430 Because you must generate code to push the anonymous arguments at
17431 compile time without knowing their data types,
17432 `TARGET_SETUP_INCOMING_VARARGS' is only useful on machines that
17433 have just a single category of argument register and use it
17434 uniformly for all data types.
17436 If the argument SECOND_TIME is nonzero, it means that the
17437 arguments of the function are being analyzed for the second time.
17438 This happens for an inline function, which is not actually
17439 compiled until the end of the source file. The hook
17440 `TARGET_SETUP_INCOMING_VARARGS' should not generate any
17441 instructions in this case.
17443 - Target Hook: bool TARGET_STRICT_ARGUMENT_NAMING (CUMULATIVE_ARGS *CA)
17444 Define this hook to return `true' if the location where a function
17445 argument is passed depends on whether or not it is a named
17448 This hook controls how the NAMED argument to `FUNCTION_ARG' is set
17449 for varargs and stdarg functions. If this hook returns `true',
17450 the NAMED argument is always true for named arguments, and false
17451 for unnamed arguments. If it returns `false', but
17452 `TARGET_PRETEND_OUTOGOING_VARARGS_NAMED' returns `true', then all
17453 arguments are treated as named. Otherwise, all named arguments
17454 except the last are treated as named.
17456 You need not define this hook if it always returns zero.
17458 - Target Hook: bool TARGET_PRETEND_OUTGOING_VARARGS_NAMED
17459 If you need to conditionally change ABIs so that one works with
17460 `TARGET_SETUP_INCOMING_VARARGS', but the other works like neither
17461 `TARGET_SETUP_INCOMING_VARARGS' nor
17462 `TARGET_STRICT_ARGUMENT_NAMING' was defined, then define this hook
17463 to return `true' if `SETUP_INCOMING_VARARGS' is used, `false'
17464 otherwise. Otherwise, you should not define this hook.
17467 File: gccint.info, Node: Trampolines, Next: Library Calls, Prev: Varargs, Up: Target Macros
17469 Trampolines for Nested Functions
17470 ================================
17472 A "trampoline" is a small piece of code that is created at run time
17473 when the address of a nested function is taken. It normally resides on
17474 the stack, in the stack frame of the containing function. These macros
17475 tell GCC how to generate code to allocate and initialize a trampoline.
17477 The instructions in the trampoline must do two things: load a
17478 constant address into the static chain register, and jump to the real
17479 address of the nested function. On CISC machines such as the m68k,
17480 this requires two instructions, a move immediate and a jump. Then the
17481 two addresses exist in the trampoline as word-long immediate operands.
17482 On RISC machines, it is often necessary to load each address into a
17483 register in two parts. Then pieces of each address form separate
17484 immediate operands.
17486 The code generated to initialize the trampoline must store the
17487 variable parts--the static chain value and the function address--into
17488 the immediate operands of the instructions. On a CISC machine, this is
17489 simply a matter of copying each address to a memory reference at the
17490 proper offset from the start of the trampoline. On a RISC machine, it
17491 may be necessary to take out pieces of the address and store them
17494 - Macro: TRAMPOLINE_TEMPLATE (FILE)
17495 A C statement to output, on the stream FILE, assembler code for a
17496 block of data that contains the constant parts of a trampoline.
17497 This code should not include a label--the label is taken care of
17500 If you do not define this macro, it means no template is needed
17501 for the target. Do not define this macro on systems where the
17502 block move code to copy the trampoline into place would be larger
17503 than the code to generate it on the spot.
17505 - Macro: TRAMPOLINE_SECTION
17506 The name of a subroutine to switch to the section in which the
17507 trampoline template is to be placed (*note Sections::). The
17508 default is a value of `readonly_data_section', which places the
17509 trampoline in the section containing read-only data.
17511 - Macro: TRAMPOLINE_SIZE
17512 A C expression for the size in bytes of the trampoline, as an
17515 - Macro: TRAMPOLINE_ALIGNMENT
17516 Alignment required for trampolines, in bits.
17518 If you don't define this macro, the value of `BIGGEST_ALIGNMENT'
17519 is used for aligning trampolines.
17521 - Macro: INITIALIZE_TRAMPOLINE (ADDR, FNADDR, STATIC_CHAIN)
17522 A C statement to initialize the variable parts of a trampoline.
17523 ADDR is an RTX for the address of the trampoline; FNADDR is an RTX
17524 for the address of the nested function; STATIC_CHAIN is an RTX for
17525 the static chain value that should be passed to the function when
17528 - Macro: TRAMPOLINE_ADJUST_ADDRESS (ADDR)
17529 A C statement that should perform any machine-specific adjustment
17530 in the address of the trampoline. Its argument contains the
17531 address that was passed to `INITIALIZE_TRAMPOLINE'. In case the
17532 address to be used for a function call should be different from
17533 the address in which the template was stored, the different
17534 address should be assigned to ADDR. If this macro is not defined,
17535 ADDR will be used for function calls.
17537 If this macro is not defined, by default the trampoline is
17538 allocated as a stack slot. This default is right for most
17539 machines. The exceptions are machines where it is impossible to
17540 execute instructions in the stack area. On such machines, you may
17541 have to implement a separate stack, using this macro in
17542 conjunction with `TARGET_ASM_FUNCTION_PROLOGUE' and
17543 `TARGET_ASM_FUNCTION_EPILOGUE'.
17545 FP points to a data structure, a `struct function', which
17546 describes the compilation status of the immediate containing
17547 function of the function which the trampoline is for. The stack
17548 slot for the trampoline is in the stack frame of this containing
17549 function. Other allocation strategies probably must do something
17550 analogous with this information.
17552 Implementing trampolines is difficult on many machines because they
17553 have separate instruction and data caches. Writing into a stack
17554 location fails to clear the memory in the instruction cache, so when
17555 the program jumps to that location, it executes the old contents.
17557 Here are two possible solutions. One is to clear the relevant parts
17558 of the instruction cache whenever a trampoline is set up. The other is
17559 to make all trampolines identical, by having them jump to a standard
17560 subroutine. The former technique makes trampoline execution faster; the
17561 latter makes initialization faster.
17563 To clear the instruction cache when a trampoline is initialized,
17564 define the following macro.
17566 - Macro: CLEAR_INSN_CACHE (BEG, END)
17567 If defined, expands to a C expression clearing the _instruction
17568 cache_ in the specified interval. The definition of this macro
17569 would typically be a series of `asm' statements. Both BEG and END
17570 are both pointer expressions.
17572 The operating system may also require the stack to be made executable
17573 before calling the trampoline. To implement this requirement, define
17574 the following macro.
17576 - Macro: ENABLE_EXECUTE_STACK
17577 Define this macro if certain operations must be performed before
17578 executing code located on the stack. The macro should expand to a
17579 series of C file-scope constructs (e.g. functions) and provide a
17580 unique entry point named `__enable_execute_stack'. The target is
17581 responsible for emitting calls to the entry point in the code, for
17582 example from the `INITIALIZE_TRAMPOLINE' macro.
17584 To use a standard subroutine, define the following macro. In
17585 addition, you must make sure that the instructions in a trampoline fill
17586 an entire cache line with identical instructions, or else ensure that
17587 the beginning of the trampoline code is always aligned at the same
17588 point in its cache line. Look in `m68k.h' as a guide.
17590 - Macro: TRANSFER_FROM_TRAMPOLINE
17591 Define this macro if trampolines need a special subroutine to do
17592 their work. The macro should expand to a series of `asm'
17593 statements which will be compiled with GCC. They go in a library
17594 function named `__transfer_from_trampoline'.
17596 If you need to avoid executing the ordinary prologue code of a
17597 compiled C function when you jump to the subroutine, you can do so
17598 by placing a special label of your own in the assembler code. Use
17599 one `asm' statement to generate an assembler label, and another to
17600 make the label global. Then trampolines can use that label to
17601 jump directly to your special assembler code.
17604 File: gccint.info, Node: Library Calls, Next: Addressing Modes, Prev: Trampolines, Up: Target Macros
17606 Implicit Calls to Library Routines
17607 ==================================
17609 Here is an explanation of implicit calls to library routines.
17611 - Macro: DECLARE_LIBRARY_RENAMES
17612 This macro, if defined, should expand to a piece of C code that
17613 will get expanded when compiling functions for libgcc.a. It can
17614 be used to provide alternate names for GCC's internal library
17615 functions if there are ABI-mandated names that the compiler should
17618 - Target Hook: void TARGET_INIT_LIBFUNCS (void)
17619 This hook should declare additional library routines or rename
17620 existing ones, using the functions `set_optab_libfunc' and
17621 `init_one_libfunc' defined in `optabs.c'. `init_optabs' calls
17622 this macro after initializing all the normal library routines.
17624 The default is to do nothing. Most ports don't need to define
17627 - Macro: TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL (MODE, COMPARISON)
17628 This macro should return `true' if the library routine that
17629 implements the floating point comparison operator COMPARISON in
17630 mode MODE will return a boolean, and FALSE if it will return a
17633 GCC's own floating point libraries return tristates from the
17634 comparison operators, so the default returns false always. Most
17635 ports don't need to define this macro.
17637 - Macro: US_SOFTWARE_GOFAST
17638 Define this macro if your system C library uses the US Software
17639 GOFAST library to provide floating point emulation.
17641 In addition to defining this macro, your architecture must set
17642 `TARGET_INIT_LIBFUNCS' to `gofast_maybe_init_libfuncs', or else
17643 call that function from its version of that hook. It is defined
17644 in `config/gofast.h', which must be included by your
17645 architecture's `CPU.c' file. See `sparc/sparc.c' for an example.
17647 If this macro is defined, the
17648 `TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL' target hook must return
17649 false for `SFmode' and `DFmode' comparisons.
17651 - Macro: TARGET_EDOM
17652 The value of `EDOM' on the target machine, as a C integer constant
17653 expression. If you don't define this macro, GCC does not attempt
17654 to deposit the value of `EDOM' into `errno' directly. Look in
17655 `/usr/include/errno.h' to find the value of `EDOM' on your system.
17657 If you do not define `TARGET_EDOM', then compiled code reports
17658 domain errors by calling the library function and letting it
17659 report the error. If mathematical functions on your system use
17660 `matherr' when there is an error, then you should leave
17661 `TARGET_EDOM' undefined so that `matherr' is used normally.
17663 - Macro: GEN_ERRNO_RTX
17664 Define this macro as a C expression to create an rtl expression
17665 that refers to the global "variable" `errno'. (On certain systems,
17666 `errno' may not actually be a variable.) If you don't define this
17667 macro, a reasonable default is used.
17669 - Macro: TARGET_MEM_FUNCTIONS
17670 Define this macro if GCC should generate calls to the ISO C (and
17671 System V) library functions `memcpy', `memmove' and `memset'
17672 rather than the BSD functions `bcopy' and `bzero'.
17674 - Macro: TARGET_C99_FUNCTIONS
17675 When this macro is nonzero, GCC will implicitly optimize `sin'
17676 calls into `sinf' and similarly for other functions defined by C99
17677 standard. The default is nonzero that should be proper value for
17678 most modern systems, however number of existing systems lacks
17679 support for these functions in the runtime so they needs this
17680 macro to be redefined to 0.
17682 - Macro: NEXT_OBJC_RUNTIME
17683 Define this macro to generate code for Objective-C message sending
17684 using the calling convention of the NeXT system. This calling
17685 convention involves passing the object, the selector and the
17686 method arguments all at once to the method-lookup library function.
17688 The default calling convention passes just the object and the
17689 selector to the lookup function, which returns a pointer to the
17693 File: gccint.info, Node: Addressing Modes, Next: Condition Code, Prev: Library Calls, Up: Target Macros
17698 This is about addressing modes.
17700 - Macro: HAVE_PRE_INCREMENT
17701 - Macro: HAVE_PRE_DECREMENT
17702 - Macro: HAVE_POST_INCREMENT
17703 - Macro: HAVE_POST_DECREMENT
17704 A C expression that is nonzero if the machine supports
17705 pre-increment, pre-decrement, post-increment, or post-decrement
17706 addressing respectively.
17708 - Macro: HAVE_PRE_MODIFY_DISP
17709 - Macro: HAVE_POST_MODIFY_DISP
17710 A C expression that is nonzero if the machine supports pre- or
17711 post-address side-effect generation involving constants other than
17712 the size of the memory operand.
17714 - Macro: HAVE_PRE_MODIFY_REG
17715 - Macro: HAVE_POST_MODIFY_REG
17716 A C expression that is nonzero if the machine supports pre- or
17717 post-address side-effect generation involving a register
17720 - Macro: CONSTANT_ADDRESS_P (X)
17721 A C expression that is 1 if the RTX X is a constant which is a
17722 valid address. On most machines, this can be defined as
17723 `CONSTANT_P (X)', but a few machines are more restrictive in which
17724 constant addresses are supported.
17726 - Macro: CONSTANT_P (X)
17727 `CONSTANT_P', which is defined by target-independent code, accepts
17728 integer-values expressions whose values are not explicitly known,
17729 such as `symbol_ref', `label_ref', and `high' expressions and
17730 `const' arithmetic expressions, in addition to `const_int' and
17731 `const_double' expressions.
17733 - Macro: MAX_REGS_PER_ADDRESS
17734 A number, the maximum number of registers that can appear in a
17735 valid memory address. Note that it is up to you to specify a
17736 value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS'
17739 - Macro: GO_IF_LEGITIMATE_ADDRESS (MODE, X, LABEL)
17740 A C compound statement with a conditional `goto LABEL;' executed
17741 if X (an RTX) is a legitimate memory address on the target machine
17742 for a memory operand of mode MODE.
17744 It usually pays to define several simpler macros to serve as
17745 subroutines for this one. Otherwise it may be too complicated to
17748 This macro must exist in two variants: a strict variant and a
17749 non-strict one. The strict variant is used in the reload pass. It
17750 must be defined so that any pseudo-register that has not been
17751 allocated a hard register is considered a memory reference. In
17752 contexts where some kind of register is required, a pseudo-register
17753 with no hard register must be rejected.
17755 The non-strict variant is used in other passes. It must be
17756 defined to accept all pseudo-registers in every context where some
17757 kind of register is required.
17759 Compiler source files that want to use the strict variant of this
17760 macro define the macro `REG_OK_STRICT'. You should use an `#ifdef
17761 REG_OK_STRICT' conditional to define the strict variant in that
17762 case and the non-strict variant otherwise.
17764 Subroutines to check for acceptable registers for various purposes
17765 (one for base registers, one for index registers, and so on) are
17766 typically among the subroutines used to define
17767 `GO_IF_LEGITIMATE_ADDRESS'. Then only these subroutine macros
17768 need have two variants; the higher levels of macros may be the
17769 same whether strict or not.
17771 Normally, constant addresses which are the sum of a `symbol_ref'
17772 and an integer are stored inside a `const' RTX to mark them as
17773 constant. Therefore, there is no need to recognize such sums
17774 specifically as legitimate addresses. Normally you would simply
17775 recognize any `const' as legitimate.
17777 Usually `PRINT_OPERAND_ADDRESS' is not prepared to handle constant
17778 sums that are not marked with `const'. It assumes that a naked
17779 `plus' indicates indexing. If so, then you _must_ reject such
17780 naked constant sums as illegitimate addresses, so that none of
17781 them will be given to `PRINT_OPERAND_ADDRESS'.
17783 On some machines, whether a symbolic address is legitimate depends
17784 on the section that the address refers to. On these machines,
17785 define the target hook `TARGET_ENCODE_SECTION_INFO' to store the
17786 information into the `symbol_ref', and then check for it here.
17787 When you see a `const', you will have to look inside it to find the
17788 `symbol_ref' in order to determine the section. *Note Assembler
17791 - Macro: REG_OK_FOR_BASE_P (X)
17792 A C expression that is nonzero if X (assumed to be a `reg' RTX) is
17793 valid for use as a base register. For hard registers, it should
17794 always accept those which the hardware permits and reject the
17795 others. Whether the macro accepts or rejects pseudo registers
17796 must be controlled by `REG_OK_STRICT' as described above. This
17797 usually requires two variant definitions, of which `REG_OK_STRICT'
17798 controls the one actually used.
17800 - Macro: REG_MODE_OK_FOR_BASE_P (X, MODE)
17801 A C expression that is just like `REG_OK_FOR_BASE_P', except that
17802 that expression may examine the mode of the memory reference in
17803 MODE. You should define this macro if the mode of the memory
17804 reference affects whether a register may be used as a base
17805 register. If you define this macro, the compiler will use it
17806 instead of `REG_OK_FOR_BASE_P'.
17808 - Macro: REG_OK_FOR_INDEX_P (X)
17809 A C expression that is nonzero if X (assumed to be a `reg' RTX) is
17810 valid for use as an index register.
17812 The difference between an index register and a base register is
17813 that the index register may be scaled. If an address involves the
17814 sum of two registers, neither one of them scaled, then either one
17815 may be labeled the "base" and the other the "index"; but whichever
17816 labeling is used must fit the machine's constraints of which
17817 registers may serve in each capacity. The compiler will try both
17818 labelings, looking for one that is valid, and will reload one or
17819 both registers only if neither labeling works.
17821 - Macro: FIND_BASE_TERM (X)
17822 A C expression to determine the base term of address X. This
17823 macro is used in only one place: `find_base_term' in alias.c.
17825 It is always safe for this macro to not be defined. It exists so
17826 that alias analysis can understand machine-dependent addresses.
17828 The typical use of this macro is to handle addresses containing a
17829 label_ref or symbol_ref within an UNSPEC.
17831 - Macro: LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN)
17832 A C compound statement that attempts to replace X with a valid
17833 memory address for an operand of mode MODE. WIN will be a C
17834 statement label elsewhere in the code; the macro definition may use
17836 GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
17838 to avoid further processing if the address has become legitimate.
17840 X will always be the result of a call to `break_out_memory_refs',
17841 and OLDX will be the operand that was given to that function to
17844 The code generated by this macro should not alter the substructure
17845 of X. If it transforms X into a more legitimate form, it should
17846 assign X (which will always be a C variable) a new value.
17848 It is not necessary for this macro to come up with a legitimate
17849 address. The compiler has standard ways of doing so in all cases.
17850 In fact, it is safe for this macro to do nothing. But often a
17851 machine-dependent strategy can generate better code.
17853 - Macro: LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS,
17855 A C compound statement that attempts to replace X, which is an
17856 address that needs reloading, with a valid memory address for an
17857 operand of mode MODE. WIN will be a C statement label elsewhere
17858 in the code. It is not necessary to define this macro, but it
17859 might be useful for performance reasons.
17861 For example, on the i386, it is sometimes possible to use a single
17862 reload register instead of two by reloading a sum of two pseudo
17863 registers into a register. On the other hand, for number of RISC
17864 processors offsets are limited so that often an intermediate
17865 address needs to be generated in order to address a stack slot.
17866 By defining `LEGITIMIZE_RELOAD_ADDRESS' appropriately, the
17867 intermediate addresses generated for adjacent some stack slots can
17868 be made identical, and thus be shared.
17870 _Note_: This macro should be used with caution. It is necessary
17871 to know something of how reload works in order to effectively use
17872 this, and it is quite easy to produce macros that build in too
17873 much knowledge of reload internals.
17875 _Note_: This macro must be able to reload an address created by a
17876 previous invocation of this macro. If it fails to handle such
17877 addresses then the compiler may generate incorrect code or abort.
17879 The macro definition should use `push_reload' to indicate parts
17880 that need reloading; OPNUM, TYPE and IND_LEVELS are usually
17881 suitable to be passed unaltered to `push_reload'.
17883 The code generated by this macro must not alter the substructure of
17884 X. If it transforms X into a more legitimate form, it should
17885 assign X (which will always be a C variable) a new value. This
17886 also applies to parts that you change indirectly by calling
17889 The macro definition may use `strict_memory_address_p' to test if
17890 the address has become legitimate.
17892 If you want to change only a part of X, one standard way of doing
17893 this is to use `copy_rtx'. Note, however, that is unshares only a
17894 single level of rtl. Thus, if the part to be changed is not at the
17895 top level, you'll need to replace first the top level. It is not
17896 necessary for this macro to come up with a legitimate address;
17897 but often a machine-dependent strategy can generate better code.
17899 - Macro: GO_IF_MODE_DEPENDENT_ADDRESS (ADDR, LABEL)
17900 A C statement or compound statement with a conditional `goto
17901 LABEL;' executed if memory address X (an RTX) can have different
17902 meanings depending on the machine mode of the memory reference it
17903 is used for or if the address is valid for some modes but not
17906 Autoincrement and autodecrement addresses typically have
17907 mode-dependent effects because the amount of the increment or
17908 decrement is the size of the operand being addressed. Some
17909 machines have other mode-dependent addresses. Many RISC machines
17910 have no mode-dependent addresses.
17912 You may assume that ADDR is a valid address for the machine.
17914 - Macro: LEGITIMATE_CONSTANT_P (X)
17915 A C expression that is nonzero if X is a legitimate constant for
17916 an immediate operand on the target machine. You can assume that X
17917 satisfies `CONSTANT_P', so you need not check this. In fact, `1'
17918 is a suitable definition for this macro on machines where anything
17919 `CONSTANT_P' is valid.
17922 File: gccint.info, Node: Condition Code, Next: Costs, Prev: Addressing Modes, Up: Target Macros
17924 Condition Code Status
17925 =====================
17927 This describes the condition code status.
17929 The file `conditions.h' defines a variable `cc_status' to describe
17930 how the condition code was computed (in case the interpretation of the
17931 condition code depends on the instruction that it was set by). This
17932 variable contains the RTL expressions on which the condition code is
17933 currently based, and several standard flags.
17935 Sometimes additional machine-specific flags must be defined in the
17936 machine description header file. It can also add additional
17937 machine-specific information by defining `CC_STATUS_MDEP'.
17939 - Macro: CC_STATUS_MDEP
17940 C code for a data type which is used for declaring the `mdep'
17941 component of `cc_status'. It defaults to `int'.
17943 This macro is not used on machines that do not use `cc0'.
17945 - Macro: CC_STATUS_MDEP_INIT
17946 A C expression to initialize the `mdep' field to "empty". The
17947 default definition does nothing, since most machines don't use the
17948 field anyway. If you want to use the field, you should probably
17949 define this macro to initialize it.
17951 This macro is not used on machines that do not use `cc0'.
17953 - Macro: NOTICE_UPDATE_CC (EXP, INSN)
17954 A C compound statement to set the components of `cc_status'
17955 appropriately for an insn INSN whose body is EXP. It is this
17956 macro's responsibility to recognize insns that set the condition
17957 code as a byproduct of other activity as well as those that
17958 explicitly set `(cc0)'.
17960 This macro is not used on machines that do not use `cc0'.
17962 If there are insns that do not set the condition code but do alter
17963 other machine registers, this macro must check to see whether they
17964 invalidate the expressions that the condition code is recorded as
17965 reflecting. For example, on the 68000, insns that store in address
17966 registers do not set the condition code, which means that usually
17967 `NOTICE_UPDATE_CC' can leave `cc_status' unaltered for such insns.
17968 But suppose that the previous insn set the condition code based
17969 on location `a4@(102)' and the current insn stores a new value in
17970 `a4'. Although the condition code is not changed by this, it will
17971 no longer be true that it reflects the contents of `a4@(102)'.
17972 Therefore, `NOTICE_UPDATE_CC' must alter `cc_status' in this case
17973 to say that nothing is known about the condition code value.
17975 The definition of `NOTICE_UPDATE_CC' must be prepared to deal with
17976 the results of peephole optimization: insns whose patterns are
17977 `parallel' RTXs containing various `reg', `mem' or constants which
17978 are just the operands. The RTL structure of these insns is not
17979 sufficient to indicate what the insns actually do. What
17980 `NOTICE_UPDATE_CC' should do when it sees one is just to run
17983 A possible definition of `NOTICE_UPDATE_CC' is to call a function
17984 that looks at an attribute (*note Insn Attributes::) named, for
17985 example, `cc'. This avoids having detailed information about
17986 patterns in two places, the `md' file and in `NOTICE_UPDATE_CC'.
17988 - Macro: SELECT_CC_MODE (OP, X, Y)
17989 Returns a mode from class `MODE_CC' to be used when comparison
17990 operation code OP is applied to rtx X and Y. For example, on the
17991 SPARC, `SELECT_CC_MODE' is defined as (see *note Jump Patterns::
17992 for a description of the reason for this definition)
17994 #define SELECT_CC_MODE(OP,X,Y) \
17995 (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
17996 ? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \
17997 : ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \
17998 || GET_CODE (X) == NEG) \
17999 ? CC_NOOVmode : CCmode))
18001 You should define this macro if and only if you define extra CC
18002 modes in `MACHINE-modes.def'.
18004 - Macro: CANONICALIZE_COMPARISON (CODE, OP0, OP1)
18005 On some machines not all possible comparisons are defined, but you
18006 can convert an invalid comparison into a valid one. For example,
18007 the Alpha does not have a `GT' comparison, but you can use an `LT'
18008 comparison instead and swap the order of the operands.
18010 On such machines, define this macro to be a C statement to do any
18011 required conversions. CODE is the initial comparison code and OP0
18012 and OP1 are the left and right operands of the comparison,
18013 respectively. You should modify CODE, OP0, and OP1 as required.
18015 GCC will not assume that the comparison resulting from this macro
18016 is valid but will see if the resulting insn matches a pattern in
18019 You need not define this macro if it would never change the
18020 comparison code or operands.
18022 - Macro: REVERSIBLE_CC_MODE (MODE)
18023 A C expression whose value is one if it is always safe to reverse a
18024 comparison whose mode is MODE. If `SELECT_CC_MODE' can ever
18025 return MODE for a floating-point inequality comparison, then
18026 `REVERSIBLE_CC_MODE (MODE)' must be zero.
18028 You need not define this macro if it would always returns zero or
18029 if the floating-point format is anything other than
18030 `IEEE_FLOAT_FORMAT'. For example, here is the definition used on
18031 the SPARC, where floating-point inequality comparisons are always
18034 #define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode)
18036 - Macro: REVERSE_CONDITION (CODE, MODE)
18037 A C expression whose value is reversed condition code of the CODE
18038 for comparison done in CC_MODE MODE. The macro is used only in
18039 case `REVERSIBLE_CC_MODE (MODE)' is nonzero. Define this macro in
18040 case machine has some non-standard way how to reverse certain
18041 conditionals. For instance in case all floating point conditions
18042 are non-trapping, compiler may freely convert unordered compares
18043 to ordered one. Then definition may look like:
18045 #define REVERSE_CONDITION(CODE, MODE) \
18046 ((MODE) != CCFPmode ? reverse_condition (CODE) \
18047 : reverse_condition_maybe_unordered (CODE))
18049 - Macro: REVERSE_CONDEXEC_PREDICATES_P (CODE1, CODE2)
18050 A C expression that returns true if the conditional execution
18051 predicate CODE1 is the inverse of CODE2 and vice versa. Define
18052 this to return 0 if the target has conditional execution
18053 predicates that cannot be reversed safely. If no expansion is
18054 specified, this macro is defined as follows:
18056 #define REVERSE_CONDEXEC_PREDICATES_P (x, y) \
18057 ((x) == reverse_condition (y))
18059 - Target Hook: bool TARGET_FIXED_CONDITION_CODE_REGS (unsigned int *,
18061 On targets which do not use `(cc0)', and which use a hard register
18062 rather than a pseudo-register to hold condition codes, the regular
18063 CSE passes are often not able to identify cases in which the hard
18064 register is set to a common value. Use this hook to enable a
18065 small pass which optimizes such cases. This hook should return
18066 true to enable this pass, and it should set the integers to which
18067 its arguments point to the hard register numbers used for
18068 condition codes. When there is only one such register, as is true
18069 on most systems, the integer pointed to by the second argument
18070 should be set to `INVALID_REGNUM'.
18072 The default version of this hook returns false.
18074 - Target Hook: enum machine_mode TARGET_CC_MODES_COMPATIBLE (enum
18075 machine_mode, enum machine_mode)
18076 On targets which use multiple condition code modes in class
18077 `MODE_CC', it is sometimes the case that a comparison can be
18078 validly done in more than one mode. On such a system, define this
18079 target hook to take two mode arguments and to return a mode in
18080 which both comparisons may be validly done. If there is no such
18081 mode, return `VOIDmode'.
18083 The default version of this hook checks whether the modes are the
18084 same. If they are, it returns that mode. If they are different,
18085 it returns `VOIDmode'.
18088 File: gccint.info, Node: Costs, Next: Scheduling, Prev: Condition Code, Up: Target Macros
18090 Describing Relative Costs of Operations
18091 =======================================
18093 These macros let you describe the relative speed of various
18094 operations on the target machine.
18096 - Macro: REGISTER_MOVE_COST (MODE, FROM, TO)
18097 A C expression for the cost of moving data of mode MODE from a
18098 register in class FROM to one in class TO. The classes are
18099 expressed using the enumeration values such as `GENERAL_REGS'. A
18100 value of 2 is the default; other values are interpreted relative to
18103 It is not required that the cost always equal 2 when FROM is the
18104 same as TO; on some machines it is expensive to move between
18105 registers if they are not general registers.
18107 If reload sees an insn consisting of a single `set' between two
18108 hard registers, and if `REGISTER_MOVE_COST' applied to their
18109 classes returns a value of 2, reload does not check to ensure that
18110 the constraints of the insn are met. Setting a cost of other than
18111 2 will allow reload to verify that the constraints are met. You
18112 should do this if the `movM' pattern's constraints do not allow
18115 - Macro: MEMORY_MOVE_COST (MODE, CLASS, IN)
18116 A C expression for the cost of moving data of mode MODE between a
18117 register of class CLASS and memory; IN is zero if the value is to
18118 be written to memory, nonzero if it is to be read in. This cost
18119 is relative to those in `REGISTER_MOVE_COST'. If moving between
18120 registers and memory is more expensive than between two registers,
18121 you should define this macro to express the relative cost.
18123 If you do not define this macro, GCC uses a default cost of 4 plus
18124 the cost of copying via a secondary reload register, if one is
18125 needed. If your machine requires a secondary reload register to
18126 copy between memory and a register of CLASS but the reload
18127 mechanism is more complex than copying via an intermediate, define
18128 this macro to reflect the actual cost of the move.
18130 GCC defines the function `memory_move_secondary_cost' if secondary
18131 reloads are needed. It computes the costs due to copying via a
18132 secondary register. If your machine copies from memory using a
18133 secondary register in the conventional way but the default base
18134 value of 4 is not correct for your machine, define this macro to
18135 add some other value to the result of that function. The
18136 arguments to that function are the same as to this macro.
18138 - Macro: BRANCH_COST
18139 A C expression for the cost of a branch instruction. A value of 1
18140 is the default; other values are interpreted relative to that.
18142 Here are additional macros which do not specify precise relative
18143 costs, but only that certain actions are more expensive than GCC would
18146 - Macro: SLOW_BYTE_ACCESS
18147 Define this macro as a C expression which is nonzero if accessing
18148 less than a word of memory (i.e. a `char' or a `short') is no
18149 faster than accessing a word of memory, i.e., if such access
18150 require more than one instruction or if there is no difference in
18151 cost between byte and (aligned) word loads.
18153 When this macro is not defined, the compiler will access a field by
18154 finding the smallest containing object; when it is defined, a
18155 fullword load will be used if alignment permits. Unless bytes
18156 accesses are faster than word accesses, using word accesses is
18157 preferable since it may eliminate subsequent memory access if
18158 subsequent accesses occur to other fields in the same word of the
18159 structure, but to different bytes.
18161 - Macro: SLOW_UNALIGNED_ACCESS (MODE, ALIGNMENT)
18162 Define this macro to be the value 1 if memory accesses described
18163 by the MODE and ALIGNMENT parameters have a cost many times greater
18164 than aligned accesses, for example if they are emulated in a trap
18167 When this macro is nonzero, the compiler will act as if
18168 `STRICT_ALIGNMENT' were nonzero when generating code for block
18169 moves. This can cause significantly more instructions to be
18170 produced. Therefore, do not set this macro nonzero if unaligned
18171 accesses only add a cycle or two to the time for a memory access.
18173 If the value of this macro is always zero, it need not be defined.
18174 If this macro is defined, it should produce a nonzero value when
18175 `STRICT_ALIGNMENT' is nonzero.
18177 - Macro: MOVE_RATIO
18178 The threshold of number of scalar memory-to-memory move insns,
18179 _below_ which a sequence of insns should be generated instead of a
18180 string move insn or a library call. Increasing the value will
18181 always make code faster, but eventually incurs high cost in
18182 increased code size.
18184 Note that on machines where the corresponding move insn is a
18185 `define_expand' that emits a sequence of insns, this macro counts
18186 the number of such sequences.
18188 If you don't define this, a reasonable default is used.
18190 - Macro: MOVE_BY_PIECES_P (SIZE, ALIGNMENT)
18191 A C expression used to determine whether `move_by_pieces' will be
18192 used to copy a chunk of memory, or whether some other block move
18193 mechanism will be used. Defaults to 1 if `move_by_pieces_ninsns'
18194 returns less than `MOVE_RATIO'.
18196 - Macro: MOVE_MAX_PIECES
18197 A C expression used by `move_by_pieces' to determine the largest
18198 unit a load or store used to copy memory is. Defaults to
18201 - Macro: CLEAR_RATIO
18202 The threshold of number of scalar move insns, _below_ which a
18203 sequence of insns should be generated to clear memory instead of a
18204 string clear insn or a library call. Increasing the value will
18205 always make code faster, but eventually incurs high cost in
18206 increased code size.
18208 If you don't define this, a reasonable default is used.
18210 - Macro: CLEAR_BY_PIECES_P (SIZE, ALIGNMENT)
18211 A C expression used to determine whether `clear_by_pieces' will be
18212 used to clear a chunk of memory, or whether some other block clear
18213 mechanism will be used. Defaults to 1 if `move_by_pieces_ninsns'
18214 returns less than `CLEAR_RATIO'.
18216 - Macro: STORE_BY_PIECES_P (SIZE, ALIGNMENT)
18217 A C expression used to determine whether `store_by_pieces' will be
18218 used to set a chunk of memory to a constant value, or whether some
18219 other mechanism will be used. Used by `__builtin_memset' when
18220 storing values other than constant zero and by `__builtin_strcpy'
18221 when when called with a constant source string. Defaults to
18222 `MOVE_BY_PIECES_P'.
18224 - Macro: USE_LOAD_POST_INCREMENT (MODE)
18225 A C expression used to determine whether a load postincrement is a
18226 good thing to use for a given mode. Defaults to the value of
18227 `HAVE_POST_INCREMENT'.
18229 - Macro: USE_LOAD_POST_DECREMENT (MODE)
18230 A C expression used to determine whether a load postdecrement is a
18231 good thing to use for a given mode. Defaults to the value of
18232 `HAVE_POST_DECREMENT'.
18234 - Macro: USE_LOAD_PRE_INCREMENT (MODE)
18235 A C expression used to determine whether a load preincrement is a
18236 good thing to use for a given mode. Defaults to the value of
18237 `HAVE_PRE_INCREMENT'.
18239 - Macro: USE_LOAD_PRE_DECREMENT (MODE)
18240 A C expression used to determine whether a load predecrement is a
18241 good thing to use for a given mode. Defaults to the value of
18242 `HAVE_PRE_DECREMENT'.
18244 - Macro: USE_STORE_POST_INCREMENT (MODE)
18245 A C expression used to determine whether a store postincrement is
18246 a good thing to use for a given mode. Defaults to the value of
18247 `HAVE_POST_INCREMENT'.
18249 - Macro: USE_STORE_POST_DECREMENT (MODE)
18250 A C expression used to determine whether a store postdecrement is
18251 a good thing to use for a given mode. Defaults to the value of
18252 `HAVE_POST_DECREMENT'.
18254 - Macro: USE_STORE_PRE_INCREMENT (MODE)
18255 This macro is used to determine whether a store preincrement is a
18256 good thing to use for a given mode. Defaults to the value of
18257 `HAVE_PRE_INCREMENT'.
18259 - Macro: USE_STORE_PRE_DECREMENT (MODE)
18260 This macro is used to determine whether a store predecrement is a
18261 good thing to use for a given mode. Defaults to the value of
18262 `HAVE_PRE_DECREMENT'.
18264 - Macro: NO_FUNCTION_CSE
18265 Define this macro if it is as good or better to call a constant
18266 function address than to call an address kept in a register.
18268 - Macro: NO_RECURSIVE_FUNCTION_CSE
18269 Define this macro if it is as good or better for a function to call
18270 itself with an explicit address than to call an address kept in a
18273 - Macro: RANGE_TEST_NON_SHORT_CIRCUIT
18274 Define this macro if a non-short-circuit operation produced by
18275 `fold_range_test ()' is optimal. This macro defaults to true if
18276 `BRANCH_COST' is greater than or equal to the value 2.
18278 - Target Hook: bool TARGET_RTX_COSTS (rtx X, int CODE, int OUTER_CODE,
18280 This target hook describes the relative costs of RTL expressions.
18282 The cost may depend on the precise form of the expression, which is
18283 available for examination in X, and the rtx code of the expression
18284 in which it is contained, found in OUTER_CODE. CODE is the
18285 expression code--redundant, since it can be obtained with
18288 In implementing this hook, you can use the construct
18289 `COSTS_N_INSNS (N)' to specify a cost equal to N fast instructions.
18291 On entry to the hook, `*TOTAL' contains a default estimate for the
18292 cost of the expression. The hook should modify this value as
18295 The hook returns true when all subexpressions of X have been
18296 processed, and false when `rtx_cost' should recurse.
18298 - Target Hook: int TARGET_ADDRESS_COST (rtx ADDRESS)
18299 This hook computes the cost of an addressing mode that contains
18300 ADDRESS. If not defined, the cost is computed from the ADDRESS
18301 expression and the `TARGET_RTX_COST' hook.
18303 For most CISC machines, the default cost is a good approximation
18304 of the true cost of the addressing mode. However, on RISC
18305 machines, all instructions normally have the same length and
18306 execution time. Hence all addresses will have equal costs.
18308 In cases where more than one form of an address is known, the form
18309 with the lowest cost will be used. If multiple forms have the
18310 same, lowest, cost, the one that is the most complex will be used.
18312 For example, suppose an address that is equal to the sum of a
18313 register and a constant is used twice in the same basic block.
18314 When this macro is not defined, the address will be computed in a
18315 register and memory references will be indirect through that
18316 register. On machines where the cost of the addressing mode
18317 containing the sum is no higher than that of a simple indirect
18318 reference, this will produce an additional instruction and
18319 possibly require an additional register. Proper specification of
18320 this macro eliminates this overhead for such machines.
18322 This hook is never called with an invalid address.
18324 On machines where an address involving more than one register is as
18325 cheap as an address computation involving only one register,
18326 defining `TARGET_ADDRESS_COST' to reflect this can cause two
18327 registers to be live over a region of code where only one would
18328 have been if `TARGET_ADDRESS_COST' were not defined in that
18329 manner. This effect should be considered in the definition of
18330 this macro. Equivalent costs should probably only be given to
18331 addresses with different numbers of registers on machines with
18335 File: gccint.info, Node: Scheduling, Next: Sections, Prev: Costs, Up: Target Macros
18337 Adjusting the Instruction Scheduler
18338 ===================================
18340 The instruction scheduler may need a fair amount of machine-specific
18341 adjustment in order to produce good code. GCC provides several target
18342 hooks for this purpose. It is usually enough to define just a few of
18343 them: try the first ones in this list first.
18345 - Target Hook: int TARGET_SCHED_ISSUE_RATE (void)
18346 This hook returns the maximum number of instructions that can ever
18347 issue at the same time on the target machine. The default is one.
18348 Although the insn scheduler can define itself the possibility of
18349 issue an insn on the same cycle, the value can serve as an
18350 additional constraint to issue insns on the same simulated
18351 processor cycle (see hooks `TARGET_SCHED_REORDER' and
18352 `TARGET_SCHED_REORDER2'). This value must be constant over the
18353 entire compilation. If you need it to vary depending on what the
18354 instructions are, you must use `TARGET_SCHED_VARIABLE_ISSUE'.
18356 For the automaton based pipeline interface, you could define this
18357 hook to return the value of the macro `MAX_DFA_ISSUE_RATE'.
18359 - Target Hook: int TARGET_SCHED_VARIABLE_ISSUE (FILE *FILE, int
18360 VERBOSE, rtx INSN, int MORE)
18361 This hook is executed by the scheduler after it has scheduled an
18362 insn from the ready list. It should return the number of insns
18363 which can still be issued in the current cycle. The default is
18364 `MORE - 1' for insns other than `CLOBBER' and `USE', which
18365 normally are not counted against the issue rate. You should
18366 define this hook if some insns take more machine resources than
18367 others, so that fewer insns can follow them in the same cycle.
18368 FILE is either a null pointer, or a stdio stream to write any
18369 debug output to. VERBOSE is the verbose level provided by
18370 `-fsched-verbose-N'. INSN is the instruction that was scheduled.
18372 - Target Hook: int TARGET_SCHED_ADJUST_COST (rtx INSN, rtx LINK, rtx
18373 DEP_INSN, int COST)
18374 This function corrects the value of COST based on the relationship
18375 between INSN and DEP_INSN through the dependence LINK. It should
18376 return the new value. The default is to make no adjustment to
18377 COST. This can be used for example to specify to the scheduler
18378 using the traditional pipeline description that an output- or
18379 anti-dependence does not incur the same cost as a data-dependence.
18380 If the scheduler using the automaton based pipeline description,
18381 the cost of anti-dependence is zero and the cost of
18382 output-dependence is maximum of one and the difference of latency
18383 times of the first and the second insns. If these values are not
18384 acceptable, you could use the hook to modify them too. See also
18385 *note Automaton pipeline description::.
18387 - Target Hook: int TARGET_SCHED_ADJUST_PRIORITY (rtx INSN, int
18389 This hook adjusts the integer scheduling priority PRIORITY of
18390 INSN. It should return the new priority. Reduce the priority to
18391 execute INSN earlier, increase the priority to execute INSN later.
18392 Do not define this hook if you do not need to adjust the
18393 scheduling priorities of insns.
18395 - Target Hook: int TARGET_SCHED_REORDER (FILE *FILE, int VERBOSE, rtx
18396 *READY, int *N_READYP, int CLOCK)
18397 This hook is executed by the scheduler after it has scheduled the
18398 ready list, to allow the machine description to reorder it (for
18399 example to combine two small instructions together on `VLIW'
18400 machines). FILE is either a null pointer, or a stdio stream to
18401 write any debug output to. VERBOSE is the verbose level provided
18402 by `-fsched-verbose-N'. READY is a pointer to the ready list of
18403 instructions that are ready to be scheduled. N_READYP is a
18404 pointer to the number of elements in the ready list. The scheduler
18405 reads the ready list in reverse order, starting with
18406 READY[*N_READYP-1] and going to READY[0]. CLOCK is the timer tick
18407 of the scheduler. You may modify the ready list and the number of
18408 ready insns. The return value is the number of insns that can
18409 issue this cycle; normally this is just `issue_rate'. See also
18410 `TARGET_SCHED_REORDER2'.
18412 - Target Hook: int TARGET_SCHED_REORDER2 (FILE *FILE, int VERBOSE, rtx
18413 *READY, int *N_READY, CLOCK)
18414 Like `TARGET_SCHED_REORDER', but called at a different time. That
18415 function is called whenever the scheduler starts a new cycle.
18416 This one is called once per iteration over a cycle, immediately
18417 after `TARGET_SCHED_VARIABLE_ISSUE'; it can reorder the ready list
18418 and return the number of insns to be scheduled in the same cycle.
18419 Defining this hook can be useful if there are frequent situations
18420 where scheduling one insn causes other insns to become ready in
18421 the same cycle. These other insns can then be taken into account
18424 - Target Hook: void TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK (rtx
18426 This hook is called after evaluation forward dependencies of insns
18427 in chain given by two parameter values (HEAD and TAIL
18428 correspondingly) but before insns scheduling of the insn chain.
18429 For example, it can be used for better insn classification if it
18430 requires analysis of dependencies. This hook can use backward and
18431 forward dependencies of the insn scheduler because they are already
18434 - Target Hook: void TARGET_SCHED_INIT (FILE *FILE, int VERBOSE, int
18436 This hook is executed by the scheduler at the beginning of each
18437 block of instructions that are to be scheduled. FILE is either a
18438 null pointer, or a stdio stream to write any debug output to.
18439 VERBOSE is the verbose level provided by `-fsched-verbose-N'.
18440 MAX_READY is the maximum number of insns in the current scheduling
18441 region that can be live at the same time. This can be used to
18442 allocate scratch space if it is needed, e.g. by
18443 `TARGET_SCHED_REORDER'.
18445 - Target Hook: void TARGET_SCHED_FINISH (FILE *FILE, int VERBOSE)
18446 This hook is executed by the scheduler at the end of each block of
18447 instructions that are to be scheduled. It can be used to perform
18448 cleanup of any actions done by the other scheduling hooks. FILE
18449 is either a null pointer, or a stdio stream to write any debug
18450 output to. VERBOSE is the verbose level provided by
18451 `-fsched-verbose-N'.
18453 - Target Hook: int TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE (void)
18454 This hook is called many times during insn scheduling. If the hook
18455 returns nonzero, the automaton based pipeline description is used
18456 for insn scheduling. Otherwise the traditional pipeline
18457 description is used. The default is usage of the traditional
18458 pipeline description.
18460 You should also remember that to simplify the insn scheduler
18461 sources an empty traditional pipeline description interface is
18462 generated even if there is no a traditional pipeline description
18463 in the `.md' file. The same is true for the automaton based
18464 pipeline description. That means that you should be accurate in
18467 - Target Hook: int TARGET_SCHED_DFA_PRE_CYCLE_INSN (void)
18468 The hook returns an RTL insn. The automaton state used in the
18469 pipeline hazard recognizer is changed as if the insn were scheduled
18470 when the new simulated processor cycle starts. Usage of the hook
18471 may simplify the automaton pipeline description for some VLIW
18472 processors. If the hook is defined, it is used only for the
18473 automaton based pipeline description. The default is not to
18474 change the state when the new simulated processor cycle starts.
18476 - Target Hook: void TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN (void)
18477 The hook can be used to initialize data used by the previous hook.
18479 - Target Hook: int TARGET_SCHED_DFA_POST_CYCLE_INSN (void)
18480 The hook is analogous to `TARGET_SCHED_DFA_PRE_CYCLE_INSN' but used
18481 to changed the state as if the insn were scheduled when the new
18482 simulated processor cycle finishes.
18484 - Target Hook: void TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN (void)
18485 The hook is analogous to `TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN' but
18486 used to initialize data used by the previous hook.
18488 - Target Hook: int TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
18490 This hook controls better choosing an insn from the ready insn
18491 queue for the DFA-based insn scheduler. Usually the scheduler
18492 chooses the first insn from the queue. If the hook returns a
18493 positive value, an additional scheduler code tries all
18494 permutations of `TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
18495 ()' subsequent ready insns to choose an insn whose issue will
18496 result in maximal number of issued insns on the same cycle. For
18497 the VLIW processor, the code could actually solve the problem of
18498 packing simple insns into the VLIW insn. Of course, if the rules
18499 of VLIW packing are described in the automaton.
18501 This code also could be used for superscalar RISC processors. Let
18502 us consider a superscalar RISC processor with 3 pipelines. Some
18503 insns can be executed in pipelines A or B, some insns can be
18504 executed only in pipelines B or C, and one insn can be executed in
18505 pipeline B. The processor may issue the 1st insn into A and the
18506 2nd one into B. In this case, the 3rd insn will wait for freeing B
18507 until the next cycle. If the scheduler issues the 3rd insn the
18508 first, the processor could issue all 3 insns per cycle.
18510 Actually this code demonstrates advantages of the automaton based
18511 pipeline hazard recognizer. We try quickly and easy many insn
18512 schedules to choose the best one.
18514 The default is no multipass scheduling.
18517 TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD (rtx)
18518 This hook controls what insns from the ready insn queue will be
18519 considered for the multipass insn scheduling. If the hook returns
18520 zero for insn passed as the parameter, the insn will be not chosen
18523 The default is that any ready insns can be chosen to be issued.
18525 - Target Hook: int TARGET_SCHED_DFA_NEW_CYCLE (FILE *, int, rtx, int,
18527 This hook is called by the insn scheduler before issuing insn
18528 passed as the third parameter on given cycle. If the hook returns
18529 nonzero, the insn is not issued on given processors cycle.
18530 Instead of that, the processor cycle is advanced. If the value
18531 passed through the last parameter is zero, the insn ready queue is
18532 not sorted on the new cycle start as usually. The first parameter
18533 passes file for debugging output. The second one passes the
18534 scheduler verbose level of the debugging output. The forth and
18535 the fifth parameter values are correspondingly processor cycle on
18536 which the previous insn has been issued and the current processor
18539 - Target Hook: void TARGET_SCHED_INIT_DFA_BUBBLES (void)
18540 The DFA-based scheduler could take the insertion of nop operations
18541 for better insn scheduling into account. It can be done only if
18542 the multi-pass insn scheduling works (see hook
18543 `TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD').
18545 Let us consider a VLIW processor insn with 3 slots. Each insn can
18546 be placed only in one of the three slots. We have 3 ready insns
18547 A, B, and C. A and C can be placed only in the 1st slot, B can be
18548 placed only in the 3rd slot. We described the automaton which
18549 does not permit empty slot gaps between insns (usually such
18550 description is simpler). Without this code the scheduler would
18551 place each insn in 3 separate VLIW insns. If the scheduler places
18552 a nop insn into the 2nd slot, it could place the 3 insns into 2
18553 VLIW insns. What is the nop insn is returned by hook
18554 `TARGET_SCHED_DFA_BUBBLE'. Hook `TARGET_SCHED_INIT_DFA_BUBBLES'
18555 can be used to initialize or create the nop insns.
18557 You should remember that the scheduler does not insert the nop
18558 insns. It is not wise because of the following optimizations.
18559 The scheduler only considers such possibility to improve the
18560 result schedule. The nop insns should be inserted lately, e.g. on
18563 - Target Hook: rtx TARGET_SCHED_DFA_BUBBLE (int INDEX)
18564 This hook `FIRST_CYCLE_MULTIPASS_SCHEDULING' is used to insert nop
18565 operations for better insn scheduling when DFA-based scheduler
18566 makes multipass insn scheduling (see also description of hook
18567 `TARGET_SCHED_INIT_DFA_BUBBLES'). This hook returns a nop insn
18568 with given INDEX. The indexes start with zero. The hook should
18569 return `NULL' if there are no more nop insns with indexes greater
18572 - Target Hook: bool IS_COSTLY_DEPENDENCE (rtx INSN1, rtx INSN2, rtx
18573 DEP_LINK, int DEP_COST, int DISTANCE)
18574 This hook is used to define which dependences are considered
18575 costly by the target, so costly that it is not advisable to
18576 schedule the insns that are involved in the dependence too close
18577 to one another. The parameters to this hook are as follows: The
18578 second parameter INSN2 is dependent upon the first parameter
18579 INSN1. The dependence between INSN1 and INSN2 is represented by
18580 the third parameter DEP_LINK. The fourth parameter COST is the
18581 cost of the dependence, and the fifth parameter DISTANCE is the
18582 distance in cycles between the two insns. The hook returns `true'
18583 if considering the distance between the two insns the dependence
18584 between them is considered costly by the target, and `false'
18587 Defining this hook can be useful in multiple-issue out-of-order
18588 machines, where (a) it's practically hopeless to predict the
18589 actual data/resource delays, however: (b) there's a better chance
18590 to predict the actual grouping that will be formed, and (c)
18591 correctly emulating the grouping can be very important. In such
18592 targets one may want to allow issuing dependent insns closer to
18593 one another - i.e, closer than the dependence distance; however,
18594 not in cases of "costly dependences", which this hooks allows to
18597 Macros in the following table are generated by the program `genattr'
18598 and can be useful for writing the hooks.
18600 - Macro: TRADITIONAL_PIPELINE_INTERFACE
18601 The macro definition is generated if there is a traditional
18602 pipeline description in `.md' file. You should also remember that
18603 to simplify the insn scheduler sources an empty traditional
18604 pipeline description interface is generated even if there is no a
18605 traditional pipeline description in the `.md' file. The macro can
18606 be used to distinguish the two types of the traditional interface.
18608 - Macro: DFA_PIPELINE_INTERFACE
18609 The macro definition is generated if there is an automaton pipeline
18610 description in `.md' file. You should also remember that to
18611 simplify the insn scheduler sources an empty automaton pipeline
18612 description interface is generated even if there is no an automaton
18613 pipeline description in the `.md' file. The macro can be used to
18614 distinguish the two types of the automaton interface.
18616 - Macro: MAX_DFA_ISSUE_RATE
18617 The macro definition is generated in the automaton based pipeline
18618 description interface. Its value is calculated from the automaton
18619 based pipeline description and is equal to maximal number of all
18620 insns described in constructions `define_insn_reservation' which
18621 can be issued on the same processor cycle.
18624 File: gccint.info, Node: Sections, Next: PIC, Prev: Scheduling, Up: Target Macros
18626 Dividing the Output into Sections (Texts, Data, ...)
18627 ====================================================
18629 An object file is divided into sections containing different types of
18630 data. In the most common case, there are three sections: the "text
18631 section", which holds instructions and read-only data; the "data
18632 section", which holds initialized writable data; and the "bss section",
18633 which holds uninitialized data. Some systems have other kinds of
18636 The compiler must tell the assembler when to switch sections. These
18637 macros control what commands to output to tell the assembler this. You
18638 can also define additional sections.
18640 - Macro: TEXT_SECTION_ASM_OP
18641 A C expression whose value is a string, including spacing,
18642 containing the assembler operation that should precede
18643 instructions and read-only data. Normally `"\t.text"' is right.
18645 - Macro: HOT_TEXT_SECTION_NAME
18646 If defined, a C string constant for the name of the section
18647 containing most frequently executed functions of the program. If
18648 not defined, GCC will provide a default definition if the target
18649 supports named sections.
18651 - Macro: UNLIKELY_EXECUTED_TEXT_SECTION_NAME
18652 If defined, a C string constant for the name of the section
18653 containing unlikely executed functions in the program.
18655 - Macro: DATA_SECTION_ASM_OP
18656 A C expression whose value is a string, including spacing,
18657 containing the assembler operation to identify the following data
18658 as writable initialized data. Normally `"\t.data"' is right.
18660 - Macro: READONLY_DATA_SECTION_ASM_OP
18661 A C expression whose value is a string, including spacing,
18662 containing the assembler operation to identify the following data
18663 as read-only initialized data.
18665 - Macro: READONLY_DATA_SECTION
18666 A macro naming a function to call to switch to the proper section
18667 for read-only data. The default is to use
18668 `READONLY_DATA_SECTION_ASM_OP' if defined, else fall back to
18671 The most common definition will be `data_section', if the target
18672 does not have a special read-only data section, and does not put
18673 data in the text section.
18675 - Macro: SHARED_SECTION_ASM_OP
18676 If defined, a C expression whose value is a string, including
18677 spacing, containing the assembler operation to identify the
18678 following data as shared data. If not defined,
18679 `DATA_SECTION_ASM_OP' will be used.
18681 - Macro: BSS_SECTION_ASM_OP
18682 If defined, a C expression whose value is a string, including
18683 spacing, containing the assembler operation to identify the
18684 following data as uninitialized global data. If not defined, and
18685 neither `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
18686 uninitialized global data will be output in the data section if
18687 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
18690 - Macro: INIT_SECTION_ASM_OP
18691 If defined, a C expression whose value is a string, including
18692 spacing, containing the assembler operation to identify the
18693 following data as initialization code. If not defined, GCC will
18694 assume such a section does not exist.
18696 - Macro: FINI_SECTION_ASM_OP
18697 If defined, a C expression whose value is a string, including
18698 spacing, containing the assembler operation to identify the
18699 following data as finalization code. If not defined, GCC will
18700 assume such a section does not exist.
18702 - Macro: CRT_CALL_STATIC_FUNCTION (SECTION_OP, FUNCTION)
18703 If defined, an ASM statement that switches to a different section
18704 via SECTION_OP, calls FUNCTION, and switches back to the text
18705 section. This is used in `crtstuff.c' if `INIT_SECTION_ASM_OP' or
18706 `FINI_SECTION_ASM_OP' to calls to initialization and finalization
18707 functions from the init and fini sections. By default, this macro
18708 uses a simple function call. Some ports need hand-crafted
18709 assembly code to avoid dependencies on registers initialized in
18710 the function prologue or to ensure that constant pools don't end
18711 up too far way in the text section.
18713 - Macro: FORCE_CODE_SECTION_ALIGN
18714 If defined, an ASM statement that aligns a code section to some
18715 arbitrary boundary. This is used to force all fragments of the
18716 `.init' and `.fini' sections to have to same alignment and thus
18717 prevent the linker from having to add any padding.
18719 - Macro: EXTRA_SECTIONS
18720 A list of names for sections other than the standard two, which are
18721 `in_text' and `in_data'. You need not define this macro on a
18722 system with no other sections (that GCC needs to use).
18724 - Macro: EXTRA_SECTION_FUNCTIONS
18725 One or more functions to be defined in `varasm.c'. These
18726 functions should do jobs analogous to those of `text_section' and
18727 `data_section', for your additional sections. Do not define this
18728 macro if you do not define `EXTRA_SECTIONS'.
18730 - Macro: JUMP_TABLES_IN_TEXT_SECTION
18731 Define this macro to be an expression with a nonzero value if jump
18732 tables (for `tablejump' insns) should be output in the text
18733 section, along with the assembler instructions. Otherwise, the
18734 readonly data section is used.
18736 This macro is irrelevant if there is no separate readonly data
18739 - Target Hook: void TARGET_ASM_SELECT_SECTION (tree EXP, int RELOC,
18740 unsigned HOST_WIDE_INT ALIGN)
18741 Switches to the appropriate section for output of EXP. You can
18742 assume that EXP is either a `VAR_DECL' node or a constant of some
18743 sort. RELOC indicates whether the initial value of EXP requires
18744 link-time relocations. Bit 0 is set when variable contains local
18745 relocations only, while bit 1 is set for global relocations.
18746 Select the section by calling `data_section' or one of the
18747 alternatives for other sections. ALIGN is the constant alignment
18750 The default version of this function takes care of putting
18751 read-only variables in `readonly_data_section'.
18753 - Target Hook: void TARGET_ASM_UNIQUE_SECTION (tree DECL, int RELOC)
18754 Build up a unique section name, expressed as a `STRING_CST' node,
18755 and assign it to `DECL_SECTION_NAME (DECL)'. As with
18756 `TARGET_ASM_SELECT_SECTION', RELOC indicates whether the initial
18757 value of EXP requires link-time relocations.
18759 The default version of this function appends the symbol name to the
18760 ELF section name that would normally be used for the symbol. For
18761 example, the function `foo' would be placed in `.text.foo'.
18762 Whatever the actual target object format, this is often good
18765 - Target Hook: void TARGET_ASM_SELECT_RTX_SECTION (enum machine_mode
18766 MODE, rtx X, unsigned HOST_WIDE_INT ALIGN)
18767 Switches to the appropriate section for output of constant pool
18768 entry X in MODE. You can assume that X is some kind of constant
18769 in RTL. The argument MODE is redundant except in the case of a
18770 `const_int' rtx. Select the section by calling
18771 `readonly_data_section' or one of the alternatives for other
18772 sections. ALIGN is the constant alignment in bits.
18774 The default version of this function takes care of putting symbolic
18775 constants in `flag_pic' mode in `data_section' and everything else
18776 in `readonly_data_section'.
18778 - Target Hook: void TARGET_ENCODE_SECTION_INFO (tree DECL, rtx RTL,
18780 Define this hook if references to a symbol or a constant must be
18781 treated differently depending on something about the variable or
18782 function named by the symbol (such as what section it is in).
18784 The hook is executed immediately after rtl has been created for
18785 DECL, which may be a variable or function declaration or an entry
18786 in the constant pool. In either case, RTL is the rtl in question.
18787 Do _not_ use `DECL_RTL (DECL)' in this hook; that field may not
18788 have been initialized yet.
18790 In the case of a constant, it is safe to assume that the rtl is a
18791 `mem' whose address is a `symbol_ref'. Most decls will also have
18792 this form, but that is not guaranteed. Global register variables,
18793 for instance, will have a `reg' for their rtl. (Normally the
18794 right thing to do with such unusual rtl is leave it alone.)
18796 The NEW_DECL_P argument will be true if this is the first time
18797 that `TARGET_ENCODE_SECTION_INFO' has been invoked on this decl.
18798 It will be false for subsequent invocations, which will happen for
18799 duplicate declarations. Whether or not anything must be done for
18800 the duplicate declaration depends on whether the hook examines
18801 `DECL_ATTRIBUTES'. NEW_DECL_P is always true when the hook is
18802 called for a constant.
18804 The usual thing for this hook to do is to record flags in the
18805 `symbol_ref', using `SYMBOL_REF_FLAG' or `SYMBOL_REF_FLAGS'.
18806 Historically, the name string was modified if it was necessary to
18807 encode more than one bit of information, but this practice is now
18808 discouraged; use `SYMBOL_REF_FLAGS'.
18810 The default definition of this hook, `default_encode_section_info'
18811 in `varasm.c', sets a number of commonly-useful bits in
18812 `SYMBOL_REF_FLAGS'. Check whether the default does what you need
18813 before overriding it.
18815 - Target Hook: const char *TARGET_STRIP_NAME_ENCODING (const char
18817 Decode NAME and return the real name part, sans the characters
18818 that `TARGET_ENCODE_SECTION_INFO' may have added.
18820 - Target Hook: bool TARGET_IN_SMALL_DATA_P (tree EXP)
18821 Returns true if EXP should be placed into a "small data" section.
18822 The default version of this hook always returns false.
18824 - Variable: Target Hook bool TARGET_HAVE_SRODATA_SECTION
18825 Contains the value true if the target places read-only "small
18826 data" into a separate section. The default value is false.
18828 - Target Hook: bool TARGET_BINDS_LOCAL_P (tree EXP)
18829 Returns true if EXP names an object for which name resolution
18830 rules must resolve to the current "module" (dynamic shared library
18831 or executable image).
18833 The default version of this hook implements the name resolution
18834 rules for ELF, which has a looser model of global name binding
18835 than other currently supported object file formats.
18837 - Variable: Target Hook bool TARGET_HAVE_TLS
18838 Contains the value true if the target supports thread-local
18839 storage. The default value is false.
18842 File: gccint.info, Node: PIC, Next: Assembler Format, Prev: Sections, Up: Target Macros
18844 Position Independent Code
18845 =========================
18847 This section describes macros that help implement generation of
18848 position independent code. Simply defining these macros is not enough
18849 to generate valid PIC; you must also add support to the macros
18850 `GO_IF_LEGITIMATE_ADDRESS' and `PRINT_OPERAND_ADDRESS', as well as
18851 `LEGITIMIZE_ADDRESS'. You must modify the definition of `movsi' to do
18852 something appropriate when the source operand contains a symbolic
18853 address. You may also need to alter the handling of switch statements
18854 so that they use relative addresses.
18856 - Macro: PIC_OFFSET_TABLE_REGNUM
18857 The register number of the register used to address a table of
18858 static data addresses in memory. In some cases this register is
18859 defined by a processor's "application binary interface" (ABI).
18860 When this macro is defined, RTL is generated for this register
18861 once, as with the stack pointer and frame pointer registers. If
18862 this macro is not defined, it is up to the machine-dependent files
18863 to allocate such a register (if necessary). Note that this
18864 register must be fixed when in use (e.g. when `flag_pic' is true).
18866 - Macro: PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
18867 Define this macro if the register defined by
18868 `PIC_OFFSET_TABLE_REGNUM' is clobbered by calls. Do not define
18869 this macro if `PIC_OFFSET_TABLE_REGNUM' is not defined.
18871 - Macro: FINALIZE_PIC
18872 By generating position-independent code, when two different
18873 programs (A and B) share a common library (libC.a), the text of
18874 the library can be shared whether or not the library is linked at
18875 the same address for both programs. In some of these
18876 environments, position-independent code requires not only the use
18877 of different addressing modes, but also special code to enable the
18878 use of these addressing modes.
18880 The `FINALIZE_PIC' macro serves as a hook to emit these special
18881 codes once the function is being compiled into assembly code, but
18882 not before. (It is not done before, because in the case of
18883 compiling an inline function, it would lead to multiple PIC
18884 prologues being included in functions which used inline functions
18885 and were compiled to assembly language.)
18887 - Macro: LEGITIMATE_PIC_OPERAND_P (X)
18888 A C expression that is nonzero if X is a legitimate immediate
18889 operand on the target machine when generating position independent
18890 code. You can assume that X satisfies `CONSTANT_P', so you need
18891 not check this. You can also assume FLAG_PIC is true, so you need
18892 not check it either. You need not define this macro if all
18893 constants (including `SYMBOL_REF') can be immediate operands when
18894 generating position independent code.
18897 File: gccint.info, Node: Assembler Format, Next: Debugging Info, Prev: PIC, Up: Target Macros
18899 Defining the Output Assembler Language
18900 ======================================
18902 This section describes macros whose principal purpose is to describe
18903 how to write instructions in assembler language--rather than what the
18908 * File Framework:: Structural information for the assembler file.
18909 * Data Output:: Output of constants (numbers, strings, addresses).
18910 * Uninitialized Data:: Output of uninitialized variables.
18911 * Label Output:: Output and generation of labels.
18912 * Initialization:: General principles of initialization
18913 and termination routines.
18914 * Macros for Initialization::
18915 Specific macros that control the handling of
18916 initialization and termination routines.
18917 * Instruction Output:: Output of actual instructions.
18918 * Dispatch Tables:: Output of jump tables.
18919 * Exception Region Output:: Output of exception region code.
18920 * Alignment Output:: Pseudo ops for alignment and skipping data.
18923 File: gccint.info, Node: File Framework, Next: Data Output, Up: Assembler Format
18925 The Overall Framework of an Assembler File
18926 ------------------------------------------
18928 This describes the overall framework of an assembly file.
18930 - Target Hook: void TARGET_ASM_FILE_START ()
18931 Output to `asm_out_file' any text which the assembler expects to
18932 find at the beginning of a file. The default behavior is
18933 controlled by two flags, documented below. Unless your target's
18934 assembler is quite unusual, if you override the default, you
18935 should call `default_file_start' at some point in your target
18936 hook. This lets other target files rely on these variables.
18938 - Target Hook: bool TARGET_ASM_FILE_START_APP_OFF
18939 If this flag is true, the text of the macro `ASM_APP_OFF' will be
18940 printed as the very first line in the assembly file, unless
18941 `-fverbose-asm' is in effect. (If that macro has been defined to
18942 the empty string, this variable has no effect.) With the normal
18943 definition of `ASM_APP_OFF', the effect is to notify the GNU
18944 assembler that it need not bother stripping comments or extra
18945 whitespace from its input. This allows it to work a bit faster.
18947 The default is false. You should not set it to true unless you
18948 have verified that your port does not generate any extra
18949 whitespace or comments that will cause GAS to issue errors in
18952 - Target Hook: bool TARGET_ASM_FILE_START_FILE_DIRECTIVE
18953 If this flag is true, `output_file_directive' will be called for
18954 the primary source file, immediately after printing `ASM_APP_OFF'
18955 (if that is enabled). Most ELF assemblers expect this to be done.
18956 The default is false.
18958 - Target Hook: void TARGET_ASM_FILE_END ()
18959 Output to `asm_out_file' any text which the assembler expects to
18960 find at the end of a file. The default is to output nothing.
18962 - Function: void file_end_indicate_exec_stack ()
18963 Some systems use a common convention, the `.note.GNU-stack'
18964 special section, to indicate whether or not an object file relies
18965 on the stack being executable. If your system uses this
18966 convention, you should define `TARGET_ASM_FILE_END' to this
18967 function. If you need to do other things in that hook, have your
18968 hook function call this function.
18970 - Macro: ASM_COMMENT_START
18971 A C string constant describing how to begin a comment in the target
18972 assembler language. The compiler assumes that the comment will
18973 end at the end of the line.
18975 - Macro: ASM_APP_ON
18976 A C string constant for text to be output before each `asm'
18977 statement or group of consecutive ones. Normally this is
18978 `"#APP"', which is a comment that has no effect on most assemblers
18979 but tells the GNU assembler that it must check the lines that
18980 follow for all valid assembler constructs.
18982 - Macro: ASM_APP_OFF
18983 A C string constant for text to be output after each `asm'
18984 statement or group of consecutive ones. Normally this is
18985 `"#NO_APP"', which tells the GNU assembler to resume making the
18986 time-saving assumptions that are valid for ordinary compiler
18989 - Macro: ASM_OUTPUT_SOURCE_FILENAME (STREAM, NAME)
18990 A C statement to output COFF information or DWARF debugging
18991 information which indicates that filename NAME is the current
18992 source file to the stdio stream STREAM.
18994 This macro need not be defined if the standard form of output for
18995 the file format in use is appropriate.
18997 - Macro: OUTPUT_QUOTED_STRING (STREAM, STRING)
18998 A C statement to output the string STRING to the stdio stream
18999 STREAM. If you do not call the function `output_quoted_string' in
19000 your config files, GCC will only call it to output filenames to
19001 the assembler source. So you can use it to canonicalize the format
19002 of the filename using this macro.
19004 - Macro: ASM_OUTPUT_SOURCE_LINE (STREAM, LINE, COUNTER)
19005 A C statement to output DBX or SDB debugging information before
19006 code for line number LINE of the current source file to the stdio
19007 stream STREAM. COUNTER is the number of time the macro was
19008 invoked, including the current invocation; it is intended to
19009 generate unique labels in the assembly output.
19011 This macro need not be defined if the standard form of debugging
19012 information for the debugger in use is appropriate.
19014 - Macro: ASM_OUTPUT_IDENT (STREAM, STRING)
19015 A C statement to output something to the assembler file to handle a
19016 `#ident' directive containing the text STRING. If this macro is
19017 not defined, nothing is output for a `#ident' directive.
19019 - Target Hook: void TARGET_ASM_NAMED_SECTION (const char *NAME,
19020 unsigned int FLAGS, unsigned int ALIGN)
19021 Output assembly directives to switch to section NAME. The section
19022 should have attributes as specified by FLAGS, which is a bit mask
19023 of the `SECTION_*' flags defined in `output.h'. If ALIGN is
19024 nonzero, it contains an alignment in bytes to be used for the
19025 section, otherwise some target default should be used. Only
19026 targets that must specify an alignment within the section
19027 directive need pay attention to ALIGN - we will still use
19028 `ASM_OUTPUT_ALIGN'.
19030 - Target Hook: bool TARGET_HAVE_NAMED_SECTIONS
19031 This flag is true if the target supports
19032 `TARGET_ASM_NAMED_SECTION'.
19034 - Target Hook: unsigned int TARGET_SECTION_TYPE_FLAGS (tree DECL,
19035 const char *NAME, int RELOC)
19036 Choose a set of section attributes for use by
19037 `TARGET_ASM_NAMED_SECTION' based on a variable or function decl, a
19038 section name, and whether or not the declaration's initializer may
19039 contain runtime relocations. DECL may be null, in which case
19040 read-write data should be assumed.
19042 The default version if this function handles choosing code vs data,
19043 read-only vs read-write data, and `flag_pic'. You should only
19044 need to override this if your target has special flags that might
19045 be set via `__attribute__'.
19048 File: gccint.info, Node: Data Output, Next: Uninitialized Data, Prev: File Framework, Up: Assembler Format
19053 - Target Hook: const char * TARGET_ASM_BYTE_OP
19054 - Target Hook: const char * TARGET_ASM_ALIGNED_HI_OP
19055 - Target Hook: const char * TARGET_ASM_ALIGNED_SI_OP
19056 - Target Hook: const char * TARGET_ASM_ALIGNED_DI_OP
19057 - Target Hook: const char * TARGET_ASM_ALIGNED_TI_OP
19058 - Target Hook: const char * TARGET_ASM_UNALIGNED_HI_OP
19059 - Target Hook: const char * TARGET_ASM_UNALIGNED_SI_OP
19060 - Target Hook: const char * TARGET_ASM_UNALIGNED_DI_OP
19061 - Target Hook: const char * TARGET_ASM_UNALIGNED_TI_OP
19062 These hooks specify assembly directives for creating certain kinds
19063 of integer object. The `TARGET_ASM_BYTE_OP' directive creates a
19064 byte-sized object, the `TARGET_ASM_ALIGNED_HI_OP' one creates an
19065 aligned two-byte object, and so on. Any of the hooks may be
19066 `NULL', indicating that no suitable directive is available.
19068 The compiler will print these strings at the start of a new line,
19069 followed immediately by the object's initial value. In most cases,
19070 the string should contain a tab, a pseudo-op, and then another tab.
19072 - Target Hook: bool TARGET_ASM_INTEGER (rtx X, unsigned int SIZE, int
19074 The `assemble_integer' function uses this hook to output an
19075 integer object. X is the object's value, SIZE is its size in
19076 bytes and ALIGNED_P indicates whether it is aligned. The function
19077 should return `true' if it was able to output the object. If it
19078 returns false, `assemble_integer' will try to split the object
19079 into smaller parts.
19081 The default implementation of this hook will use the
19082 `TARGET_ASM_BYTE_OP' family of strings, returning `false' when the
19083 relevant string is `NULL'.
19085 - Macro: OUTPUT_ADDR_CONST_EXTRA (STREAM, X, FAIL)
19086 A C statement to recognize RTX patterns that `output_addr_const'
19087 can't deal with, and output assembly code to STREAM corresponding
19088 to the pattern X. This may be used to allow machine-dependent
19089 `UNSPEC's to appear within constants.
19091 If `OUTPUT_ADDR_CONST_EXTRA' fails to recognize a pattern, it must
19092 `goto fail', so that a standard error message is printed. If it
19093 prints an error message itself, by calling, for example,
19094 `output_operand_lossage', it may just complete normally.
19096 - Macro: ASM_OUTPUT_ASCII (STREAM, PTR, LEN)
19097 A C statement to output to the stdio stream STREAM an assembler
19098 instruction to assemble a string constant containing the LEN bytes
19099 at PTR. PTR will be a C expression of type `char *' and LEN a C
19100 expression of type `int'.
19102 If the assembler has a `.ascii' pseudo-op as found in the Berkeley
19103 Unix assembler, do not define the macro `ASM_OUTPUT_ASCII'.
19105 - Macro: ASM_OUTPUT_FDESC (STREAM, DECL, N)
19106 A C statement to output word N of a function descriptor for DECL.
19107 This must be defined if `TARGET_VTABLE_USES_DESCRIPTORS' is
19108 defined, and is otherwise unused.
19110 - Macro: CONSTANT_POOL_BEFORE_FUNCTION
19111 You may define this macro as a C expression. You should define the
19112 expression to have a nonzero value if GCC should output the
19113 constant pool for a function before the code for the function, or
19114 a zero value if GCC should output the constant pool after the
19115 function. If you do not define this macro, the usual case, GCC
19116 will output the constant pool before the function.
19118 - Macro: ASM_OUTPUT_POOL_PROLOGUE (FILE, FUNNAME, FUNDECL, SIZE)
19119 A C statement to output assembler commands to define the start of
19120 the constant pool for a function. FUNNAME is a string giving the
19121 name of the function. Should the return type of the function be
19122 required, it can be obtained via FUNDECL. SIZE is the size, in
19123 bytes, of the constant pool that will be written immediately after
19126 If no constant-pool prefix is required, the usual case, this macro
19127 need not be defined.
19129 - Macro: ASM_OUTPUT_SPECIAL_POOL_ENTRY (FILE, X, MODE, ALIGN, LABELNO,
19131 A C statement (with or without semicolon) to output a constant in
19132 the constant pool, if it needs special treatment. (This macro
19133 need not do anything for RTL expressions that can be output
19136 The argument FILE is the standard I/O stream to output the
19137 assembler code on. X is the RTL expression for the constant to
19138 output, and MODE is the machine mode (in case X is a `const_int').
19139 ALIGN is the required alignment for the value X; you should
19140 output an assembler directive to force this much alignment.
19142 The argument LABELNO is a number to use in an internal label for
19143 the address of this pool entry. The definition of this macro is
19144 responsible for outputting the label definition at the proper
19145 place. Here is how to do this:
19147 `(*targetm.asm_out.internal_label)' (FILE, "LC", LABELNO);
19149 When you output a pool entry specially, you should end with a
19150 `goto' to the label JUMPTO. This will prevent the same pool entry
19151 from being output a second time in the usual manner.
19153 You need not define this macro if it would do nothing.
19155 - Macro: ASM_OUTPUT_POOL_EPILOGUE (FILE FUNNAME FUNDECL SIZE)
19156 A C statement to output assembler commands to at the end of the
19157 constant pool for a function. FUNNAME is a string giving the name
19158 of the function. Should the return type of the function be
19159 required, you can obtain it via FUNDECL. SIZE is the size, in
19160 bytes, of the constant pool that GCC wrote immediately before this
19163 If no constant-pool epilogue is required, the usual case, you need
19164 not define this macro.
19166 - Macro: IS_ASM_LOGICAL_LINE_SEPARATOR (C)
19167 Define this macro as a C expression which is nonzero if C is used
19168 as a logical line separator by the assembler.
19170 If you do not define this macro, the default is that only the
19171 character `;' is treated as a logical line separator.
19173 - Target Hook: const char * TARGET_ASM_OPEN_PAREN
19174 - Target Hook: const char * TARGET_ASM_CLOSE_PAREN
19175 These target hooks are C string constants, describing the syntax
19176 in the assembler for grouping arithmetic expressions. If not
19177 overridden, they default to normal parentheses, which is correct
19178 for most assemblers.
19180 These macros are provided by `real.h' for writing the definitions of
19181 `ASM_OUTPUT_DOUBLE' and the like:
19183 - Macro: REAL_VALUE_TO_TARGET_SINGLE (X, L)
19184 - Macro: REAL_VALUE_TO_TARGET_DOUBLE (X, L)
19185 - Macro: REAL_VALUE_TO_TARGET_LONG_DOUBLE (X, L)
19186 These translate X, of type `REAL_VALUE_TYPE', to the target's
19187 floating point representation, and store its bit pattern in the
19188 variable L. For `REAL_VALUE_TO_TARGET_SINGLE', this variable
19189 should be a simple `long int'. For the others, it should be an
19190 array of `long int'. The number of elements in this array is
19191 determined by the size of the desired target floating point data
19192 type: 32 bits of it go in each `long int' array element. Each
19193 array element holds 32 bits of the result, even if `long int' is
19194 wider than 32 bits on the host machine.
19196 The array element values are designed so that you can print them
19197 out using `fprintf' in the order they should appear in the target
19201 File: gccint.info, Node: Uninitialized Data, Next: Label Output, Prev: Data Output, Up: Assembler Format
19203 Output of Uninitialized Variables
19204 ---------------------------------
19206 Each of the macros in this section is used to do the whole job of
19207 outputting a single uninitialized variable.
19209 - Macro: ASM_OUTPUT_COMMON (STREAM, NAME, SIZE, ROUNDED)
19210 A C statement (sans semicolon) to output to the stdio stream
19211 STREAM the assembler definition of a common-label named NAME whose
19212 size is SIZE bytes. The variable ROUNDED is the size rounded up
19213 to whatever alignment the caller wants.
19215 Use the expression `assemble_name (STREAM, NAME)' to output the
19216 name itself; before and after that, output the additional
19217 assembler syntax for defining the name, and a newline.
19219 This macro controls how the assembler definitions of uninitialized
19220 common global variables are output.
19222 - Macro: ASM_OUTPUT_ALIGNED_COMMON (STREAM, NAME, SIZE, ALIGNMENT)
19223 Like `ASM_OUTPUT_COMMON' except takes the required alignment as a
19224 separate, explicit argument. If you define this macro, it is used
19225 in place of `ASM_OUTPUT_COMMON', and gives you more flexibility in
19226 handling the required alignment of the variable. The alignment is
19227 specified as the number of bits.
19229 - Macro: ASM_OUTPUT_ALIGNED_DECL_COMMON (STREAM, DECL, NAME, SIZE,
19231 Like `ASM_OUTPUT_ALIGNED_COMMON' except that DECL of the variable
19232 to be output, if there is one, or `NULL_TREE' if there is no
19233 corresponding variable. If you define this macro, GCC will use it
19234 in place of both `ASM_OUTPUT_COMMON' and
19235 `ASM_OUTPUT_ALIGNED_COMMON'. Define this macro when you need to
19236 see the variable's decl in order to chose what to output.
19238 - Macro: ASM_OUTPUT_SHARED_COMMON (STREAM, NAME, SIZE, ROUNDED)
19239 If defined, it is similar to `ASM_OUTPUT_COMMON', except that it
19240 is used when NAME is shared. If not defined, `ASM_OUTPUT_COMMON'
19243 - Macro: ASM_OUTPUT_BSS (STREAM, DECL, NAME, SIZE, ROUNDED)
19244 A C statement (sans semicolon) to output to the stdio stream
19245 STREAM the assembler definition of uninitialized global DECL named
19246 NAME whose size is SIZE bytes. The variable ROUNDED is the size
19247 rounded up to whatever alignment the caller wants.
19249 Try to use function `asm_output_bss' defined in `varasm.c' when
19250 defining this macro. If unable, use the expression `assemble_name
19251 (STREAM, NAME)' to output the name itself; before and after that,
19252 output the additional assembler syntax for defining the name, and
19255 This macro controls how the assembler definitions of uninitialized
19256 global variables are output. This macro exists to properly
19257 support languages like C++ which do not have `common' data.
19258 However, this macro currently is not defined for all targets. If
19259 this macro and `ASM_OUTPUT_ALIGNED_BSS' are not defined then
19260 `ASM_OUTPUT_COMMON' or `ASM_OUTPUT_ALIGNED_COMMON' or
19261 `ASM_OUTPUT_ALIGNED_DECL_COMMON' is used.
19263 - Macro: ASM_OUTPUT_ALIGNED_BSS (STREAM, DECL, NAME, SIZE, ALIGNMENT)
19264 Like `ASM_OUTPUT_BSS' except takes the required alignment as a
19265 separate, explicit argument. If you define this macro, it is used
19266 in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
19267 handling the required alignment of the variable. The alignment is
19268 specified as the number of bits.
19270 Try to use function `asm_output_aligned_bss' defined in file
19271 `varasm.c' when defining this macro.
19273 - Macro: ASM_OUTPUT_SHARED_BSS (STREAM, DECL, NAME, SIZE, ROUNDED)
19274 If defined, it is similar to `ASM_OUTPUT_BSS', except that it is
19275 used when NAME is shared. If not defined, `ASM_OUTPUT_BSS' will
19278 - Macro: ASM_OUTPUT_LOCAL (STREAM, NAME, SIZE, ROUNDED)
19279 A C statement (sans semicolon) to output to the stdio stream
19280 STREAM the assembler definition of a local-common-label named NAME
19281 whose size is SIZE bytes. The variable ROUNDED is the size
19282 rounded up to whatever alignment the caller wants.
19284 Use the expression `assemble_name (STREAM, NAME)' to output the
19285 name itself; before and after that, output the additional
19286 assembler syntax for defining the name, and a newline.
19288 This macro controls how the assembler definitions of uninitialized
19289 static variables are output.
19291 - Macro: ASM_OUTPUT_ALIGNED_LOCAL (STREAM, NAME, SIZE, ALIGNMENT)
19292 Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a
19293 separate, explicit argument. If you define this macro, it is used
19294 in place of `ASM_OUTPUT_LOCAL', and gives you more flexibility in
19295 handling the required alignment of the variable. The alignment is
19296 specified as the number of bits.
19298 - Macro: ASM_OUTPUT_ALIGNED_DECL_LOCAL (STREAM, DECL, NAME, SIZE,
19300 Like `ASM_OUTPUT_ALIGNED_DECL' except that DECL of the variable to
19301 be output, if there is one, or `NULL_TREE' if there is no
19302 corresponding variable. If you define this macro, GCC will use it
19303 in place of both `ASM_OUTPUT_DECL' and `ASM_OUTPUT_ALIGNED_DECL'.
19304 Define this macro when you need to see the variable's decl in
19305 order to chose what to output.
19307 - Macro: ASM_OUTPUT_SHARED_LOCAL (STREAM, NAME, SIZE, ROUNDED)
19308 If defined, it is similar to `ASM_OUTPUT_LOCAL', except that it is
19309 used when NAME is shared. If not defined, `ASM_OUTPUT_LOCAL' will
19313 File: gccint.info, Node: Label Output, Next: Initialization, Prev: Uninitialized Data, Up: Assembler Format
19315 Output and Generation of Labels
19316 -------------------------------
19318 This is about outputting labels.
19320 - Macro: ASM_OUTPUT_LABEL (STREAM, NAME)
19321 A C statement (sans semicolon) to output to the stdio stream
19322 STREAM the assembler definition of a label named NAME. Use the
19323 expression `assemble_name (STREAM, NAME)' to output the name
19324 itself; before and after that, output the additional assembler
19325 syntax for defining the name, and a newline. A default definition
19326 of this macro is provided which is correct for most systems.
19328 - Macro: SIZE_ASM_OP
19329 A C string containing the appropriate assembler directive to
19330 specify the size of a symbol, without any arguments. On systems
19331 that use ELF, the default (in `config/elfos.h') is `"\t.size\t"';
19332 on other systems, the default is not to define this macro.
19334 Define this macro only if it is correct to use the default
19335 definitions of `ASM_OUTPUT_SIZE_DIRECTIVE' and
19336 `ASM_OUTPUT_MEASURED_SIZE' for your system. If you need your own
19337 custom definitions of those macros, or if you do not need explicit
19338 symbol sizes at all, do not define this macro.
19340 - Macro: ASM_OUTPUT_SIZE_DIRECTIVE (STREAM, NAME, SIZE)
19341 A C statement (sans semicolon) to output to the stdio stream
19342 STREAM a directive telling the assembler that the size of the
19343 symbol NAME is SIZE. SIZE is a `HOST_WIDE_INT'. If you define
19344 `SIZE_ASM_OP', a default definition of this macro is provided.
19346 - Macro: ASM_OUTPUT_MEASURED_SIZE (STREAM, NAME)
19347 A C statement (sans semicolon) to output to the stdio stream
19348 STREAM a directive telling the assembler to calculate the size of
19349 the symbol NAME by subtracting its address from the current
19352 If you define `SIZE_ASM_OP', a default definition of this macro is
19353 provided. The default assumes that the assembler recognizes a
19354 special `.' symbol as referring to the current address, and can
19355 calculate the difference between this and another symbol. If your
19356 assembler does not recognize `.' or cannot do calculations with
19357 it, you will need to redefine `ASM_OUTPUT_MEASURED_SIZE' to use
19358 some other technique.
19360 - Macro: TYPE_ASM_OP
19361 A C string containing the appropriate assembler directive to
19362 specify the type of a symbol, without any arguments. On systems
19363 that use ELF, the default (in `config/elfos.h') is `"\t.type\t"';
19364 on other systems, the default is not to define this macro.
19366 Define this macro only if it is correct to use the default
19367 definition of `ASM_OUTPUT_TYPE_DIRECTIVE' for your system. If you
19368 need your own custom definition of this macro, or if you do not
19369 need explicit symbol types at all, do not define this macro.
19371 - Macro: TYPE_OPERAND_FMT
19372 A C string which specifies (using `printf' syntax) the format of
19373 the second operand to `TYPE_ASM_OP'. On systems that use ELF, the
19374 default (in `config/elfos.h') is `"@%s"'; on other systems, the
19375 default is not to define this macro.
19377 Define this macro only if it is correct to use the default
19378 definition of `ASM_OUTPUT_TYPE_DIRECTIVE' for your system. If you
19379 need your own custom definition of this macro, or if you do not
19380 need explicit symbol types at all, do not define this macro.
19382 - Macro: ASM_OUTPUT_TYPE_DIRECTIVE (STREAM, TYPE)
19383 A C statement (sans semicolon) to output to the stdio stream
19384 STREAM a directive telling the assembler that the type of the
19385 symbol NAME is TYPE. TYPE is a C string; currently, that string
19386 is always either `"function"' or `"object"', but you should not
19389 If you define `TYPE_ASM_OP' and `TYPE_OPERAND_FMT', a default
19390 definition of this macro is provided.
19392 - Macro: ASM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL)
19393 A C statement (sans semicolon) to output to the stdio stream
19394 STREAM any text necessary for declaring the name NAME of a
19395 function which is being defined. This macro is responsible for
19396 outputting the label definition (perhaps using
19397 `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL'
19398 tree node representing the function.
19400 If this macro is not defined, then the function name is defined in
19401 the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
19403 You may wish to use `ASM_OUTPUT_TYPE_DIRECTIVE' in the definition
19406 - Macro: ASM_DECLARE_FUNCTION_SIZE (STREAM, NAME, DECL)
19407 A C statement (sans semicolon) to output to the stdio stream
19408 STREAM any text necessary for declaring the size of a function
19409 which is being defined. The argument NAME is the name of the
19410 function. The argument DECL is the `FUNCTION_DECL' tree node
19411 representing the function.
19413 If this macro is not defined, then the function size is not
19416 You may wish to use `ASM_OUTPUT_MEASURED_SIZE' in the definition
19419 - Macro: ASM_DECLARE_OBJECT_NAME (STREAM, NAME, DECL)
19420 A C statement (sans semicolon) to output to the stdio stream
19421 STREAM any text necessary for declaring the name NAME of an
19422 initialized variable which is being defined. This macro must
19423 output the label definition (perhaps using `ASM_OUTPUT_LABEL').
19424 The argument DECL is the `VAR_DECL' tree node representing the
19427 If this macro is not defined, then the variable name is defined in
19428 the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
19430 You may wish to use `ASM_OUTPUT_TYPE_DIRECTIVE' and/or
19431 `ASM_OUTPUT_SIZE_DIRECTIVE' in the definition of this macro.
19433 - Macro: ASM_DECLARE_CONSTANT_NAME (STREAM, NAME, EXP, SIZE)
19434 A C statement (sans semicolon) to output to the stdio stream
19435 STREAM any text necessary for declaring the name NAME of a
19436 constant which is being defined. This macro is responsible for
19437 outputting the label definition (perhaps using
19438 `ASM_OUTPUT_LABEL'). The argument EXP is the value of the
19439 constant, and SIZE is the size of the constant in bytes. NAME
19440 will be an internal label.
19442 If this macro is not defined, then the NAME is defined in the
19443 usual manner as a label (by means of `ASM_OUTPUT_LABEL').
19445 You may wish to use `ASM_OUTPUT_TYPE_DIRECTIVE' in the definition
19448 - Macro: ASM_DECLARE_REGISTER_GLOBAL (STREAM, DECL, REGNO, NAME)
19449 A C statement (sans semicolon) to output to the stdio stream
19450 STREAM any text necessary for claiming a register REGNO for a
19451 global variable DECL with name NAME.
19453 If you don't define this macro, that is equivalent to defining it
19456 - Macro: ASM_FINISH_DECLARE_OBJECT (STREAM, DECL, TOPLEVEL, ATEND)
19457 A C statement (sans semicolon) to finish up declaring a variable
19458 name once the compiler has processed its initializer fully and
19459 thus has had a chance to determine the size of an array when
19460 controlled by an initializer. This is used on systems where it's
19461 necessary to declare something about the size of the object.
19463 If you don't define this macro, that is equivalent to defining it
19466 You may wish to use `ASM_OUTPUT_SIZE_DIRECTIVE' and/or
19467 `ASM_OUTPUT_MEASURED_SIZE' in the definition of this macro.
19469 - Target Hook: void TARGET_ASM_GLOBALIZE_LABEL (FILE *STREAM, const
19471 This target hook is a function to output to the stdio stream
19472 STREAM some commands that will make the label NAME global; that
19473 is, available for reference from other files.
19475 The default implementation relies on a proper definition of
19478 - Macro: ASM_WEAKEN_LABEL (STREAM, NAME)
19479 A C statement (sans semicolon) to output to the stdio stream
19480 STREAM some commands that will make the label NAME weak; that is,
19481 available for reference from other files but only used if no other
19482 definition is available. Use the expression `assemble_name
19483 (STREAM, NAME)' to output the name itself; before and after that,
19484 output the additional assembler syntax for making that name weak,
19487 If you don't define this macro or `ASM_WEAKEN_DECL', GCC will not
19488 support weak symbols and you should not define the `SUPPORTS_WEAK'
19491 - Macro: ASM_WEAKEN_DECL (STREAM, DECL, NAME, VALUE)
19492 Combines (and replaces) the function of `ASM_WEAKEN_LABEL' and
19493 `ASM_OUTPUT_WEAK_ALIAS', allowing access to the associated function
19494 or variable decl. If VALUE is not `NULL', this C statement should
19495 output to the stdio stream STREAM assembler code which defines
19496 (equates) the weak symbol NAME to have the value VALUE. If VALUE
19497 is `NULL', it should output commands to make NAME weak.
19499 - Macro: SUPPORTS_WEAK
19500 A C expression which evaluates to true if the target supports weak
19503 If you don't define this macro, `defaults.h' provides a default
19504 definition. If either `ASM_WEAKEN_LABEL' or `ASM_WEAKEN_DECL' is
19505 defined, the default definition is `1'; otherwise, it is `0'.
19506 Define this macro if you want to control weak symbol support with
19507 a compiler flag such as `-melf'.
19509 - Macro: MAKE_DECL_ONE_ONLY (DECL)
19510 A C statement (sans semicolon) to mark DECL to be emitted as a
19511 public symbol such that extra copies in multiple translation units
19512 will be discarded by the linker. Define this macro if your object
19513 file format provides support for this concept, such as the `COMDAT'
19514 section flags in the Microsoft Windows PE/COFF format, and this
19515 support requires changes to DECL, such as putting it in a separate
19518 - Macro: SUPPORTS_ONE_ONLY
19519 A C expression which evaluates to true if the target supports
19520 one-only semantics.
19522 If you don't define this macro, `varasm.c' provides a default
19523 definition. If `MAKE_DECL_ONE_ONLY' is defined, the default
19524 definition is `1'; otherwise, it is `0'. Define this macro if you
19525 want to control one-only symbol support with a compiler flag, or if
19526 setting the `DECL_ONE_ONLY' flag is enough to mark a declaration to
19527 be emitted as one-only.
19529 - Target Hook: void TARGET_ASM_ASSEMBLE_VISIBILITY (tree DECL, const
19531 This target hook is a function to output to ASM_OUT_FILE some
19532 commands that will make the symbol(s) associated with DECL have
19533 hidden, protected or internal visibility as specified by
19536 - Macro: ASM_OUTPUT_EXTERNAL (STREAM, DECL, NAME)
19537 A C statement (sans semicolon) to output to the stdio stream
19538 STREAM any text necessary for declaring the name of an external
19539 symbol named NAME which is referenced in this compilation but not
19540 defined. The value of DECL is the tree node for the declaration.
19542 This macro need not be defined if it does not need to output
19543 anything. The GNU assembler and most Unix assemblers don't
19546 - Target Hook: void TARGET_ASM_EXTERNAL_LIBCALL (rtx SYMREF)
19547 This target hook is a function to output to ASM_OUT_FILE an
19548 assembler pseudo-op to declare a library function name external.
19549 The name of the library function is given by SYMREF, which is a
19552 - Macro: ASM_OUTPUT_LABELREF (STREAM, NAME)
19553 A C statement (sans semicolon) to output to the stdio stream
19554 STREAM a reference in assembler syntax to a label named NAME.
19555 This should add `_' to the front of the name, if that is customary
19556 on your operating system, as it is in most Berkeley Unix systems.
19557 This macro is used in `assemble_name'.
19559 - Macro: ASM_OUTPUT_SYMBOL_REF (STREAM, SYM)
19560 A C statement (sans semicolon) to output a reference to
19561 `SYMBOL_REF' SYM. If not defined, `assemble_name' will be used to
19562 output the name of the symbol. This macro may be used to modify
19563 the way a symbol is referenced depending on information encoded by
19564 `TARGET_ENCODE_SECTION_INFO'.
19566 - Macro: ASM_OUTPUT_LABEL_REF (STREAM, BUF)
19567 A C statement (sans semicolon) to output a reference to BUF, the
19568 result of `ASM_GENERATE_INTERNAL_LABEL'. If not defined,
19569 `assemble_name' will be used to output the name of the symbol.
19570 This macro is not used by `output_asm_label', or the `%l'
19571 specifier that calls it; the intention is that this macro should
19572 be set when it is necessary to output a label differently when its
19573 address is being taken.
19575 - Target Hook: void TARGET_ASM_INTERNAL_LABEL (FILE *STREAM, const
19576 char *PREFIX, unsigned long LABELNO)
19577 A function to output to the stdio stream STREAM a label whose name
19578 is made from the string PREFIX and the number LABELNO.
19580 It is absolutely essential that these labels be distinct from the
19581 labels used for user-level functions and variables. Otherwise,
19582 certain programs will have name conflicts with internal labels.
19584 It is desirable to exclude internal labels from the symbol table
19585 of the object file. Most assemblers have a naming convention for
19586 labels that should be excluded; on many systems, the letter `L' at
19587 the beginning of a label has this effect. You should find out what
19588 convention your system uses, and follow it.
19590 The default version of this function utilizes
19591 ASM_GENERATE_INTERNAL_LABEL.
19593 - Macro: ASM_OUTPUT_DEBUG_LABEL (STREAM, PREFIX, NUM)
19594 A C statement to output to the stdio stream STREAM a debug info
19595 label whose name is made from the string PREFIX and the number
19596 NUM. This is useful for VLIW targets, where debug info labels may
19597 need to be treated differently than branch target labels. On some
19598 systems, branch target labels must be at the beginning of
19599 instruction bundles, but debug info labels can occur in the middle
19600 of instruction bundles.
19602 If this macro is not defined, then
19603 `(*targetm.asm_out.internal_label)' will be used.
19605 - Macro: ASM_GENERATE_INTERNAL_LABEL (STRING, PREFIX, NUM)
19606 A C statement to store into the string STRING a label whose name
19607 is made from the string PREFIX and the number NUM.
19609 This string, when output subsequently by `assemble_name', should
19610 produce the output that `(*targetm.asm_out.internal_label)' would
19611 produce with the same PREFIX and NUM.
19613 If the string begins with `*', then `assemble_name' will output
19614 the rest of the string unchanged. It is often convenient for
19615 `ASM_GENERATE_INTERNAL_LABEL' to use `*' in this way. If the
19616 string doesn't start with `*', then `ASM_OUTPUT_LABELREF' gets to
19617 output the string, and may change it. (Of course,
19618 `ASM_OUTPUT_LABELREF' is also part of your machine description, so
19619 you should know what it does on your machine.)
19621 - Macro: ASM_FORMAT_PRIVATE_NAME (OUTVAR, NAME, NUMBER)
19622 A C expression to assign to OUTVAR (which is a variable of type
19623 `char *') a newly allocated string made from the string NAME and
19624 the number NUMBER, with some suitable punctuation added. Use
19625 `alloca' to get space for the string.
19627 The string will be used as an argument to `ASM_OUTPUT_LABELREF' to
19628 produce an assembler label for an internal static variable whose
19629 name is NAME. Therefore, the string must be such as to result in
19630 valid assembler code. The argument NUMBER is different each time
19631 this macro is executed; it prevents conflicts between
19632 similarly-named internal static variables in different scopes.
19634 Ideally this string should not be a valid C identifier, to prevent
19635 any conflict with the user's own symbols. Most assemblers allow
19636 periods or percent signs in assembler symbols; putting at least
19637 one of these between the name and the number will suffice.
19639 If this macro is not defined, a default definition will be provided
19640 which is correct for most systems.
19642 - Macro: ASM_OUTPUT_DEF (STREAM, NAME, VALUE)
19643 A C statement to output to the stdio stream STREAM assembler code
19644 which defines (equates) the symbol NAME to have the value VALUE.
19646 If `SET_ASM_OP' is defined, a default definition is provided which
19647 is correct for most systems.
19649 - Macro: ASM_OUTPUT_DEF_FROM_DECLS (STREAM, DECL_OF_NAME,
19651 A C statement to output to the stdio stream STREAM assembler code
19652 which defines (equates) the symbol whose tree node is DECL_OF_NAME
19653 to have the value of the tree node DECL_OF_VALUE. This macro will
19654 be used in preference to `ASM_OUTPUT_DEF' if it is defined and if
19655 the tree nodes are available.
19657 If `SET_ASM_OP' is defined, a default definition is provided which
19658 is correct for most systems.
19660 - Macro: ASM_OUTPUT_WEAK_ALIAS (STREAM, NAME, VALUE)
19661 A C statement to output to the stdio stream STREAM assembler code
19662 which defines (equates) the weak symbol NAME to have the value
19663 VALUE. If VALUE is `NULL', it defines NAME as an undefined weak
19666 Define this macro if the target only supports weak aliases; define
19667 `ASM_OUTPUT_DEF' instead if possible.
19669 - Macro: OBJC_GEN_METHOD_LABEL (BUF, IS_INST, CLASS_NAME, CAT_NAME,
19671 Define this macro to override the default assembler names used for
19672 Objective-C methods.
19674 The default name is a unique method number followed by the name of
19675 the class (e.g. `_1_Foo'). For methods in categories, the name of
19676 the category is also included in the assembler name (e.g.
19679 These names are safe on most systems, but make debugging difficult
19680 since the method's selector is not present in the name.
19681 Therefore, particular systems define other ways of computing names.
19683 BUF is an expression of type `char *' which gives you a buffer in
19684 which to store the name; its length is as long as CLASS_NAME,
19685 CAT_NAME and SEL_NAME put together, plus 50 characters extra.
19687 The argument IS_INST specifies whether the method is an instance
19688 method or a class method; CLASS_NAME is the name of the class;
19689 CAT_NAME is the name of the category (or `NULL' if the method is
19690 not in a category); and SEL_NAME is the name of the selector.
19692 On systems where the assembler can handle quoted names, you can
19693 use this macro to provide more human-readable names.
19695 - Macro: ASM_DECLARE_CLASS_REFERENCE (STREAM, NAME)
19696 A C statement (sans semicolon) to output to the stdio stream
19697 STREAM commands to declare that the label NAME is an Objective-C
19698 class reference. This is only needed for targets whose linkers
19699 have special support for NeXT-style runtimes.
19701 - Macro: ASM_DECLARE_UNRESOLVED_REFERENCE (STREAM, NAME)
19702 A C statement (sans semicolon) to output to the stdio stream
19703 STREAM commands to declare that the label NAME is an unresolved
19704 Objective-C class reference. This is only needed for targets
19705 whose linkers have special support for NeXT-style runtimes.
19708 File: gccint.info, Node: Initialization, Next: Macros for Initialization, Prev: Label Output, Up: Assembler Format
19710 How Initialization Functions Are Handled
19711 ----------------------------------------
19713 The compiled code for certain languages includes "constructors"
19714 (also called "initialization routines")--functions to initialize data
19715 in the program when the program is started. These functions need to be
19716 called before the program is "started"--that is to say, before `main'
19719 Compiling some languages generates "destructors" (also called
19720 "termination routines") that should be called when the program
19723 To make the initialization and termination functions work, the
19724 compiler must output something in the assembler code to cause those
19725 functions to be called at the appropriate time. When you port the
19726 compiler to a new system, you need to specify how to do this.
19728 There are two major ways that GCC currently supports the execution of
19729 initialization and termination functions. Each way has two variants.
19730 Much of the structure is common to all four variations.
19732 The linker must build two lists of these functions--a list of
19733 initialization functions, called `__CTOR_LIST__', and a list of
19734 termination functions, called `__DTOR_LIST__'.
19736 Each list always begins with an ignored function pointer (which may
19737 hold 0, -1, or a count of the function pointers after it, depending on
19738 the environment). This is followed by a series of zero or more function
19739 pointers to constructors (or destructors), followed by a function
19740 pointer containing zero.
19742 Depending on the operating system and its executable file format,
19743 either `crtstuff.c' or `libgcc2.c' traverses these lists at startup
19744 time and exit time. Constructors are called in reverse order of the
19745 list; destructors in forward order.
19747 The best way to handle static constructors works only for object file
19748 formats which provide arbitrarily-named sections. A section is set
19749 aside for a list of constructors, and another for a list of destructors.
19750 Traditionally these are called `.ctors' and `.dtors'. Each object file
19751 that defines an initialization function also puts a word in the
19752 constructor section to point to that function. The linker accumulates
19753 all these words into one contiguous `.ctors' section. Termination
19754 functions are handled similarly.
19756 This method will be chosen as the default by `target-def.h' if
19757 `TARGET_ASM_NAMED_SECTION' is defined. A target that does not support
19758 arbitrary sections, but does support special designated constructor and
19759 destructor sections may define `CTORS_SECTION_ASM_OP' and
19760 `DTORS_SECTION_ASM_OP' to achieve the same effect.
19762 When arbitrary sections are available, there are two variants,
19763 depending upon how the code in `crtstuff.c' is called. On systems that
19764 support a ".init" section which is executed at program startup, parts
19765 of `crtstuff.c' are compiled into that section. The program is linked
19766 by the `gcc' driver like this:
19768 ld -o OUTPUT_FILE crti.o crtbegin.o ... -lgcc crtend.o crtn.o
19770 The prologue of a function (`__init') appears in the `.init' section
19771 of `crti.o'; the epilogue appears in `crtn.o'. Likewise for the
19772 function `__fini' in the ".fini" section. Normally these files are
19773 provided by the operating system or by the GNU C library, but are
19774 provided by GCC for a few targets.
19776 The objects `crtbegin.o' and `crtend.o' are (for most targets)
19777 compiled from `crtstuff.c'. They contain, among other things, code
19778 fragments within the `.init' and `.fini' sections that branch to
19779 routines in the `.text' section. The linker will pull all parts of a
19780 section together, which results in a complete `__init' function that
19781 invokes the routines we need at startup.
19783 To use this variant, you must define the `INIT_SECTION_ASM_OP' macro
19786 If no init section is available, when GCC compiles any function
19787 called `main' (or more accurately, any function designated as a program
19788 entry point by the language front end calling `expand_main_function'),
19789 it inserts a procedure call to `__main' as the first executable code
19790 after the function prologue. The `__main' function is defined in
19791 `libgcc2.c' and runs the global constructors.
19793 In file formats that don't support arbitrary sections, there are
19794 again two variants. In the simplest variant, the GNU linker (GNU `ld')
19795 and an `a.out' format must be used. In this case,
19796 `TARGET_ASM_CONSTRUCTOR' is defined to produce a `.stabs' entry of type
19797 `N_SETT', referencing the name `__CTOR_LIST__', and with the address of
19798 the void function containing the initialization code as its value. The
19799 GNU linker recognizes this as a request to add the value to a "set";
19800 the values are accumulated, and are eventually placed in the executable
19801 as a vector in the format described above, with a leading (ignored)
19802 count and a trailing zero element. `TARGET_ASM_DESTRUCTOR' is handled
19803 similarly. Since no init section is available, the absence of
19804 `INIT_SECTION_ASM_OP' causes the compilation of `main' to call `__main'
19805 as above, starting the initialization process.
19807 The last variant uses neither arbitrary sections nor the GNU linker.
19808 This is preferable when you want to do dynamic linking and when using
19809 file formats which the GNU linker does not support, such as `ECOFF'. In
19810 this case, `TARGET_HAVE_CTORS_DTORS' is false, initialization and
19811 termination functions are recognized simply by their names. This
19812 requires an extra program in the linkage step, called `collect2'. This
19813 program pretends to be the linker, for use with GCC; it does its job by
19814 running the ordinary linker, but also arranges to include the vectors of
19815 initialization and termination functions. These functions are called
19816 via `__main' as described above. In order to use this method,
19817 `use_collect2' must be defined in the target in `config.gcc'.
19819 The following section describes the specific macros that control and
19820 customize the handling of initialization and termination functions.
19823 File: gccint.info, Node: Macros for Initialization, Next: Instruction Output, Prev: Initialization, Up: Assembler Format
19825 Macros Controlling Initialization Routines
19826 ------------------------------------------
19828 Here are the macros that control how the compiler handles
19829 initialization and termination functions:
19831 - Macro: INIT_SECTION_ASM_OP
19832 If defined, a C string constant, including spacing, for the
19833 assembler operation to identify the following data as
19834 initialization code. If not defined, GCC will assume such a
19835 section does not exist. When you are using special sections for
19836 initialization and termination functions, this macro also controls
19837 how `crtstuff.c' and `libgcc2.c' arrange to run the initialization
19840 - Macro: HAS_INIT_SECTION
19841 If defined, `main' will not call `__main' as described above.
19842 This macro should be defined for systems that control start-up code
19843 on a symbol-by-symbol basis, such as OSF/1, and should not be
19844 defined explicitly for systems that support `INIT_SECTION_ASM_OP'.
19846 - Macro: LD_INIT_SWITCH
19847 If defined, a C string constant for a switch that tells the linker
19848 that the following symbol is an initialization routine.
19850 - Macro: LD_FINI_SWITCH
19851 If defined, a C string constant for a switch that tells the linker
19852 that the following symbol is a finalization routine.
19854 - Macro: COLLECT_SHARED_INIT_FUNC (STREAM, FUNC)
19855 If defined, a C statement that will write a function that can be
19856 automatically called when a shared library is loaded. The function
19857 should call FUNC, which takes no arguments. If not defined, and
19858 the object format requires an explicit initialization function,
19859 then a function called `_GLOBAL__DI' will be generated.
19861 This function and the following one are used by collect2 when
19862 linking a shared library that needs constructors or destructors,
19863 or has DWARF2 exception tables embedded in the code.
19865 - Macro: COLLECT_SHARED_FINI_FUNC (STREAM, FUNC)
19866 If defined, a C statement that will write a function that can be
19867 automatically called when a shared library is unloaded. The
19868 function should call FUNC, which takes no arguments. If not
19869 defined, and the object format requires an explicit finalization
19870 function, then a function called `_GLOBAL__DD' will be generated.
19872 - Macro: INVOKE__main
19873 If defined, `main' will call `__main' despite the presence of
19874 `INIT_SECTION_ASM_OP'. This macro should be defined for systems
19875 where the init section is not actually run automatically, but is
19876 still useful for collecting the lists of constructors and
19879 - Macro: SUPPORTS_INIT_PRIORITY
19880 If nonzero, the C++ `init_priority' attribute is supported and the
19881 compiler should emit instructions to control the order of
19882 initialization of objects. If zero, the compiler will issue an
19883 error message upon encountering an `init_priority' attribute.
19885 - Target Hook: bool TARGET_HAVE_CTORS_DTORS
19886 This value is true if the target supports some "native" method of
19887 collecting constructors and destructors to be run at startup and
19888 exit. It is false if we must use `collect2'.
19890 - Target Hook: void TARGET_ASM_CONSTRUCTOR (rtx SYMBOL, int PRIORITY)
19891 If defined, a function that outputs assembler code to arrange to
19892 call the function referenced by SYMBOL at initialization time.
19894 Assume that SYMBOL is a `SYMBOL_REF' for a function taking no
19895 arguments and with no return value. If the target supports
19896 initialization priorities, PRIORITY is a value between 0 and
19897 `MAX_INIT_PRIORITY'; otherwise it must be `DEFAULT_INIT_PRIORITY'.
19899 If this macro is not defined by the target, a suitable default will
19900 be chosen if (1) the target supports arbitrary section names, (2)
19901 the target defines `CTORS_SECTION_ASM_OP', or (3) `USE_COLLECT2'
19904 - Target Hook: void TARGET_ASM_DESTRUCTOR (rtx SYMBOL, int PRIORITY)
19905 This is like `TARGET_ASM_CONSTRUCTOR' but used for termination
19906 functions rather than initialization functions.
19908 If `TARGET_HAVE_CTORS_DTORS' is true, the initialization routine
19909 generated for the generated object file will have static linkage.
19911 If your system uses `collect2' as the means of processing
19912 constructors, then that program normally uses `nm' to scan an object
19913 file for constructor functions to be called.
19915 On certain kinds of systems, you can define this macro to make
19916 `collect2' work faster (and, in some cases, make it work at all):
19918 - Macro: OBJECT_FORMAT_COFF
19919 Define this macro if the system uses COFF (Common Object File
19920 Format) object files, so that `collect2' can assume this format
19921 and scan object files directly for dynamic constructor/destructor
19924 This macro is effective only in a native compiler; `collect2' as
19925 part of a cross compiler always uses `nm' for the target machine.
19927 - Macro: COLLECT_PARSE_FLAG (FLAG)
19928 Define this macro to be C code that examines `collect2' command
19929 line option FLAG and performs special actions if `collect2' needs
19930 to behave differently depending on FLAG.
19932 - Macro: REAL_NM_FILE_NAME
19933 Define this macro as a C string constant containing the file name
19934 to use to execute `nm'. The default is to search the path
19937 If your system supports shared libraries and has a program to list
19938 the dynamic dependencies of a given library or executable, you can
19939 define these macros to enable support for running initialization
19940 and termination functions in shared libraries:
19942 - Macro: LDD_SUFFIX
19943 Define this macro to a C string constant containing the name of
19944 the program which lists dynamic dependencies, like `"ldd"' under
19947 - Macro: PARSE_LDD_OUTPUT (PTR)
19948 Define this macro to be C code that extracts filenames from the
19949 output of the program denoted by `LDD_SUFFIX'. PTR is a variable
19950 of type `char *' that points to the beginning of a line of output
19951 from `LDD_SUFFIX'. If the line lists a dynamic dependency, the
19952 code must advance PTR to the beginning of the filename on that
19953 line. Otherwise, it must set PTR to `NULL'.
19956 File: gccint.info, Node: Instruction Output, Next: Dispatch Tables, Prev: Macros for Initialization, Up: Assembler Format
19958 Output of Assembler Instructions
19959 --------------------------------
19961 This describes assembler instruction output.
19963 - Macro: REGISTER_NAMES
19964 A C initializer containing the assembler's names for the machine
19965 registers, each one as a C string constant. This is what
19966 translates register numbers in the compiler into assembler
19969 - Macro: ADDITIONAL_REGISTER_NAMES
19970 If defined, a C initializer for an array of structures containing
19971 a name and a register number. This macro defines additional names
19972 for hard registers, thus allowing the `asm' option in declarations
19973 to refer to registers using alternate names.
19975 - Macro: ASM_OUTPUT_OPCODE (STREAM, PTR)
19976 Define this macro if you are using an unusual assembler that
19977 requires different names for the machine instructions.
19979 The definition is a C statement or statements which output an
19980 assembler instruction opcode to the stdio stream STREAM. The
19981 macro-operand PTR is a variable of type `char *' which points to
19982 the opcode name in its "internal" form--the form that is written
19983 in the machine description. The definition should output the
19984 opcode name to STREAM, performing any translation you desire, and
19985 increment the variable PTR to point at the end of the opcode so
19986 that it will not be output twice.
19988 In fact, your macro definition may process less than the entire
19989 opcode name, or more than the opcode name; but if you want to
19990 process text that includes `%'-sequences to substitute operands,
19991 you must take care of the substitution yourself. Just be sure to
19992 increment PTR over whatever text should not be output normally.
19994 If you need to look at the operand values, they can be found as the
19995 elements of `recog_data.operand'.
19997 If the macro definition does nothing, the instruction is output in
20000 - Macro: FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)
20001 If defined, a C statement to be executed just prior to the output
20002 of assembler code for INSN, to modify the extracted operands so
20003 they will be output differently.
20005 Here the argument OPVEC is the vector containing the operands
20006 extracted from INSN, and NOPERANDS is the number of elements of
20007 the vector which contain meaningful data for this insn. The
20008 contents of this vector are what will be used to convert the insn
20009 template into assembler code, so you can change the assembler
20010 output by changing the contents of the vector.
20012 This macro is useful when various assembler syntaxes share a single
20013 file of instruction patterns; by defining this macro differently,
20014 you can cause a large class of instructions to be output
20015 differently (such as with rearranged operands). Naturally,
20016 variations in assembler syntax affecting individual insn patterns
20017 ought to be handled by writing conditional output routines in
20020 If this macro is not defined, it is equivalent to a null statement.
20022 - Macro: PRINT_OPERAND (STREAM, X, CODE)
20023 A C compound statement to output to stdio stream STREAM the
20024 assembler syntax for an instruction operand X. X is an RTL
20027 CODE is a value that can be used to specify one of several ways of
20028 printing the operand. It is used when identical operands must be
20029 printed differently depending on the context. CODE comes from the
20030 `%' specification that was used to request printing of the
20031 operand. If the specification was just `%DIGIT' then CODE is 0;
20032 if the specification was `%LTR DIGIT' then CODE is the ASCII code
20035 If X is a register, this macro should print the register's name.
20036 The names can be found in an array `reg_names' whose type is `char
20037 *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
20039 When the machine description has a specification `%PUNCT' (a `%'
20040 followed by a punctuation character), this macro is called with a
20041 null pointer for X and the punctuation character for CODE.
20043 - Macro: PRINT_OPERAND_PUNCT_VALID_P (CODE)
20044 A C expression which evaluates to true if CODE is a valid
20045 punctuation character for use in the `PRINT_OPERAND' macro. If
20046 `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
20047 punctuation characters (except for the standard one, `%') are used
20050 - Macro: PRINT_OPERAND_ADDRESS (STREAM, X)
20051 A C compound statement to output to stdio stream STREAM the
20052 assembler syntax for an instruction operand that is a memory
20053 reference whose address is X. X is an RTL expression.
20055 On some machines, the syntax for a symbolic address depends on the
20056 section that the address refers to. On these machines, define the
20057 hook `TARGET_ENCODE_SECTION_INFO' to store the information into the
20058 `symbol_ref', and then check for it here. *Note Assembler
20061 - Macro: DBR_OUTPUT_SEQEND (FILE)
20062 A C statement, to be executed after all slot-filler instructions
20063 have been output. If necessary, call `dbr_sequence_length' to
20064 determine the number of slots filled in a sequence (zero if not
20065 currently outputting a sequence), to decide how many no-ops to
20066 output, or whatever.
20068 Don't define this macro if it has nothing to do, but it is helpful
20069 in reading assembly output if the extent of the delay sequence is
20070 made explicit (e.g. with white space).
20072 Note that output routines for instructions with delay slots must be
20073 prepared to deal with not being output as part of a sequence (i.e. when
20074 the scheduling pass is not run, or when no slot fillers could be
20075 found.) The variable `final_sequence' is null when not processing a
20076 sequence, otherwise it contains the `sequence' rtx being output.
20078 - Macro: REGISTER_PREFIX
20079 - Macro: LOCAL_LABEL_PREFIX
20080 - Macro: USER_LABEL_PREFIX
20081 - Macro: IMMEDIATE_PREFIX
20082 If defined, C string expressions to be used for the `%R', `%L',
20083 `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
20084 are useful when a single `md' file must support multiple assembler
20085 formats. In that case, the various `tm.h' files can define these
20086 macros differently.
20088 - Macro: ASM_FPRINTF_EXTENSIONS (FILE, ARGPTR, FORMAT)
20089 If defined this macro should expand to a series of `case'
20090 statements which will be parsed inside the `switch' statement of
20091 the `asm_fprintf' function. This allows targets to define extra
20092 printf formats which may useful when generating their assembler
20093 statements. Note that uppercase letters are reserved for future
20094 generic extensions to asm_fprintf, and so are not available to
20095 target specific code. The output file is given by the parameter
20096 FILE. The varargs input pointer is ARGPTR and the rest of the
20097 format string, starting the character after the one that is being
20098 switched upon, is pointed to by FORMAT.
20100 - Macro: ASSEMBLER_DIALECT
20101 If your target supports multiple dialects of assembler language
20102 (such as different opcodes), define this macro as a C expression
20103 that gives the numeric index of the assembler language dialect to
20104 use, with zero as the first variant.
20106 If this macro is defined, you may use constructs of the form
20107 `{option0|option1|option2...}'
20109 in the output templates of patterns (*note Output Template::) or
20110 in the first argument of `asm_fprintf'. This construct outputs
20111 `option0', `option1', `option2', etc., if the value of
20112 `ASSEMBLER_DIALECT' is zero, one, two, etc. Any special characters
20113 within these strings retain their usual meaning. If there are
20114 fewer alternatives within the braces than the value of
20115 `ASSEMBLER_DIALECT', the construct outputs nothing.
20117 If you do not define this macro, the characters `{', `|' and `}'
20118 do not have any special meaning when used in templates or operands
20121 Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
20122 `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the
20123 variations in assembler language syntax with that mechanism.
20124 Define `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax
20125 if the syntax variant are larger and involve such things as
20126 different opcodes or operand order.
20128 - Macro: ASM_OUTPUT_REG_PUSH (STREAM, REGNO)
20129 A C expression to output to STREAM some assembler code which will
20130 push hard register number REGNO onto the stack. The code need not
20131 be optimal, since this macro is used only when profiling.
20133 - Macro: ASM_OUTPUT_REG_POP (STREAM, REGNO)
20134 A C expression to output to STREAM some assembler code which will
20135 pop hard register number REGNO off of the stack. The code need
20136 not be optimal, since this macro is used only when profiling.
20139 File: gccint.info, Node: Dispatch Tables, Next: Exception Region Output, Prev: Instruction Output, Up: Assembler Format
20141 Output of Dispatch Tables
20142 -------------------------
20144 This concerns dispatch tables.
20146 - Macro: ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, BODY, VALUE, REL)
20147 A C statement to output to the stdio stream STREAM an assembler
20148 pseudo-instruction to generate a difference between two labels.
20149 VALUE and REL are the numbers of two internal labels. The
20150 definitions of these labels are output using
20151 `(*targetm.asm_out.internal_label)', and they must be printed in
20152 the same way here. For example,
20154 fprintf (STREAM, "\t.word L%d-L%d\n",
20157 You must provide this macro on machines where the addresses in a
20158 dispatch table are relative to the table's own address. If
20159 defined, GCC will also use this macro on all machines when
20160 producing PIC. BODY is the body of the `ADDR_DIFF_VEC'; it is
20161 provided so that the mode and flags can be read.
20163 - Macro: ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)
20164 This macro should be provided on machines where the addresses in a
20165 dispatch table are absolute.
20167 The definition should be a C statement to output to the stdio
20168 stream STREAM an assembler pseudo-instruction to generate a
20169 reference to a label. VALUE is the number of an internal label
20170 whose definition is output using
20171 `(*targetm.asm_out.internal_label)'. For example,
20173 fprintf (STREAM, "\t.word L%d\n", VALUE)
20175 - Macro: ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)
20176 Define this if the label before a jump-table needs to be output
20177 specially. The first three arguments are the same as for
20178 `(*targetm.asm_out.internal_label)'; the fourth argument is the
20179 jump-table which follows (a `jump_insn' containing an `addr_vec'
20180 or `addr_diff_vec').
20182 This feature is used on system V to output a `swbeg' statement for
20185 If this macro is not defined, these labels are output with
20186 `(*targetm.asm_out.internal_label)'.
20188 - Macro: ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)
20189 Define this if something special must be output at the end of a
20190 jump-table. The definition should be a C statement to be executed
20191 after the assembler code for the table is written. It should write
20192 the appropriate code to stdio stream STREAM. The argument TABLE
20193 is the jump-table insn, and NUM is the label-number of the
20196 If this macro is not defined, nothing special is output at the end
20200 File: gccint.info, Node: Exception Region Output, Next: Alignment Output, Prev: Dispatch Tables, Up: Assembler Format
20202 Assembler Commands for Exception Regions
20203 ----------------------------------------
20205 This describes commands marking the start and the end of an exception
20208 - Macro: EH_FRAME_SECTION_NAME
20209 If defined, a C string constant for the name of the section
20210 containing exception handling frame unwind information. If not
20211 defined, GCC will provide a default definition if the target
20212 supports named sections. `crtstuff.c' uses this macro to switch
20213 to the appropriate section.
20215 You should define this symbol if your target supports DWARF 2 frame
20216 unwind information and the default definition does not work.
20218 - Macro: EH_FRAME_IN_DATA_SECTION
20219 If defined, DWARF 2 frame unwind information will be placed in the
20220 data section even though the target supports named sections. This
20221 might be necessary, for instance, if the system linker does garbage
20222 collection and sections cannot be marked as not to be collected.
20224 Do not define this macro unless `TARGET_ASM_NAMED_SECTION' is also
20227 - Macro: MASK_RETURN_ADDR
20228 An rtx used to mask the return address found via
20229 `RETURN_ADDR_RTX', so that it does not contain any extraneous set
20232 - Macro: DWARF2_UNWIND_INFO
20233 Define this macro to 0 if your target supports DWARF 2 frame unwind
20234 information, but it does not yet work with exception handling.
20235 Otherwise, if your target supports this information (if it defines
20236 `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or
20237 `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1.
20239 If this macro is defined to 1, the DWARF 2 unwinder will be the
20240 default exception handling mechanism; otherwise,
20241 `setjmp'/`longjmp' will be used by default.
20243 If this macro is defined to anything, the DWARF 2 unwinder will be
20244 used instead of inline unwinders and `__unwind_function' in the
20247 - Macro: MUST_USE_SJLJ_EXCEPTIONS
20248 This macro need only be defined if `DWARF2_UNWIND_INFO' is
20249 runtime-variable. In that case, `except.h' cannot correctly
20250 determine the corresponding definition of
20251 `MUST_USE_SJLJ_EXCEPTIONS', so the target must provide it directly.
20253 - Macro: DWARF_CIE_DATA_ALIGNMENT
20254 This macro need only be defined if the target might save registers
20255 in the function prologue at an offset to the stack pointer that is
20256 not aligned to `UNITS_PER_WORD'. The definition should be the
20257 negative minimum alignment if `STACK_GROWS_DOWNWARD' is defined,
20258 and the positive minimum alignment otherwise. *Note SDB and
20259 DWARF::. Only applicable if the target supports DWARF 2 frame
20260 unwind information.
20262 - Target Hook: void TARGET_ASM_EXCEPTION_SECTION ()
20263 If defined, a function that switches to the section in which the
20264 main exception table is to be placed (*note Sections::). The
20265 default is a function that switches to a section named
20266 `.gcc_except_table' on machines that support named sections via
20267 `TARGET_ASM_NAMED_SECTION', otherwise if `-fpic' or `-fPIC' is in
20268 effect, the `data_section', otherwise the `readonly_data_section'.
20270 - Target Hook: void TARGET_ASM_EH_FRAME_SECTION ()
20271 If defined, a function that switches to the section in which the
20272 DWARF 2 frame unwind information to be placed (*note Sections::).
20273 The default is a function that outputs a standard GAS section
20274 directive, if `EH_FRAME_SECTION_NAME' is defined, or else a data
20275 section directive followed by a synthetic label.
20277 - Variable: Target Hook bool TARGET_TERMINATE_DW2_EH_FRAME_INFO
20278 Contains the value true if the target should add a zero word onto
20279 the end of a Dwarf-2 frame info section when used for exception
20280 handling. Default value is false if `EH_FRAME_SECTION_NAME' is
20281 defined, and true otherwise.
20283 - Target Hook: rtx TARGET_DWARF_REGISTER_SPAN (rtx REG)
20284 Given a register, this hook should return a parallel of registers
20285 to represent where to find the register pieces. Define this hook
20286 if the register and its mode are represented in Dwarf in
20287 non-contiguous locations, or if the register should be represented
20288 in more than one register in Dwarf. Otherwise, this hook should
20289 return `NULL_RTX'. If not defined, the default is to return
20293 File: gccint.info, Node: Alignment Output, Prev: Exception Region Output, Up: Assembler Format
20295 Assembler Commands for Alignment
20296 --------------------------------
20298 This describes commands for alignment.
20300 - Macro: JUMP_ALIGN (LABEL)
20301 The alignment (log base 2) to put in front of LABEL, which is a
20302 common destination of jumps and has no fallthru incoming edge.
20304 This macro need not be defined if you don't want any special
20305 alignment to be done at such a time. Most machine descriptions do
20306 not currently define the macro.
20308 Unless it's necessary to inspect the LABEL parameter, it is better
20309 to set the variable ALIGN_JUMPS in the target's
20310 `OVERRIDE_OPTIONS'. Otherwise, you should try to honor the user's
20311 selection in ALIGN_JUMPS in a `JUMP_ALIGN' implementation.
20313 - Macro: LABEL_ALIGN_AFTER_BARRIER (LABEL)
20314 The alignment (log base 2) to put in front of LABEL, which follows
20317 This macro need not be defined if you don't want any special
20318 alignment to be done at such a time. Most machine descriptions do
20319 not currently define the macro.
20321 - Macro: LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
20322 The maximum number of bytes to skip when applying
20323 `LABEL_ALIGN_AFTER_BARRIER'. This works only if
20324 `ASM_OUTPUT_MAX_SKIP_ALIGN' is defined.
20326 - Macro: LOOP_ALIGN (LABEL)
20327 The alignment (log base 2) to put in front of LABEL, which follows
20328 a `NOTE_INSN_LOOP_BEG' note.
20330 This macro need not be defined if you don't want any special
20331 alignment to be done at such a time. Most machine descriptions do
20332 not currently define the macro.
20334 Unless it's necessary to inspect the LABEL parameter, it is better
20335 to set the variable `align_loops' in the target's
20336 `OVERRIDE_OPTIONS'. Otherwise, you should try to honor the user's
20337 selection in `align_loops' in a `LOOP_ALIGN' implementation.
20339 - Macro: LOOP_ALIGN_MAX_SKIP
20340 The maximum number of bytes to skip when applying `LOOP_ALIGN'.
20341 This works only if `ASM_OUTPUT_MAX_SKIP_ALIGN' is defined.
20343 - Macro: LABEL_ALIGN (LABEL)
20344 The alignment (log base 2) to put in front of LABEL. If
20345 `LABEL_ALIGN_AFTER_BARRIER' / `LOOP_ALIGN' specify a different
20346 alignment, the maximum of the specified values is used.
20348 Unless it's necessary to inspect the LABEL parameter, it is better
20349 to set the variable `align_labels' in the target's
20350 `OVERRIDE_OPTIONS'. Otherwise, you should try to honor the user's
20351 selection in `align_labels' in a `LABEL_ALIGN' implementation.
20353 - Macro: LABEL_ALIGN_MAX_SKIP
20354 The maximum number of bytes to skip when applying `LABEL_ALIGN'.
20355 This works only if `ASM_OUTPUT_MAX_SKIP_ALIGN' is defined.
20357 - Macro: ASM_OUTPUT_SKIP (STREAM, NBYTES)
20358 A C statement to output to the stdio stream STREAM an assembler
20359 instruction to advance the location counter by NBYTES bytes.
20360 Those bytes should be zero when loaded. NBYTES will be a C
20361 expression of type `int'.
20363 - Macro: ASM_NO_SKIP_IN_TEXT
20364 Define this macro if `ASM_OUTPUT_SKIP' should not be used in the
20365 text section because it fails to put zeros in the bytes that are
20366 skipped. This is true on many Unix systems, where the pseudo-op
20367 to skip bytes produces no-op instructions rather than zeros when
20368 used in the text section.
20370 - Macro: ASM_OUTPUT_ALIGN (STREAM, POWER)
20371 A C statement to output to the stdio stream STREAM an assembler
20372 command to advance the location counter to a multiple of 2 to the
20373 POWER bytes. POWER will be a C expression of type `int'.
20375 - Macro: ASM_OUTPUT_ALIGN_WITH_NOP (STREAM, POWER)
20376 Like `ASM_OUTPUT_ALIGN', except that the "nop" instruction is used
20377 for padding, if necessary.
20379 - Macro: ASM_OUTPUT_MAX_SKIP_ALIGN (STREAM, POWER, MAX_SKIP)
20380 A C statement to output to the stdio stream STREAM an assembler
20381 command to advance the location counter to a multiple of 2 to the
20382 POWER bytes, but only if MAX_SKIP or fewer bytes are needed to
20383 satisfy the alignment request. POWER and MAX_SKIP will be a C
20384 expression of type `int'.
20387 File: gccint.info, Node: Debugging Info, Next: Floating Point, Prev: Assembler Format, Up: Target Macros
20389 Controlling Debugging Information Format
20390 ========================================
20392 This describes how to specify debugging information.
20396 * All Debuggers:: Macros that affect all debugging formats uniformly.
20397 * DBX Options:: Macros enabling specific options in DBX format.
20398 * DBX Hooks:: Hook macros for varying DBX format.
20399 * File Names and DBX:: Macros controlling output of file names in DBX format.
20400 * SDB and DWARF:: Macros for SDB (COFF) and DWARF formats.
20401 * VMS Debug:: Macros for VMS debug format.
20404 File: gccint.info, Node: All Debuggers, Next: DBX Options, Up: Debugging Info
20406 Macros Affecting All Debugging Formats
20407 --------------------------------------
20409 These macros affect all debugging formats.
20411 - Macro: DBX_REGISTER_NUMBER (REGNO)
20412 A C expression that returns the DBX register number for the
20413 compiler register number REGNO. In the default macro provided,
20414 the value of this expression will be REGNO itself. But sometimes
20415 there are some registers that the compiler knows about and DBX
20416 does not, or vice versa. In such cases, some register may need to
20417 have one number in the compiler and another for DBX.
20419 If two registers have consecutive numbers inside GCC, and they can
20420 be used as a pair to hold a multiword value, then they _must_ have
20421 consecutive numbers after renumbering with `DBX_REGISTER_NUMBER'.
20422 Otherwise, debuggers will be unable to access such a pair, because
20423 they expect register pairs to be consecutive in their own
20426 If you find yourself defining `DBX_REGISTER_NUMBER' in way that
20427 does not preserve register pairs, then what you must do instead is
20428 redefine the actual register numbering scheme.
20430 - Macro: DEBUGGER_AUTO_OFFSET (X)
20431 A C expression that returns the integer offset value for an
20432 automatic variable having address X (an RTL expression). The
20433 default computation assumes that X is based on the frame-pointer
20434 and gives the offset from the frame-pointer. This is required for
20435 targets that produce debugging output for DBX or COFF-style
20436 debugging output for SDB and allow the frame-pointer to be
20437 eliminated when the `-g' options is used.
20439 - Macro: DEBUGGER_ARG_OFFSET (OFFSET, X)
20440 A C expression that returns the integer offset value for an
20441 argument having address X (an RTL expression). The nominal offset
20444 - Macro: PREFERRED_DEBUGGING_TYPE
20445 A C expression that returns the type of debugging output GCC should
20446 produce when the user specifies just `-g'. Define this if you
20447 have arranged for GCC to support more than one format of debugging
20448 output. Currently, the allowable values are `DBX_DEBUG',
20449 `SDB_DEBUG', `DWARF_DEBUG', `DWARF2_DEBUG', `XCOFF_DEBUG',
20450 `VMS_DEBUG', and `VMS_AND_DWARF2_DEBUG'.
20452 When the user specifies `-ggdb', GCC normally also uses the value
20453 of this macro to select the debugging output format, but with two
20454 exceptions. If `DWARF2_DEBUGGING_INFO' is defined, GCC uses the
20455 value `DWARF2_DEBUG'. Otherwise, if `DBX_DEBUGGING_INFO' is
20456 defined, GCC uses `DBX_DEBUG'.
20458 The value of this macro only affects the default debugging output;
20459 the user can always get a specific type of output by using
20460 `-gstabs', `-gcoff', `-gdwarf-2', `-gxcoff', or `-gvms'.
20463 File: gccint.info, Node: DBX Options, Next: DBX Hooks, Prev: All Debuggers, Up: Debugging Info
20465 Specific Options for DBX Output
20466 -------------------------------
20468 These are specific options for DBX output.
20470 - Macro: DBX_DEBUGGING_INFO
20471 Define this macro if GCC should produce debugging output for DBX
20472 in response to the `-g' option.
20474 - Macro: XCOFF_DEBUGGING_INFO
20475 Define this macro if GCC should produce XCOFF format debugging
20476 output in response to the `-g' option. This is a variant of DBX
20479 - Macro: DEFAULT_GDB_EXTENSIONS
20480 Define this macro to control whether GCC should by default generate
20481 GDB's extended version of DBX debugging information (assuming
20482 DBX-format debugging information is enabled at all). If you don't
20483 define the macro, the default is 1: always generate the extended
20484 information if there is any occasion to.
20486 - Macro: DEBUG_SYMS_TEXT
20487 Define this macro if all `.stabs' commands should be output while
20488 in the text section.
20490 - Macro: ASM_STABS_OP
20491 A C string constant, including spacing, naming the assembler
20492 pseudo op to use instead of `"\t.stabs\t"' to define an ordinary
20493 debugging symbol. If you don't define this macro, `"\t.stabs\t"'
20494 is used. This macro applies only to DBX debugging information
20497 - Macro: ASM_STABD_OP
20498 A C string constant, including spacing, naming the assembler
20499 pseudo op to use instead of `"\t.stabd\t"' to define a debugging
20500 symbol whose value is the current location. If you don't define
20501 this macro, `"\t.stabd\t"' is used. This macro applies only to
20502 DBX debugging information format.
20504 - Macro: ASM_STABN_OP
20505 A C string constant, including spacing, naming the assembler
20506 pseudo op to use instead of `"\t.stabn\t"' to define a debugging
20507 symbol with no name. If you don't define this macro,
20508 `"\t.stabn\t"' is used. This macro applies only to DBX debugging
20509 information format.
20511 - Macro: DBX_NO_XREFS
20512 Define this macro if DBX on your system does not support the
20513 construct `xsTAGNAME'. On some systems, this construct is used to
20514 describe a forward reference to a structure named TAGNAME. On
20515 other systems, this construct is not supported at all.
20517 - Macro: DBX_CONTIN_LENGTH
20518 A symbol name in DBX-format debugging information is normally
20519 continued (split into two separate `.stabs' directives) when it
20520 exceeds a certain length (by default, 80 characters). On some
20521 operating systems, DBX requires this splitting; on others,
20522 splitting must not be done. You can inhibit splitting by defining
20523 this macro with the value zero. You can override the default
20524 splitting-length by defining this macro as an expression for the
20527 - Macro: DBX_CONTIN_CHAR
20528 Normally continuation is indicated by adding a `\' character to
20529 the end of a `.stabs' string when a continuation follows. To use
20530 a different character instead, define this macro as a character
20531 constant for the character you want to use. Do not define this
20532 macro if backslash is correct for your system.
20534 - Macro: DBX_STATIC_STAB_DATA_SECTION
20535 Define this macro if it is necessary to go to the data section
20536 before outputting the `.stabs' pseudo-op for a non-global static
20539 - Macro: DBX_TYPE_DECL_STABS_CODE
20540 The value to use in the "code" field of the `.stabs' directive for
20541 a typedef. The default is `N_LSYM'.
20543 - Macro: DBX_STATIC_CONST_VAR_CODE
20544 The value to use in the "code" field of the `.stabs' directive for
20545 a static variable located in the text section. DBX format does not
20546 provide any "right" way to do this. The default is `N_FUN'.
20548 - Macro: DBX_REGPARM_STABS_CODE
20549 The value to use in the "code" field of the `.stabs' directive for
20550 a parameter passed in registers. DBX format does not provide any
20551 "right" way to do this. The default is `N_RSYM'.
20553 - Macro: DBX_REGPARM_STABS_LETTER
20554 The letter to use in DBX symbol data to identify a symbol as a
20555 parameter passed in registers. DBX format does not customarily
20556 provide any way to do this. The default is `'P''.
20558 - Macro: DBX_MEMPARM_STABS_LETTER
20559 The letter to use in DBX symbol data to identify a symbol as a
20560 stack parameter. The default is `'p''.
20562 - Macro: DBX_FUNCTION_FIRST
20563 Define this macro if the DBX information for a function and its
20564 arguments should precede the assembler code for the function.
20565 Normally, in DBX format, the debugging information entirely
20566 follows the assembler code.
20568 - Macro: DBX_BLOCKS_FUNCTION_RELATIVE
20569 Define this macro if the value of a symbol describing the scope of
20570 a block (`N_LBRAC' or `N_RBRAC') should be relative to the start
20571 of the enclosing function. Normally, GCC uses an absolute address.
20573 - Macro: DBX_USE_BINCL
20574 Define this macro if GCC should generate `N_BINCL' and `N_EINCL'
20575 stabs for included header files, as on Sun systems. This macro
20576 also directs GCC to output a type number as a pair of a file
20577 number and a type number within the file. Normally, GCC does not
20578 generate `N_BINCL' or `N_EINCL' stabs, and it outputs a single
20579 number for a type number.
20582 File: gccint.info, Node: DBX Hooks, Next: File Names and DBX, Prev: DBX Options, Up: Debugging Info
20584 Open-Ended Hooks for DBX Format
20585 -------------------------------
20587 These are hooks for DBX format.
20589 - Macro: DBX_OUTPUT_LBRAC (STREAM, NAME)
20590 Define this macro to say how to output to STREAM the debugging
20591 information for the start of a scope level for variable names. The
20592 argument NAME is the name of an assembler symbol (for use with
20593 `assemble_name') whose value is the address where the scope begins.
20595 - Macro: DBX_OUTPUT_RBRAC (STREAM, NAME)
20596 Like `DBX_OUTPUT_LBRAC', but for the end of a scope level.
20598 - Macro: DBX_OUTPUT_NFUN (STREAM, LSCOPE_LABEL, DECL)
20599 Define this macro if the target machine requires special handling
20600 to output an `N_FUN' entry for the function DECL.
20602 - Macro: DBX_OUTPUT_FUNCTION_END (STREAM, FUNCTION)
20603 Define this macro if the target machine requires special output at
20604 the end of the debugging information for a function. The
20605 definition should be a C statement (sans semicolon) to output the
20606 appropriate information to STREAM. FUNCTION is the
20607 `FUNCTION_DECL' node for the function.
20609 - Macro: DBX_OUTPUT_STANDARD_TYPES (SYMS)
20610 Define this macro if you need to control the order of output of the
20611 standard data types at the beginning of compilation. The argument
20612 SYMS is a `tree' which is a chain of all the predefined global
20613 symbols, including names of data types.
20615 Normally, DBX output starts with definitions of the types for
20616 integers and characters, followed by all the other predefined
20617 types of the particular language in no particular order.
20619 On some machines, it is necessary to output different particular
20620 types first. To do this, define `DBX_OUTPUT_STANDARD_TYPES' to
20621 output those symbols in the necessary order. Any predefined types
20622 that you don't explicitly output will be output afterward in no
20625 Be careful not to define this macro so that it works only for C.
20626 There are no global variables to access most of the built-in
20627 types, because another language may have another set of types.
20628 The way to output a particular type is to look through SYMS to see
20629 if you can find it. Here is an example:
20633 for (decl = syms; decl; decl = TREE_CHAIN (decl))
20634 if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
20636 dbxout_symbol (decl);
20640 This does nothing if the expected type does not exist.
20642 See the function `init_decl_processing' in `c-decl.c' to find the
20643 names to use for all the built-in C types.
20645 Here is another way of finding a particular type:
20649 for (decl = syms; decl; decl = TREE_CHAIN (decl))
20650 if (TREE_CODE (decl) == TYPE_DECL
20651 && (TREE_CODE (TREE_TYPE (decl))
20653 && TYPE_PRECISION (TREE_TYPE (decl)) == 16
20654 && TYPE_UNSIGNED (TREE_TYPE (decl)))
20655 /* This must be `unsigned short'. */
20656 dbxout_symbol (decl);
20660 - Macro: NO_DBX_FUNCTION_END
20661 Some stabs encapsulation formats (in particular ECOFF), cannot
20662 handle the `.stabs "",N_FUN,,0,0,Lscope-function-1' gdb dbx
20663 extension construct. On those machines, define this macro to turn
20664 this feature off without disturbing the rest of the gdb extensions.
20667 File: gccint.info, Node: File Names and DBX, Next: SDB and DWARF, Prev: DBX Hooks, Up: Debugging Info
20669 File Names in DBX Format
20670 ------------------------
20672 This describes file names in DBX format.
20674 - Macro: DBX_OUTPUT_MAIN_SOURCE_FILENAME (STREAM, NAME)
20675 A C statement to output DBX debugging information to the stdio
20676 stream STREAM which indicates that file NAME is the main source
20677 file--the file specified as the input file for compilation. This
20678 macro is called only once, at the beginning of compilation.
20680 This macro need not be defined if the standard form of output for
20681 DBX debugging information is appropriate.
20683 - Macro: DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (STREAM, NAME)
20684 A C statement to output DBX debugging information to the stdio
20685 stream STREAM which indicates that the current directory during
20686 compilation is named NAME.
20688 This macro need not be defined if the standard form of output for
20689 DBX debugging information is appropriate.
20691 - Macro: DBX_OUTPUT_MAIN_SOURCE_FILE_END (STREAM, NAME)
20692 A C statement to output DBX debugging information at the end of
20693 compilation of the main source file NAME.
20695 If you don't define this macro, nothing special is output at the
20696 end of compilation, which is correct for most machines.
20699 File: gccint.info, Node: SDB and DWARF, Next: VMS Debug, Prev: File Names and DBX, Up: Debugging Info
20701 Macros for SDB and DWARF Output
20702 -------------------------------
20704 Here are macros for SDB and DWARF output.
20706 - Macro: SDB_DEBUGGING_INFO
20707 Define this macro if GCC should produce COFF-style debugging output
20708 for SDB in response to the `-g' option.
20710 - Macro: DWARF2_DEBUGGING_INFO
20711 Define this macro if GCC should produce dwarf version 2 format
20712 debugging output in response to the `-g' option.
20714 To support optional call frame debugging information, you must also
20715 define `INCOMING_RETURN_ADDR_RTX' and either set
20716 `RTX_FRAME_RELATED_P' on the prologue insns if you use RTL for the
20717 prologue, or call `dwarf2out_def_cfa' and `dwarf2out_reg_save' as
20718 appropriate from `TARGET_ASM_FUNCTION_PROLOGUE' if you don't.
20720 - Macro: DWARF2_FRAME_INFO
20721 Define this macro to a nonzero value if GCC should always output
20722 Dwarf 2 frame information. If `DWARF2_UNWIND_INFO' (*note
20723 Exception Region Output:: is nonzero, GCC will output this
20724 information not matter how you define `DWARF2_FRAME_INFO'.
20726 - Macro: DWARF2_GENERATE_TEXT_SECTION_LABEL
20727 By default, the Dwarf 2 debugging information generator will
20728 generate a label to mark the beginning of the text section. If it
20729 is better simply to use the name of the text section itself,
20730 rather than an explicit label, to indicate the beginning of the
20731 text section, define this macro to zero.
20733 - Macro: DWARF2_ASM_LINE_DEBUG_INFO
20734 Define this macro to be a nonzero value if the assembler can
20735 generate Dwarf 2 line debug info sections. This will result in
20736 much more compact line number tables, and hence is desirable if it
20739 - Macro: ASM_OUTPUT_DWARF_DELTA (STREAM, SIZE, LABEL1, LABEL2)
20740 A C statement to issue assembly directives that create a difference
20741 between the two given labels, using an integer of the given size.
20743 - Macro: ASM_OUTPUT_DWARF_OFFSET (STREAM, SIZE, LABEL)
20744 A C statement to issue assembly directives that create a
20745 section-relative reference to the given label, using an integer of
20748 - Macro: ASM_OUTPUT_DWARF_PCREL (STREAM, SIZE, LABEL)
20749 A C statement to issue assembly directives that create a
20750 self-relative reference to the given label, using an integer of
20753 - Macro: PUT_SDB_...
20754 Define these macros to override the assembler syntax for the
20755 special SDB assembler directives. See `sdbout.c' for a list of
20756 these macros and their arguments. If the standard syntax is used,
20757 you need not define them yourself.
20760 Some assemblers do not support a semicolon as a delimiter, even
20761 between SDB assembler directives. In that case, define this macro
20762 to be the delimiter to use (usually `\n'). It is not necessary to
20763 define a new set of `PUT_SDB_OP' macros if this is the only change
20766 - Macro: SDB_GENERATE_FAKE
20767 Define this macro to override the usual method of constructing a
20768 dummy name for anonymous structure and union types. See
20769 `sdbout.c' for more information.
20771 - Macro: SDB_ALLOW_UNKNOWN_REFERENCES
20772 Define this macro to allow references to unknown structure, union,
20773 or enumeration tags to be emitted. Standard COFF does not allow
20774 handling of unknown references, MIPS ECOFF has support for it.
20776 - Macro: SDB_ALLOW_FORWARD_REFERENCES
20777 Define this macro to allow references to structure, union, or
20778 enumeration tags that have not yet been seen to be handled. Some
20779 assemblers choke if forward tags are used, while some require it.
20782 File: gccint.info, Node: VMS Debug, Prev: SDB and DWARF, Up: Debugging Info
20784 Macros for VMS Debug Format
20785 ---------------------------
20787 Here are macros for VMS debug format.
20789 - Macro: VMS_DEBUGGING_INFO
20790 Define this macro if GCC should produce debugging output for VMS
20791 in response to the `-g' option. The default behavior for VMS is
20792 to generate minimal debug info for a traceback in the absence of
20793 `-g' unless explicitly overridden with `-g0'. This behavior is
20794 controlled by `OPTIMIZATION_OPTIONS' and `OVERRIDE_OPTIONS'.
20797 File: gccint.info, Node: Floating Point, Next: Mode Switching, Prev: Debugging Info, Up: Target Macros
20799 Cross Compilation and Floating Point
20800 ====================================
20802 While all modern machines use twos-complement representation for
20803 integers, there are a variety of representations for floating point
20804 numbers. This means that in a cross-compiler the representation of
20805 floating point numbers in the compiled program may be different from
20806 that used in the machine doing the compilation.
20808 Because different representation systems may offer different amounts
20809 of range and precision, all floating point constants must be
20810 represented in the target machine's format. Therefore, the cross
20811 compiler cannot safely use the host machine's floating point
20812 arithmetic; it must emulate the target's arithmetic. To ensure
20813 consistency, GCC always uses emulation to work with floating point
20814 values, even when the host and target floating point formats are
20817 The following macros are provided by `real.h' for the compiler to
20818 use. All parts of the compiler which generate or optimize
20819 floating-point calculations must use these macros. They may evaluate
20820 their operands more than once, so operands must not have side effects.
20822 - Macro: REAL_VALUE_TYPE
20823 The C data type to be used to hold a floating point value in the
20824 target machine's format. Typically this is a `struct' containing
20825 an array of `HOST_WIDE_INT', but all code should treat it as an
20828 - Macro: int REAL_VALUES_EQUAL (REAL_VALUE_TYPE X, REAL_VALUE_TYPE Y)
20829 Compares for equality the two values, X and Y. If the target
20830 floating point format supports negative zeroes and/or NaNs,
20831 `REAL_VALUES_EQUAL (-0.0, 0.0)' is true, and `REAL_VALUES_EQUAL
20832 (NaN, NaN)' is false.
20834 - Macro: int REAL_VALUES_LESS (REAL_VALUE_TYPE X, REAL_VALUE_TYPE Y)
20835 Tests whether X is less than Y.
20837 - Macro: HOST_WIDE_INT REAL_VALUE_FIX (REAL_VALUE_TYPE X)
20838 Truncates X to a signed integer, rounding toward zero.
20840 - Macro: unsigned HOST_WIDE_INT REAL_VALUE_UNSIGNED_FIX
20841 (REAL_VALUE_TYPE X)
20842 Truncates X to an unsigned integer, rounding toward zero. If X is
20843 negative, returns zero.
20845 - Macro: REAL_VALUE_TYPE REAL_VALUE_ATOF (const char *STRING, enum
20847 Converts STRING into a floating point number in the target
20848 machine's representation for mode MODE. This routine can handle
20849 both decimal and hexadecimal floating point constants, using the
20850 syntax defined by the C language for both.
20852 - Macro: int REAL_VALUE_NEGATIVE (REAL_VALUE_TYPE X)
20853 Returns 1 if X is negative (including negative zero), 0 otherwise.
20855 - Macro: int REAL_VALUE_ISINF (REAL_VALUE_TYPE X)
20856 Determines whether X represents infinity (positive or negative).
20858 - Macro: int REAL_VALUE_ISNAN (REAL_VALUE_TYPE X)
20859 Determines whether X represents a "NaN" (not-a-number).
20861 - Macro: void REAL_ARITHMETIC (REAL_VALUE_TYPE OUTPUT, enum tree_code
20862 CODE, REAL_VALUE_TYPE X, REAL_VALUE_TYPE Y)
20863 Calculates an arithmetic operation on the two floating point values
20864 X and Y, storing the result in OUTPUT (which must be a variable).
20866 The operation to be performed is specified by CODE. Only the
20867 following codes are supported: `PLUS_EXPR', `MINUS_EXPR',
20868 `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'.
20870 If `REAL_ARITHMETIC' is asked to evaluate division by zero and the
20871 target's floating point format cannot represent infinity, it will
20872 call `abort'. Callers should check for this situation first, using
20873 `MODE_HAS_INFINITIES'. *Note Storage Layout::.
20875 - Macro: REAL_VALUE_TYPE REAL_VALUE_NEGATE (REAL_VALUE_TYPE X)
20876 Returns the negative of the floating point value X.
20878 - Macro: REAL_VALUE_TYPE REAL_VALUE_ABS (REAL_VALUE_TYPE X)
20879 Returns the absolute value of X.
20881 - Macro: REAL_VALUE_TYPE REAL_VALUE_TRUNCATE (REAL_VALUE_TYPE MODE,
20882 enum machine_mode X)
20883 Truncates the floating point value X to fit in MODE. The return
20884 value is still a full-size `REAL_VALUE_TYPE', but it has an
20885 appropriate bit pattern to be output asa floating constant whose
20886 precision accords with mode MODE.
20888 - Macro: void REAL_VALUE_TO_INT (HOST_WIDE_INT LOW, HOST_WIDE_INT
20889 HIGH, REAL_VALUE_TYPE X)
20890 Converts a floating point value X into a double-precision integer
20891 which is then stored into LOW and HIGH. If the value is not
20892 integral, it is truncated.
20894 - Macro: void REAL_VALUE_FROM_INT (REAL_VALUE_TYPE X, HOST_WIDE_INT
20895 LOW, HOST_WIDE_INT HIGH, enum machine_mode MODE)
20896 Converts a double-precision integer found in LOW and HIGH, into a
20897 floating point value which is then stored into X. The value is
20898 truncated to fit in mode MODE.
20901 File: gccint.info, Node: Mode Switching, Next: Target Attributes, Prev: Floating Point, Up: Target Macros
20903 Mode Switching Instructions
20904 ===========================
20906 The following macros control mode switching optimizations:
20908 - Macro: OPTIMIZE_MODE_SWITCHING (ENTITY)
20909 Define this macro if the port needs extra instructions inserted
20910 for mode switching in an optimizing compilation.
20912 For an example, the SH4 can perform both single and double
20913 precision floating point operations, but to perform a single
20914 precision operation, the FPSCR PR bit has to be cleared, while for
20915 a double precision operation, this bit has to be set. Changing
20916 the PR bit requires a general purpose register as a scratch
20917 register, hence these FPSCR sets have to be inserted before
20918 reload, i.e. you can't put this into instruction emitting or
20919 `TARGET_MACHINE_DEPENDENT_REORG'.
20921 You can have multiple entities that are mode-switched, and select
20922 at run time which entities actually need it.
20923 `OPTIMIZE_MODE_SWITCHING' should return nonzero for any ENTITY
20924 that needs mode-switching. If you define this macro, you also
20925 have to define `NUM_MODES_FOR_MODE_SWITCHING', `MODE_NEEDED',
20926 `MODE_PRIORITY_TO_MODE' and `EMIT_MODE_SET'. `MODE_AFTER',
20927 `MODE_ENTRY', and `MODE_EXIT' are optional.
20929 - Macro: NUM_MODES_FOR_MODE_SWITCHING
20930 If you define `OPTIMIZE_MODE_SWITCHING', you have to define this as
20931 initializer for an array of integers. Each initializer element N
20932 refers to an entity that needs mode switching, and specifies the
20933 number of different modes that might need to be set for this
20934 entity. The position of the initializer in the initializer -
20935 starting counting at zero - determines the integer that is used to
20936 refer to the mode-switched entity in question. In macros that
20937 take mode arguments / yield a mode result, modes are represented
20938 as numbers 0 ... N - 1. N is used to specify that no mode switch
20939 is needed / supplied.
20941 - Macro: MODE_NEEDED (ENTITY, INSN)
20942 ENTITY is an integer specifying a mode-switched entity. If
20943 `OPTIMIZE_MODE_SWITCHING' is defined, you must define this macro to
20944 return an integer value not larger than the corresponding element
20945 in `NUM_MODES_FOR_MODE_SWITCHING', to denote the mode that ENTITY
20946 must be switched into prior to the execution of INSN.
20948 - Macro: MODE_AFTER (MODE, INSN)
20949 If this macro is defined, it is evaluated for every INSN during
20950 mode switching. It determines the mode that an insn results in (if
20951 different from the incoming mode).
20953 - Macro: MODE_ENTRY (ENTITY)
20954 If this macro is defined, it is evaluated for every ENTITY that
20955 needs mode switching. It should evaluate to an integer, which is a
20956 mode that ENTITY is assumed to be switched to at function entry.
20957 If `MODE_ENTRY' is defined then `MODE_EXIT' must be defined.
20959 - Macro: MODE_EXIT (ENTITY)
20960 If this macro is defined, it is evaluated for every ENTITY that
20961 needs mode switching. It should evaluate to an integer, which is a
20962 mode that ENTITY is assumed to be switched to at function exit. If
20963 `MODE_EXIT' is defined then `MODE_ENTRY' must be defined.
20965 - Macro: MODE_PRIORITY_TO_MODE (ENTITY, N)
20966 This macro specifies the order in which modes for ENTITY are
20967 processed. 0 is the highest priority,
20968 `NUM_MODES_FOR_MODE_SWITCHING[ENTITY] - 1' the lowest. The value
20969 of the macro should be an integer designating a mode for ENTITY.
20970 For any fixed ENTITY, `mode_priority_to_mode' (ENTITY, N) shall be
20971 a bijection in 0 ... `num_modes_for_mode_switching[ENTITY] - 1'.
20973 - Macro: EMIT_MODE_SET (ENTITY, MODE, HARD_REGS_LIVE)
20974 Generate one or more insns to set ENTITY to MODE. HARD_REG_LIVE
20975 is the set of hard registers live at the point where the insn(s)
20976 are to be inserted.
20979 File: gccint.info, Node: Target Attributes, Next: MIPS Coprocessors, Prev: Mode Switching, Up: Target Macros
20981 Defining target-specific uses of `__attribute__'
20982 ================================================
20984 Target-specific attributes may be defined for functions, data and
20985 types. These are described using the following target hooks; they also
20986 need to be documented in `extend.texi'.
20988 - Target Hook: const struct attribute_spec * TARGET_ATTRIBUTE_TABLE
20989 If defined, this target hook points to an array of `struct
20990 attribute_spec' (defined in `tree.h') specifying the machine
20991 specific attributes for this target and some of the restrictions
20992 on the entities to which these attributes are applied and the
20993 arguments they take.
20995 - Target Hook: int TARGET_COMP_TYPE_ATTRIBUTES (tree TYPE1, tree TYPE2)
20996 If defined, this target hook is a function which returns zero if
20997 the attributes on TYPE1 and TYPE2 are incompatible, one if they
20998 are compatible, and two if they are nearly compatible (which
20999 causes a warning to be generated). If this is not defined,
21000 machine-specific attributes are supposed always to be compatible.
21002 - Target Hook: void TARGET_SET_DEFAULT_TYPE_ATTRIBUTES (tree TYPE)
21003 If defined, this target hook is a function which assigns default
21004 attributes to newly defined TYPE.
21006 - Target Hook: tree TARGET_MERGE_TYPE_ATTRIBUTES (tree TYPE1, tree
21008 Define this target hook if the merging of type attributes needs
21009 special handling. If defined, the result is a list of the combined
21010 `TYPE_ATTRIBUTES' of TYPE1 and TYPE2. It is assumed that
21011 `comptypes' has already been called and returned 1. This function
21012 may call `merge_attributes' to handle machine-independent merging.
21014 - Target Hook: tree TARGET_MERGE_DECL_ATTRIBUTES (tree OLDDECL, tree
21016 Define this target hook if the merging of decl attributes needs
21017 special handling. If defined, the result is a list of the combined
21018 `DECL_ATTRIBUTES' of OLDDECL and NEWDECL. NEWDECL is a duplicate
21019 declaration of OLDDECL. Examples of when this is needed are when
21020 one attribute overrides another, or when an attribute is nullified
21021 by a subsequent definition. This function may call
21022 `merge_attributes' to handle machine-independent merging.
21024 If the only target-specific handling you require is `dllimport' for
21025 Microsoft Windows targets, you should define the macro
21026 `TARGET_DLLIMPORT_DECL_ATTRIBUTES'. This links in a function
21027 called `merge_dllimport_decl_attributes' which can then be defined
21028 as the expansion of `TARGET_MERGE_DECL_ATTRIBUTES'. This is done
21029 in `i386/cygwin.h' and `i386/i386.c', for example.
21031 - Target Hook: void TARGET_INSERT_ATTRIBUTES (tree NODE, tree
21033 Define this target hook if you want to be able to add attributes
21034 to a decl when it is being created. This is normally useful for
21035 back ends which wish to implement a pragma by using the attributes
21036 which correspond to the pragma's effect. The NODE argument is the
21037 decl which is being created. The ATTR_PTR argument is a pointer
21038 to the attribute list for this decl. The list itself should not
21039 be modified, since it may be shared with other decls, but
21040 attributes may be chained on the head of the list and `*ATTR_PTR'
21041 modified to point to the new attributes, or a copy of the list may
21042 be made if further changes are needed.
21044 - Target Hook: bool TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P (tree FNDECL)
21045 This target hook returns `true' if it is ok to inline FNDECL into
21046 the current function, despite its having target-specific
21047 attributes, `false' otherwise. By default, if a function has a
21048 target specific attribute attached to it, it will not be inlined.
21051 File: gccint.info, Node: MIPS Coprocessors, Next: PCH Target, Prev: Target Attributes, Up: Target Macros
21053 Defining coprocessor specifics for MIPS targets.
21054 ================================================
21056 The MIPS specification allows MIPS implementations to have as many
21057 as 4 coprocessors, each with as many as 32 private registers. GCC
21058 supports accessing these registers and transferring values between the
21059 registers and memory using asm-ized variables. For example:
21061 register unsigned int cp0count asm ("c0r1");
21066 ("c0r1" is the default name of register 1 in coprocessor 0; alternate
21067 names may be added as described below, or the default names may be
21068 overridden entirely in `SUBTARGET_CONDITIONAL_REGISTER_USAGE'.)
21070 Coprocessor registers are assumed to be epilogue-used; sets to them
21071 will be preserved even if it does not appear that the register is used
21072 again later in the function.
21074 Another note: according to the MIPS spec, coprocessor 1 (if present)
21075 is the FPU. One accesses COP1 registers through standard mips
21076 floating-point support; they are not included in this mechanism.
21078 There is one macro used in defining the MIPS coprocessor interface
21079 which you may want to override in subtargets; it is described below.
21081 - Macro: ALL_COP_ADDITIONAL_REGISTER_NAMES
21082 A comma-separated list (with leading comma) of pairs describing the
21083 alternate names of coprocessor registers. The format of each
21085 { ALTERNATENAME, REGISTER_NUMBER}
21089 File: gccint.info, Node: PCH Target, Next: Misc, Prev: MIPS Coprocessors, Up: Target Macros
21091 Parameters for Precompiled Header Validity Checking
21092 ===================================================
21094 - Target Hook: void * TARGET_GET_PCH_VALIDITY (size_t * SZ)
21095 Define this hook if your target needs to check a different
21096 collection of flags than the default, which is every flag defined
21097 by `TARGET_SWITCHES' and `TARGET_OPTIONS'. It should return some
21098 data which will be saved in the PCH file and presented to
21099 `TARGET_PCH_VALID_P' later; it should set `SZ' to the size of the
21102 - Target Hook: const char * TARGET_PCH_VALID_P (const void * DATA,
21104 Define this hook if your target needs to check a different
21105 collection of flags than the default, which is every flag defined
21106 by `TARGET_SWITCHES' and `TARGET_OPTIONS'. It is given data which
21107 came from `TARGET_GET_PCH_VALIDITY' (in this version of this
21108 compiler, so there is no need for extensive validity checking).
21109 It returns `NULL' if it is safe to load a PCH file with this data,
21110 or a suitable error message if not. The error message will be
21111 presented to the user, so it should be localized.
21114 File: gccint.info, Node: Misc, Prev: PCH Target, Up: Target Macros
21116 Miscellaneous Parameters
21117 ========================
21119 Here are several miscellaneous parameters.
21121 - Macro: PREDICATE_CODES
21122 Define this if you have defined special-purpose predicates in the
21123 file `MACHINE.c'. This macro is called within an initializer of an
21124 array of structures. The first field in the structure is the name
21125 of a predicate and the second field is an array of rtl codes. For
21126 each predicate, list all rtl codes that can be in expressions
21127 matched by the predicate. The list should have a trailing comma.
21128 Here is an example of two entries in the list for a typical RISC
21131 #define PREDICATE_CODES \
21132 {"gen_reg_rtx_operand", {SUBREG, REG}}, \
21133 {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
21135 Defining this macro does not affect the generated code (however,
21136 incorrect definitions that omit an rtl code that may be matched by
21137 the predicate can cause the compiler to malfunction). Instead, it
21138 allows the table built by `genrecog' to be more compact and
21139 efficient, thus speeding up the compiler. The most important
21140 predicates to include in the list specified by this macro are
21141 those used in the most insn patterns.
21143 For each predicate function named in `PREDICATE_CODES', a
21144 declaration will be generated in `insn-codes.h'.
21146 - Macro: SPECIAL_MODE_PREDICATES
21147 Define this if you have special predicates that know special things
21148 about modes. Genrecog will warn about certain forms of
21149 `match_operand' without a mode; if the operand predicate is listed
21150 in `SPECIAL_MODE_PREDICATES', the warning will be suppressed.
21152 Here is an example from the IA-32 port (`ext_register_operand'
21153 specially checks for `HImode' or `SImode' in preparation for a
21154 byte extraction from `%ah' etc.).
21156 #define SPECIAL_MODE_PREDICATES \
21157 "ext_register_operand",
21159 - Macro: CASE_VECTOR_MODE
21160 An alias for a machine mode name. This is the machine mode that
21161 elements of a jump-table should have.
21163 - Macro: CASE_VECTOR_SHORTEN_MODE (MIN_OFFSET, MAX_OFFSET, BODY)
21164 Optional: return the preferred mode for an `addr_diff_vec' when
21165 the minimum and maximum offset are known. If you define this, it
21166 enables extra code in branch shortening to deal with
21167 `addr_diff_vec'. To make this work, you also have to define
21168 `INSN_ALIGN' and make the alignment for `addr_diff_vec' explicit.
21169 The BODY argument is provided so that the offset_unsigned and scale
21170 flags can be updated.
21172 - Macro: CASE_VECTOR_PC_RELATIVE
21173 Define this macro to be a C expression to indicate when jump-tables
21174 should contain relative addresses. You need not define this macro
21175 if jump-tables never contain relative addresses, or jump-tables
21176 should contain relative addresses only when `-fPIC' or `-fPIC' is
21179 - Macro: CASE_DROPS_THROUGH
21180 Define this if control falls through a `case' insn when the index
21181 value is out of range. This means the specified default-label is
21182 actually ignored by the `case' insn proper.
21184 - Macro: CASE_VALUES_THRESHOLD
21185 Define this to be the smallest number of different values for
21186 which it is best to use a jump-table instead of a tree of
21187 conditional branches. The default is four for machines with a
21188 `casesi' instruction and five otherwise. This is best for most
21191 - Macro: CASE_USE_BIT_TESTS
21192 Define this macro to be a C expression to indicate whether C switch
21193 statements may be implemented by a sequence of bit tests. This is
21194 advantageous on processors that can efficiently implement left
21195 shift of 1 by the number of bits held in a register, but
21196 inappropriate on targets that would require a loop. By default,
21197 this macro returns `true' if the target defines an `ashlsi3'
21198 pattern, and `false' otherwise.
21200 - Macro: WORD_REGISTER_OPERATIONS
21201 Define this macro if operations between registers with integral
21202 mode smaller than a word are always performed on the entire
21203 register. Most RISC machines have this property and most CISC
21206 - Macro: LOAD_EXTEND_OP (MEM_MODE)
21207 Define this macro to be a C expression indicating when insns that
21208 read memory in MEM_MODE, an integral mode narrower than a word,
21209 set the bits outside of MEM_MODE to be either the sign-extension
21210 or the zero-extension of the data read. Return `SIGN_EXTEND' for
21211 values of MEM_MODE for which the insn sign-extends, `ZERO_EXTEND'
21212 for which it zero-extends, and `NIL' for other modes.
21214 This macro is not called with MEM_MODE non-integral or with a width
21215 greater than or equal to `BITS_PER_WORD', so you may return any
21216 value in this case. Do not define this macro if it would always
21217 return `NIL'. On machines where this macro is defined, you will
21218 normally define it as the constant `SIGN_EXTEND' or `ZERO_EXTEND'.
21220 You may return a non-`NIL' value even if for some hard registers
21221 the sign extension is not performed, if for the `REGNO_REG_CLASS'
21222 of these hard registers `CANNOT_CHANGE_MODE_CLASS' returns nonzero
21223 when the FROM mode is MEM_MODE and the TO mode is any integral
21224 mode larger than this but not larger than `word_mode'.
21226 You must return `NIL' if for some hard registers that allow this
21227 mode, `CANNOT_CHANGE_MODE_CLASS' says that they cannot change to
21228 `word_mode', but that they can change to another integral mode that
21229 is larger then MEM_MODE but still smaller than `word_mode'.
21231 - Macro: SHORT_IMMEDIATES_SIGN_EXTEND
21232 Define this macro if loading short immediate values into registers
21235 - Macro: FIXUNS_TRUNC_LIKE_FIX_TRUNC
21236 Define this macro if the same instructions that convert a floating
21237 point number to a signed fixed point number also convert validly
21238 to an unsigned one.
21241 The maximum number of bytes that a single instruction can move
21242 quickly between memory and registers or between two memory
21245 - Macro: MAX_MOVE_MAX
21246 The maximum number of bytes that a single instruction can move
21247 quickly between memory and registers or between two memory
21248 locations. If this is undefined, the default is `MOVE_MAX'.
21249 Otherwise, it is the constant value that is the largest value that
21250 `MOVE_MAX' can have at run-time.
21252 - Macro: SHIFT_COUNT_TRUNCATED
21253 A C expression that is nonzero if on this machine the number of
21254 bits actually used for the count of a shift operation is equal to
21255 the number of bits needed to represent the size of the object
21256 being shifted. When this macro is nonzero, the compiler will
21257 assume that it is safe to omit a sign-extend, zero-extend, and
21258 certain bitwise `and' instructions that truncates the count of a
21259 shift operation. On machines that have instructions that act on
21260 bit-fields at variable positions, which may include `bit test'
21261 instructions, a nonzero `SHIFT_COUNT_TRUNCATED' also enables
21262 deletion of truncations of the values that serve as arguments to
21263 bit-field instructions.
21265 If both types of instructions truncate the count (for shifts) and
21266 position (for bit-field operations), or if no variable-position
21267 bit-field instructions exist, you should define this macro.
21269 However, on some machines, such as the 80386 and the 680x0,
21270 truncation only applies to shift operations and not the (real or
21271 pretended) bit-field operations. Define `SHIFT_COUNT_TRUNCATED'
21272 to be zero on such machines. Instead, add patterns to the `md'
21273 file that include the implied truncation of the shift instructions.
21275 You need not define this macro if it would always have the value
21278 - Macro: TRULY_NOOP_TRUNCATION (OUTPREC, INPREC)
21279 A C expression which is nonzero if on this machine it is safe to
21280 "convert" an integer of INPREC bits to one of OUTPREC bits (where
21281 OUTPREC is smaller than INPREC) by merely operating on it as if it
21282 had only OUTPREC bits.
21284 On many machines, this expression can be 1.
21286 When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
21287 modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
21288 If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
21289 such cases may improve things.
21291 - Macro: STORE_FLAG_VALUE
21292 A C expression describing the value returned by a comparison
21293 operator with an integral mode and stored by a store-flag
21294 instruction (`sCOND') when the condition is true. This
21295 description must apply to _all_ the `sCOND' patterns and all the
21296 comparison operators whose results have a `MODE_INT' mode.
21298 A value of 1 or -1 means that the instruction implementing the
21299 comparison operator returns exactly 1 or -1 when the comparison is
21300 true and 0 when the comparison is false. Otherwise, the value
21301 indicates which bits of the result are guaranteed to be 1 when the
21302 comparison is true. This value is interpreted in the mode of the
21303 comparison operation, which is given by the mode of the first
21304 operand in the `sCOND' pattern. Either the low bit or the sign
21305 bit of `STORE_FLAG_VALUE' be on. Presently, only those bits are
21306 used by the compiler.
21308 If `STORE_FLAG_VALUE' is neither 1 or -1, the compiler will
21309 generate code that depends only on the specified bits. It can also
21310 replace comparison operators with equivalent operations if they
21311 cause the required bits to be set, even if the remaining bits are
21312 undefined. For example, on a machine whose comparison operators
21313 return an `SImode' value and where `STORE_FLAG_VALUE' is defined as
21314 `0x80000000', saying that just the sign bit is relevant, the
21317 (ne:SI (and:SI X (const_int POWER-OF-2)) (const_int 0))
21319 can be converted to
21321 (ashift:SI X (const_int N))
21323 where N is the appropriate shift count to move the bit being
21324 tested into the sign bit.
21326 There is no way to describe a machine that always sets the
21327 low-order bit for a true value, but does not guarantee the value
21328 of any other bits, but we do not know of any machine that has such
21329 an instruction. If you are trying to port GCC to such a machine,
21330 include an instruction to perform a logical-and of the result with
21331 1 in the pattern for the comparison operators and let us know at
21334 Often, a machine will have multiple instructions that obtain a
21335 value from a comparison (or the condition codes). Here are rules
21336 to guide the choice of value for `STORE_FLAG_VALUE', and hence the
21337 instructions to be used:
21339 * Use the shortest sequence that yields a valid definition for
21340 `STORE_FLAG_VALUE'. It is more efficient for the compiler to
21341 "normalize" the value (convert it to, e.g., 1 or 0) than for
21342 the comparison operators to do so because there may be
21343 opportunities to combine the normalization with other
21346 * For equal-length sequences, use a value of 1 or -1, with -1
21347 being slightly preferred on machines with expensive jumps and
21348 1 preferred on other machines.
21350 * As a second choice, choose a value of `0x80000001' if
21351 instructions exist that set both the sign and low-order bits
21352 but do not define the others.
21354 * Otherwise, use a value of `0x80000000'.
21356 Many machines can produce both the value chosen for
21357 `STORE_FLAG_VALUE' and its negation in the same number of
21358 instructions. On those machines, you should also define a pattern
21359 for those cases, e.g., one matching
21361 (set A (neg:M (ne:M B C)))
21363 Some machines can also perform `and' or `plus' operations on
21364 condition code values with less instructions than the corresponding
21365 `sCOND' insn followed by `and' or `plus'. On those machines,
21366 define the appropriate patterns. Use the names `incscc' and
21367 `decscc', respectively, for the patterns which perform `plus' or
21368 `minus' operations on condition code values. See `rs6000.md' for
21369 some examples. The GNU Superoptizer can be used to find such
21370 instruction sequences on other machines.
21372 If this macro is not defined, the default value, 1, is used. You
21373 need not define `STORE_FLAG_VALUE' if the machine has no store-flag
21374 instructions, or if the value generated by these instructions is 1.
21376 - Macro: FLOAT_STORE_FLAG_VALUE (MODE)
21377 A C expression that gives a nonzero `REAL_VALUE_TYPE' value that is
21378 returned when comparison operators with floating-point results are
21379 true. Define this macro on machine that have comparison
21380 operations that return floating-point values. If there are no
21381 such operations, do not define this macro.
21383 - Macro: CLZ_DEFINED_VALUE_AT_ZERO (MODE, VALUE)
21384 - Macro: CTZ_DEFINED_VALUE_AT_ZERO (MODE, VALUE)
21385 A C expression that evaluates to true if the architecture defines
21386 a value for `clz' or `ctz' with a zero operand. If so, VALUE
21387 should be set to this value. If this macro is not defined, the
21388 value of `clz' or `ctz' is assumed to be undefined.
21390 This macro must be defined if the target's expansion for `ffs'
21391 relies on a particular value to get correct results. Otherwise it
21392 is not necessary, though it may be used to optimize some corner
21395 Note that regardless of this macro the "definedness" of `clz' and
21396 `ctz' at zero do _not_ extend to the builtin functions visible to
21397 the user. Thus one may be free to adjust the value at will to
21398 match the target expansion of these operations without fear of
21402 An alias for the machine mode for pointers. On most machines,
21403 define this to be the integer mode corresponding to the width of a
21404 hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit
21405 machines. On some machines you must define this to be one of the
21406 partial integer modes, such as `PSImode'.
21408 The width of `Pmode' must be at least as large as the value of
21409 `POINTER_SIZE'. If it is not equal, you must define the macro
21410 `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to
21413 - Macro: FUNCTION_MODE
21414 An alias for the machine mode used for memory references to
21415 functions being called, in `call' RTL expressions. On most
21416 machines this should be `QImode'.
21418 - Macro: INTEGRATE_THRESHOLD (DECL)
21419 A C expression for the maximum number of instructions above which
21420 the function DECL should not be inlined. DECL is a
21421 `FUNCTION_DECL' node.
21423 The default definition of this macro is 64 plus 8 times the number
21424 of arguments that the function accepts. Some people think a larger
21425 threshold should be used on RISC machines.
21427 - Macro: STDC_0_IN_SYSTEM_HEADERS
21428 In normal operation, the preprocessor expands `__STDC__' to the
21429 constant 1, to signify that GCC conforms to ISO Standard C. On
21430 some hosts, like Solaris, the system compiler uses a different
21431 convention, where `__STDC__' is normally 0, but is 1 if the user
21432 specifies strict conformance to the C Standard.
21434 Defining `STDC_0_IN_SYSTEM_HEADERS' makes GNU CPP follows the host
21435 convention when processing system header files, but when
21436 processing user files `__STDC__' will always expand to 1.
21438 - Macro: NO_IMPLICIT_EXTERN_C
21439 Define this macro if the system header files support C++ as well
21440 as C. This macro inhibits the usual method of using system header
21441 files in C++, which is to pretend that the file's contents are
21442 enclosed in `extern "C" {...}'.
21444 - Macro: REGISTER_TARGET_PRAGMAS ()
21445 Define this macro if you want to implement any target-specific
21446 pragmas. If defined, it is a C expression which makes a series of
21447 calls to `c_register_pragma' for each pragma. The macro may also
21448 do any setup required for the pragmas.
21450 The primary reason to define this macro is to provide
21451 compatibility with other compilers for the same target. In
21452 general, we discourage definition of target-specific pragmas for
21455 If the pragma can be implemented by attributes then you should
21456 consider defining the target hook `TARGET_INSERT_ATTRIBUTES' as
21459 Preprocessor macros that appear on pragma lines are not expanded.
21460 All `#pragma' directives that do not match any registered pragma
21461 are silently ignored, unless the user specifies
21462 `-Wunknown-pragmas'.
21464 - Function: void c_register_pragma (const char *SPACE, const char
21465 *NAME, void (*CALLBACK) (struct cpp_reader *))
21466 Each call to `c_register_pragma' establishes one pragma. The
21467 CALLBACK routine will be called when the preprocessor encounters a
21470 #pragma [SPACE] NAME ...
21472 SPACE is the case-sensitive namespace of the pragma, or `NULL' to
21473 put the pragma in the global namespace. The callback routine
21474 receives PFILE as its first argument, which can be passed on to
21475 cpplib's functions if necessary. You can lex tokens after the
21476 NAME by calling `c_lex'. Tokens that are not read by the callback
21477 will be silently ignored. The end of the line is indicated by a
21478 token of type `CPP_EOF'
21480 For an example use of this routine, see `c4x.h' and the callback
21481 routines defined in `c4x-c.c'.
21483 Note that the use of `c_lex' is specific to the C and C++
21484 compilers. It will not work in the Java or Fortran compilers, or
21485 any other language compilers for that matter. Thus if `c_lex' is
21486 going to be called from target-specific code, it must only be done
21487 so when building the C and C++ compilers. This can be done by
21488 defining the variables `c_target_objs' and `cxx_target_objs' in the
21489 target entry in the `config.gcc' file. These variables should name
21490 the target-specific, language-specific object file which contains
21491 the code that uses `c_lex'. Note it will also be necessary to add
21492 a rule to the makefile fragment pointed to by `tmake_file' that
21493 shows how to build this object file.
21495 - Macro: HANDLE_SYSV_PRAGMA
21496 Define this macro (to a value of 1) if you want the System V style
21497 pragmas `#pragma pack(<n>)' and `#pragma weak <name> [=<value>]'
21498 to be supported by gcc.
21500 The pack pragma specifies the maximum alignment (in bytes) of
21501 fields within a structure, in much the same way as the
21502 `__aligned__' and `__packed__' `__attribute__'s do. A pack value
21503 of zero resets the behavior to the default.
21505 A subtlety for Microsoft Visual C/C++ style bit-field packing
21506 (e.g. -mms-bitfields) for targets that support it: When a
21507 bit-field is inserted into a packed record, the whole size of the
21508 underlying type is used by one or more same-size adjacent
21509 bit-fields (that is, if its long:3, 32 bits is used in the record,
21510 and any additional adjacent long bit-fields are packed into the
21511 same chunk of 32 bits. However, if the size changes, a new field
21512 of that size is allocated).
21514 If both MS bit-fields and `__attribute__((packed))' are used, the
21515 latter will take precedence. If `__attribute__((packed))' is used
21516 on a single field when MS bit-fields are in use, it will take
21517 precedence for that field, but the alignment of the rest of the
21518 structure may affect its placement.
21520 The weak pragma only works if `SUPPORTS_WEAK' and
21521 `ASM_WEAKEN_LABEL' are defined. If enabled it allows the creation
21522 of specifically named weak labels, optionally with a value.
21524 - Macro: HANDLE_PRAGMA_PACK_PUSH_POP
21525 Define this macro (to a value of 1) if you want to support the
21526 Win32 style pragmas `#pragma pack(push,N)' and `#pragma
21527 pack(pop)'. The `pack(push,N)' pragma specifies the maximum
21528 alignment (in bytes) of fields within a structure, in much the
21529 same way as the `__aligned__' and `__packed__' `__attribute__'s
21530 do. A pack value of zero resets the behavior to the default.
21531 Successive invocations of this pragma cause the previous values to
21532 be stacked, so that invocations of `#pragma pack(pop)' will return
21533 to the previous value.
21535 - Macro: DOLLARS_IN_IDENTIFIERS
21536 Define this macro to control use of the character `$' in
21537 identifier names for the C family of languages. 0 means `$' is
21538 not allowed by default; 1 means it is allowed. 1 is the default;
21539 there is no need to define this macro in that case.
21541 - Macro: NO_DOLLAR_IN_LABEL
21542 Define this macro if the assembler does not accept the character
21543 `$' in label names. By default constructors and destructors in
21544 G++ have `$' in the identifiers. If this macro is defined, `.' is
21547 - Macro: NO_DOT_IN_LABEL
21548 Define this macro if the assembler does not accept the character
21549 `.' in label names. By default constructors and destructors in G++
21550 have names that use `.'. If this macro is defined, these names
21551 are rewritten to avoid `.'.
21553 - Macro: DEFAULT_MAIN_RETURN
21554 Define this macro if the target system expects every program's
21555 `main' function to return a standard "success" value by default
21556 (if no other value is explicitly returned).
21558 The definition should be a C statement (sans semicolon) to
21559 generate the appropriate rtl instructions. It is used only when
21560 compiling the end of `main'.
21562 - Macro: INSN_SETS_ARE_DELAYED (INSN)
21563 Define this macro as a C expression that is nonzero if it is safe
21564 for the delay slot scheduler to place instructions in the delay
21565 slot of INSN, even if they appear to use a resource set or
21566 clobbered in INSN. INSN is always a `jump_insn' or an `insn'; GCC
21567 knows that every `call_insn' has this behavior. On machines where
21568 some `insn' or `jump_insn' is really a function call and hence has
21569 this behavior, you should define this macro.
21571 You need not define this macro if it would always return zero.
21573 - Macro: INSN_REFERENCES_ARE_DELAYED (INSN)
21574 Define this macro as a C expression that is nonzero if it is safe
21575 for the delay slot scheduler to place instructions in the delay
21576 slot of INSN, even if they appear to set or clobber a resource
21577 referenced in INSN. INSN is always a `jump_insn' or an `insn'.
21578 On machines where some `insn' or `jump_insn' is really a function
21579 call and its operands are registers whose use is actually in the
21580 subroutine it calls, you should define this macro. Doing so
21581 allows the delay slot scheduler to move instructions which copy
21582 arguments into the argument registers into the delay slot of INSN.
21584 You need not define this macro if it would always return zero.
21586 - Macro: MULTIPLE_SYMBOL_SPACES
21587 Define this macro if in some cases global symbols from one
21588 translation unit may not be bound to undefined symbols in another
21589 translation unit without user intervention. For instance, under
21590 Microsoft Windows symbols must be explicitly imported from shared
21593 - Macro: MD_ASM_CLOBBERS (CLOBBERS)
21594 A C statement that adds to CLOBBERS `STRING_CST' trees for any
21595 hard regs the port wishes to automatically clobber for all asms.
21597 - Macro: MATH_LIBRARY
21598 Define this macro as a C string constant for the linker argument
21599 to link in the system math library, or `""' if the target does not
21600 have a separate math library.
21602 You need only define this macro if the default of `"-lm"' is wrong.
21604 - Macro: LIBRARY_PATH_ENV
21605 Define this macro as a C string constant for the environment
21606 variable that specifies where the linker should look for libraries.
21608 You need only define this macro if the default of `"LIBRARY_PATH"'
21611 - Macro: TARGET_HAS_F_SETLKW
21612 Define this macro if the target supports file locking with fcntl /
21613 F_SETLKW. Note that this functionality is part of POSIX.
21614 Defining `TARGET_HAS_F_SETLKW' will enable the test coverage code
21615 to use file locking when exiting a program, which avoids race
21616 conditions if the program has forked.
21618 - Macro: MAX_CONDITIONAL_EXECUTE
21619 A C expression for the maximum number of instructions to execute
21620 via conditional execution instructions instead of a branch. A
21621 value of `BRANCH_COST'+1 is the default if the machine does not
21622 use cc0, and 1 if it does use cc0.
21624 - Macro: IFCVT_MODIFY_TESTS (CE_INFO, TRUE_EXPR, FALSE_EXPR)
21625 Used if the target needs to perform machine-dependent
21626 modifications on the conditionals used for turning basic blocks
21627 into conditionally executed code. CE_INFO points to a data
21628 structure, `struct ce_if_block', which contains information about
21629 the currently processed blocks. TRUE_EXPR and FALSE_EXPR are the
21630 tests that are used for converting the then-block and the
21631 else-block, respectively. Set either TRUE_EXPR or FALSE_EXPR to a
21632 null pointer if the tests cannot be converted.
21634 - Macro: IFCVT_MODIFY_MULTIPLE_TESTS (CE_INFO, BB, TRUE_EXPR,
21636 Like `IFCVT_MODIFY_TESTS', but used when converting more
21637 complicated if-statements into conditions combined by `and' and
21638 `or' operations. BB contains the basic block that contains the
21639 test that is currently being processed and about to be turned into
21642 - Macro: IFCVT_MODIFY_INSN (CE_INFO, PATTERN, INSN)
21643 A C expression to modify the PATTERN of an INSN that is to be
21644 converted to conditional execution format. CE_INFO points to a
21645 data structure, `struct ce_if_block', which contains information
21646 about the currently processed blocks.
21648 - Macro: IFCVT_MODIFY_FINAL (CE_INFO)
21649 A C expression to perform any final machine dependent
21650 modifications in converting code to conditional execution. The
21651 involved basic blocks can be found in the `struct ce_if_block'
21652 structure that is pointed to by CE_INFO.
21654 - Macro: IFCVT_MODIFY_CANCEL (CE_INFO)
21655 A C expression to cancel any machine dependent modifications in
21656 converting code to conditional execution. The involved basic
21657 blocks can be found in the `struct ce_if_block' structure that is
21658 pointed to by CE_INFO.
21660 - Macro: IFCVT_INIT_EXTRA_FIELDS (CE_INFO)
21661 A C expression to initialize any extra fields in a `struct
21662 ce_if_block' structure, which are defined by the
21663 `IFCVT_EXTRA_FIELDS' macro.
21665 - Macro: IFCVT_EXTRA_FIELDS
21666 If defined, it should expand to a set of field declarations that
21667 will be added to the `struct ce_if_block' structure. These should
21668 be initialized by the `IFCVT_INIT_EXTRA_FIELDS' macro.
21670 - Target Hook: void TARGET_MACHINE_DEPENDENT_REORG ()
21671 If non-null, this hook performs a target-specific pass over the
21672 instruction stream. The compiler will run it at all optimization
21673 levels, just before the point at which it normally does
21674 delayed-branch scheduling.
21676 The exact purpose of the hook varies from target to target. Some
21677 use it to do transformations that are necessary for correctness,
21678 such as laying out in-function constant pools or avoiding hardware
21679 hazards. Others use it as an opportunity to do some
21680 machine-dependent optimizations.
21682 You need not implement the hook if it has nothing to do. The
21683 default definition is null.
21685 - Target Hook: void TARGET_INIT_BUILTINS ()
21686 Define this hook if you have any machine-specific built-in
21687 functions that need to be defined. It should be a function that
21688 performs the necessary setup.
21690 Machine specific built-in functions can be useful to expand
21691 special machine instructions that would otherwise not normally be
21692 generated because they have no equivalent in the source language
21693 (for example, SIMD vector instructions or prefetch instructions).
21695 To create a built-in function, call the function `builtin_function'
21696 which is defined by the language front end. You can use any type
21697 nodes set up by `build_common_tree_nodes' and
21698 `build_common_tree_nodes_2'; only language front ends that use
21699 those two functions will call `TARGET_INIT_BUILTINS'.
21701 - Target Hook: rtx TARGET_EXPAND_BUILTIN (tree EXP, rtx TARGET, rtx
21702 SUBTARGET, enum machine_mode MODE, int IGNORE)
21703 Expand a call to a machine specific built-in function that was set
21704 up by `TARGET_INIT_BUILTINS'. EXP is the expression for the
21705 function call; the result should go to TARGET if that is
21706 convenient, and have mode MODE if that is convenient. SUBTARGET
21707 may be used as the target for computing one of EXP's operands.
21708 IGNORE is nonzero if the value is to be ignored. This function
21709 should return the result of the call to the built-in function.
21711 - Macro: MD_CAN_REDIRECT_BRANCH (BRANCH1, BRANCH2)
21712 Take a branch insn in BRANCH1 and another in BRANCH2. Return true
21713 if redirecting BRANCH1 to the destination of BRANCH2 is possible.
21715 On some targets, branches may have a limited range. Optimizing the
21716 filling of delay slots can result in branches being redirected,
21717 and this may in turn cause a branch offset to overflow.
21719 - Macro: ALLOCATE_INITIAL_VALUE (HARD_REG)
21720 When the initial value of a hard register has been copied in a
21721 pseudo register, it is often not necessary to actually allocate
21722 another register to this pseudo register, because the original
21723 hard register or a stack slot it has been saved into can be used.
21724 `ALLOCATE_INITIAL_VALUE', if defined, is called at the start of
21725 register allocation once for each hard register that had its
21726 initial value copied by using `get_func_hard_reg_initial_val' or
21727 `get_hard_reg_initial_val'. Possible values are `NULL_RTX', if
21728 you don't want to do any special allocation, a `REG' rtx--that
21729 would typically be the hard register itself, if it is known not to
21730 be clobbered--or a `MEM'. If you are returning a `MEM', this is
21731 only a hint for the allocator; it might decide to use another
21732 register anyways. You may use `current_function_leaf_function' in
21733 the definition of the macro, functions that use `REG_N_SETS', to
21734 determine if the hard register in question will not be clobbered.
21736 - Macro: TARGET_OBJECT_SUFFIX
21737 Define this macro to be a C string representing the suffix for
21738 object files on your target machine. If you do not define this
21739 macro, GCC will use `.o' as the suffix for object files.
21741 - Macro: TARGET_EXECUTABLE_SUFFIX
21742 Define this macro to be a C string representing the suffix to be
21743 automatically added to executable files on your target machine.
21744 If you do not define this macro, GCC will use the null string as
21745 the suffix for executable files.
21747 - Macro: COLLECT_EXPORT_LIST
21748 If defined, `collect2' will scan the individual object files
21749 specified on its command line and create an export list for the
21750 linker. Define this macro for systems like AIX, where the linker
21751 discards object files that are not referenced from `main' and uses
21754 - Macro: MODIFY_JNI_METHOD_CALL (MDECL)
21755 Define this macro to a C expression representing a variant of the
21756 method call MDECL, if Java Native Interface (JNI) methods must be
21757 invoked differently from other methods on your target. For
21758 example, on 32-bit Microsoft Windows, JNI methods must be invoked
21759 using the `stdcall' calling convention and this macro is then
21760 defined as this expression:
21762 build_type_attribute_variant (MDECL,
21764 (get_identifier ("stdcall"),
21767 - Target Hook: bool TARGET_CANNOT_MODIFY_JUMPS_P (void)
21768 This target hook returns `true' past the point in which new jump
21769 instructions could be created. On machines that require a
21770 register for every jump such as the SHmedia ISA of SH5, this point
21771 would typically be reload, so this target hook should be defined
21772 to a function such as:
21775 cannot_modify_jumps_past_reload_p ()
21777 return (reload_completed || reload_in_progress);
21780 - Target Hook: int TARGET_BRANCH_TARGET_REGISTER_CLASS (void)
21781 This target hook returns a register class for which branch target
21782 register optimizations should be applied. All registers in this
21783 class should be usable interchangeably. After reload, registers
21784 in this class will be re-allocated and loads will be hoisted out
21785 of loops and be subjected to inter-block scheduling.
21787 - Target Hook: bool TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED (bool
21788 AFTER_PROLOGUE_EPILOGUE_GEN)
21789 Branch target register optimization will by default exclude
21790 callee-saved registers that are not already live during the
21791 current function; if this target hook returns true, they will be
21792 included. The target code must than make sure that all target
21793 registers in the class returned by
21794 `TARGET_BRANCH_TARGET_REGISTER_CLASS' that might need saving are
21795 saved. AFTER_PROLOGUE_EPILOGUE_GEN indicates if prologues and
21796 epilogues have already been generated. Note, even if you only
21797 return true when AFTER_PROLOGUE_EPILOGUE_GEN is false, you still
21798 are likely to have to make special provisions in
21799 `INITIAL_ELIMINATION_OFFSET' to reserve space for caller-saved
21802 - Macro: POWI_MAX_MULTS
21803 If defined, this macro is interpreted as a signed integer C
21804 expression that specifies the maximum number of floating point
21805 multiplications that should be emitted when expanding
21806 exponentiation by an integer constant inline. When this value is
21807 defined, exponentiation requiring more than this number of
21808 multiplications is implemented by calling the system library's
21809 `pow', `powf' or `powl' routines. The default value places no
21810 upper bound on the multiplication count.
21813 File: gccint.info, Node: Host Config, Next: Fragments, Prev: Target Macros, Up: Top
21818 Most details about the machine and system on which the compiler is
21819 actually running are detected by the `configure' script. Some things
21820 are impossible for `configure' to detect; these are described in two
21821 ways, either by macros defined in a file named `xm-MACHINE.h' or by
21822 hook functions in the file specified by the OUT_HOST_HOOK_OBJ variable
21823 in `config.gcc'. (The intention is that very few hosts will need a
21824 header file but nearly every fully supported host will need to override
21827 If you need to define only a few macros, and they have simple
21828 definitions, consider using the `xm_defines' variable in your
21829 `config.gcc' entry instead of creating a host configuration header.
21830 *Note System Config::.
21834 * Host Common:: Things every host probably needs implemented.
21835 * Filesystem:: Your host can't have the letter `a' in filenames?
21836 * Host Misc:: Rare configuration options for hosts.
21839 File: gccint.info, Node: Host Common, Next: Filesystem, Up: Host Config
21844 Some things are just not portable, even between similar operating
21845 systems, and are too difficult for autoconf to detect. They get
21846 implemented using hook functions in the file specified by the
21847 HOST_HOOK_OBJ variable in `config.gcc'.
21849 - Host Hook: void HOST_HOOKS_EXTRA_SIGNALS (void)
21850 This host hook is used to set up handling for extra signals. The
21851 most common thing to do in this hook is to detect stack overflow.
21853 - Host Hook: void * HOST_HOOKS_GT_PCH_GET_ADDRESS (size_t SIZE)
21854 This host hook returns the address of some space in which a PCH
21855 may be loaded with `HOST_HOOKS_PCH_LOAD_PCH'. The space will need
21856 to have SIZE bytes. If insufficient space is available, `NULL'
21857 may be returned; the PCH machinery will try to find a suitable
21858 address using a heuristic.
21860 The memory does not have to be available now. In fact, usually
21861 `HOST_HOOKS_PCH_LOAD_PCH' will already have been called. The
21862 memory need only be available in future invocations of GCC.
21864 - Host Hook: bool HOST_HOOKS_GT_PCH_USE_ADDRESS (size_t SIZE, void *
21866 This host hook is called when a PCH file is about to be loaded. If
21867 ADDRESS is the address that would have been returned by
21868 `HOST_HOOKS_PCH_MEMORY_ADDRESS', and SIZE is smaller than the
21869 maximum than `HOST_HOOKS_PCH_MEMORY_ADDRESS' would have accepted,
21870 return true, otherwise return false.
21872 In addition, free any address space reserved that isn't needed to
21873 hold SIZE bytes (whether or not true is returned). The PCH
21874 machinery will use `mmap' with `MAP_FIXED' to load the PCH if
21875 `HAVE_MMAP_FILE', or will use `fread' otherwise.
21877 If no PCH will be loaded, this hook may be called with SIZE zero,
21878 in which case all reserved address space should be freed.
21880 Do not try to handle values of ADDRESS that could not have been
21881 returned by this executable; just return false. Such values
21882 usually indicate an out-of-date PCH file (built by some other GCC
21883 executable), and such a PCH file won't work.
21886 File: gccint.info, Node: Filesystem, Next: Host Misc, Prev: Host Common, Up: Host Config
21891 GCC needs to know a number of things about the semantics of the host
21892 machine's filesystem. Filesystems with Unix and MS-DOS semantics are
21893 automatically detected. For other systems, you can define the
21894 following macros in `xm-MACHINE.h'.
21896 `HAVE_DOS_BASED_FILE_SYSTEM'
21897 This macro is automatically defined by `system.h' if the host file
21898 system obeys the semantics defined by MS-DOS instead of Unix. DOS
21899 file systems are case insensitive, file specifications may begin
21900 with a drive letter, and both forward slash and backslash (`/' and
21901 `\') are directory separators.
21905 If defined, these macros expand to character constants specifying
21906 separators for directory names within a file specification.
21907 `system.h' will automatically give them appropriate values on Unix
21908 and MS-DOS file systems. If your file system is neither of these,
21909 define one or both appropriately in `xm-MACHINE.h'.
21911 However, operating systems like VMS, where constructing a pathname
21912 is more complicated than just stringing together directory names
21913 separated by a special character, should not define either of these
21917 If defined, this macro should expand to a character constant
21918 specifying the separator for elements of search paths. The default
21919 value is a colon (`:'). DOS-based systems usually, but not
21920 always, use semicolon (`;').
21923 Define this macro if the host system is VMS.
21925 `HOST_OBJECT_SUFFIX'
21926 Define this macro to be a C string representing the suffix for
21927 object files on your host machine. If you do not define this
21928 macro, GCC will use `.o' as the suffix for object files.
21930 `HOST_EXECUTABLE_SUFFIX'
21931 Define this macro to be a C string representing the suffix for
21932 executable files on your host machine. If you do not define this
21933 macro, GCC will use the null string as the suffix for executable
21937 A pathname defined by the host operating system, which can be
21938 opened as a file and written to, but all the information written
21939 is discarded. This is commonly known as a "bit bucket" or "null
21940 device". If you do not define this macro, GCC will use
21941 `/dev/null' as the bit bucket. If the host does not support a bit
21942 bucket, define this macro to an invalid filename.
21944 `UPDATE_PATH_HOST_CANONICALIZE (PATH)'
21945 If defined, a C statement (sans semicolon) that performs
21946 host-dependent canonicalization when a path used in a compilation
21947 driver or preprocessor is canonicalized. PATH is a malloc-ed path
21948 to be canonicalized. If the C statement does canonicalize PATH
21949 into a different buffer, the old path should be freed and the new
21950 buffer should have been allocated with malloc.
21953 Define this macro to be a C string representing the format to use
21954 for constructing the index part of debugging dump file names. The
21955 resultant string must fit in fifteen bytes. The full filename
21956 will be the concatenation of: the prefix of the assembler file
21957 name, the string resulting from applying this format to an index
21958 number, and a string unique to each dump file kind, e.g. `rtl'.
21960 If you do not define this macro, GCC will use `.%02d.'. You should
21961 define this macro if using the default will create an invalid file
21965 File: gccint.info, Node: Host Misc, Prev: Filesystem, Up: Host Config
21971 A C expression for the status code to be returned when the compiler
21972 exits after serious errors. The default is the system-provided
21973 macro `EXIT_FAILURE', or `1' if the system doesn't define that
21974 macro. Define this macro only if these defaults are incorrect.
21976 `SUCCESS_EXIT_CODE'
21977 A C expression for the status code to be returned when the compiler
21978 exits without serious errors. (Warnings are not serious errors.)
21979 The default is the system-provided macro `EXIT_SUCCESS', or `0' if
21980 the system doesn't define that macro. Define this macro only if
21981 these defaults are incorrect.
21984 Define this macro if GCC should use the C implementation of
21985 `alloca' provided by `libiberty.a'. This only affects how some
21986 parts of the compiler itself allocate memory. It does not change
21989 When GCC is built with a compiler other than itself, the C `alloca'
21990 is always used. This is because most other implementations have
21991 serious bugs. You should define this macro only on a system where
21992 no stack-based `alloca' can possibly work. For instance, if a
21993 system has a small limit on the size of the stack, GCC's builtin
21994 `alloca' will not work reliably.
21996 `COLLECT2_HOST_INITIALIZATION'
21997 If defined, a C statement (sans semicolon) that performs
21998 host-dependent initialization when `collect2' is being initialized.
22000 `GCC_DRIVER_HOST_INITIALIZATION'
22001 If defined, a C statement (sans semicolon) that performs
22002 host-dependent initialization when a compilation driver is being
22006 Define this macro if the host system has a small limit on the total
22007 size of an argument vector. This causes the driver to take more
22008 care not to pass unnecessary arguments to subprocesses.
22011 Define this macro to be a C string representing the printf format
22012 prefix to specify output of long long types on your host machine.
22013 Hosts using the MS C runtime libs use the non-standard `I64'
22014 prefix. If you do not define this macro, GCC will use the standard
22015 `ll' prefix to format the printing of long long types.
22017 In addition, if `configure' generates an incorrect definition of any
22018 of the macros in `auto-host.h', you can override that definition in a
22019 host configuration header. If you need to do this, first see if it is
22020 possible to fix `configure'.
22023 File: gccint.info, Node: Fragments, Next: Collect2, Prev: Host Config, Up: Top
22028 When you configure GCC using the `configure' script, it will
22029 construct the file `Makefile' from the template file `Makefile.in'.
22030 When it does this, it can incorporate makefile fragments from the
22031 `config' directory. These are used to set Makefile parameters that are
22032 not amenable to being calculated by autoconf. The list of fragments to
22033 incorporate is set by `config.gcc' (and occasionally `config.build' and
22034 `config.host'); *Note System Config::.
22036 Fragments are named either `t-TARGET' or `x-HOST', depending on
22037 whether they are relevant to configuring GCC to produce code for a
22038 particular target, or to configuring GCC to run on a particular host.
22039 Here TARGET and HOST are mnemonics which usually have some relationship
22040 to the canonical system name, but no formal connection.
22042 If these files do not exist, it means nothing needs to be added for a
22043 given target or host. Most targets need a few `t-TARGET' fragments,
22044 but needing `x-HOST' fragments is rare.
22048 * Target Fragment:: Writing `t-TARGET' files.
22049 * Host Fragment:: Writing `x-HOST' files.
22052 File: gccint.info, Node: Target Fragment, Next: Host Fragment, Up: Fragments
22054 Target Makefile Fragments
22055 =========================
22057 Target makefile fragments can set these Makefile variables.
22060 Compiler flags to use when compiling `libgcc2.c'.
22063 A list of source file names to be compiled or assembled and
22064 inserted into `libgcc.a'.
22066 `Floating Point Emulation'
22067 To have GCC include software floating point libraries in `libgcc.a'
22068 define `FPBIT' and `DPBIT' along with a few rules as follows:
22069 # We want fine grained libraries, so use the new code
22070 # to build the floating point emulation libraries.
22075 fp-bit.c: $(srcdir)/config/fp-bit.c
22076 echo '#define FLOAT' > fp-bit.c
22077 cat $(srcdir)/config/fp-bit.c >> fp-bit.c
22079 dp-bit.c: $(srcdir)/config/fp-bit.c
22080 cat $(srcdir)/config/fp-bit.c > dp-bit.c
22082 You may need to provide additional #defines at the beginning of
22083 `fp-bit.c' and `dp-bit.c' to control target endianness and other
22086 `CRTSTUFF_T_CFLAGS'
22087 Special flags used when compiling `crtstuff.c'. *Note
22090 `CRTSTUFF_T_CFLAGS_S'
22091 Special flags used when compiling `crtstuff.c' for shared linking.
22092 Used if you use `crtbeginS.o' and `crtendS.o' in `EXTRA-PARTS'.
22093 *Note Initialization::.
22096 For some targets, invoking GCC in different ways produces objects
22097 that can not be linked together. For example, for some targets GCC
22098 produces both big and little endian code. For these targets, you
22099 must arrange for multiple versions of `libgcc.a' to be compiled,
22100 one for each set of incompatible options. When GCC invokes the
22101 linker, it arranges to link in the right version of `libgcc.a',
22102 based on the command line options used.
22104 The `MULTILIB_OPTIONS' macro lists the set of options for which
22105 special versions of `libgcc.a' must be built. Write options that
22106 are mutually incompatible side by side, separated by a slash.
22107 Write options that may be used together separated by a space. The
22108 build procedure will build all combinations of compatible options.
22110 For example, if you set `MULTILIB_OPTIONS' to `m68000/m68020
22111 msoft-float', `Makefile' will build special versions of `libgcc.a'
22112 using the following sets of options: `-m68000', `-m68020',
22113 `-msoft-float', `-m68000 -msoft-float', and `-m68020 -msoft-float'.
22115 `MULTILIB_DIRNAMES'
22116 If `MULTILIB_OPTIONS' is used, this variable specifies the
22117 directory names that should be used to hold the various libraries.
22118 Write one element in `MULTILIB_DIRNAMES' for each element in
22119 `MULTILIB_OPTIONS'. If `MULTILIB_DIRNAMES' is not used, the
22120 default value will be `MULTILIB_OPTIONS', with all slashes treated
22123 For example, if `MULTILIB_OPTIONS' is set to `m68000/m68020
22124 msoft-float', then the default value of `MULTILIB_DIRNAMES' is
22125 `m68000 m68020 msoft-float'. You may specify a different value if
22126 you desire a different set of directory names.
22129 Sometimes the same option may be written in two different ways.
22130 If an option is listed in `MULTILIB_OPTIONS', GCC needs to know
22131 about any synonyms. In that case, set `MULTILIB_MATCHES' to a
22132 list of items of the form `option=option' to describe all relevant
22133 synonyms. For example, `m68000=mc68000 m68020=mc68020'.
22135 `MULTILIB_EXCEPTIONS'
22136 Sometimes when there are multiple sets of `MULTILIB_OPTIONS' being
22137 specified, there are combinations that should not be built. In
22138 that case, set `MULTILIB_EXCEPTIONS' to be all of the switch
22139 exceptions in shell case syntax that should not be built.
22141 For example the ARM processor cannot execute both hardware floating
22142 point instructions and the reduced size THUMB instructions at the
22143 same time, so there is no need to build libraries with both of
22144 these options enabled. Therefore `MULTILIB_EXCEPTIONS' is set to:
22145 *mthumb/*mhard-float*
22147 `MULTILIB_EXTRA_OPTS'
22148 Sometimes it is desirable that when building multiple versions of
22149 `libgcc.a' certain options should always be passed on to the
22150 compiler. In that case, set `MULTILIB_EXTRA_OPTS' to be the list
22151 of options to be used for all builds. If you set this, you should
22152 probably set `CRTSTUFF_T_CFLAGS' to a dash followed by it.
22155 Unfortunately, setting `MULTILIB_EXTRA_OPTS' is not enough, since
22156 it does not affect the build of target libraries, at least not the
22157 build of the default multilib. One possible work-around is to use
22158 `DRIVER_SELF_SPECS' to bring options from the `specs' file as if
22159 they had been passed in the compiler driver command line.
22160 However, you don't want to be adding these options after the
22161 toolchain is installed, so you can instead tweak the `specs' file
22162 that will be used during the toolchain build, while you still
22163 install the original, built-in `specs'. The trick is to set
22164 `SPECS' to some other filename (say `specs.install'), that will
22165 then be created out of the built-in specs, and introduce a
22166 `Makefile' rule to generate the `specs' file that's going to be
22167 used at build time out of your `specs.install'.
22170 File: gccint.info, Node: Host Fragment, Prev: Target Fragment, Up: Fragments
22172 Host Makefile Fragments
22173 =======================
22175 The use of `x-HOST' fragments is discouraged. You should do so only
22176 if there is no other mechanism to get the behavior desired. Host
22177 fragments should never forcibly override variables set by the configure
22178 script, as they may have been adjusted by the user.
22180 Variables provided for host fragments to set include:
22184 These are extra flags to pass to the C compiler and preprocessor,
22185 respectively. They are used both when building GCC, and when
22186 compiling things with the just-built GCC.
22189 These are extra flags to use when building the compiler. They are
22190 not used when compiling `libgcc.a'. However, they _are_ used when
22191 recompiling the compiler with itself in later stages of a
22195 Flags to be passed to the linker when recompiling the compiler with
22196 itself in later stages of a bootstrap. You might need to use this
22197 if, for instance, one of the front ends needs more text space than
22198 the linker provides by default.
22201 A list of additional programs required to use the compiler on this
22202 host, which should be compiled with GCC and installed alongside
22203 the front ends. If you set this variable, you must also provide
22204 rules to build the extra programs.
22207 File: gccint.info, Node: Collect2, Next: Header Dirs, Prev: Fragments, Up: Top
22212 GCC uses a utility called `collect2' on nearly all systems to arrange
22213 to call various initialization functions at start time.
22215 The program `collect2' works by linking the program once and looking
22216 through the linker output file for symbols with particular names
22217 indicating they are constructor functions. If it finds any, it creates
22218 a new temporary `.c' file containing a table of them, compiles it, and
22219 links the program a second time including that file.
22221 The actual calls to the constructors are carried out by a subroutine
22222 called `__main', which is called (automatically) at the beginning of
22223 the body of `main' (provided `main' was compiled with GNU CC). Calling
22224 `__main' is necessary, even when compiling C code, to allow linking C
22225 and C++ object code together. (If you use `-nostdlib', you get an
22226 unresolved reference to `__main', since it's defined in the standard
22227 GCC library. Include `-lgcc' at the end of your compiler command line
22228 to resolve this reference.)
22230 The program `collect2' is installed as `ld' in the directory where
22231 the passes of the compiler are installed. When `collect2' needs to
22232 find the _real_ `ld', it tries the following file names:
22234 * `real-ld' in the directories listed in the compiler's search
22237 * `real-ld' in the directories listed in the environment variable
22240 * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
22243 * `ld' in the compiler's search directories, except that `collect2'
22244 will not execute itself recursively.
22248 "The compiler's search directories" means all the directories where
22249 `gcc' searches for passes of the compiler. This includes directories
22250 that you specify with `-B'.
22252 Cross-compilers search a little differently:
22254 * `real-ld' in the compiler's search directories.
22256 * `TARGET-real-ld' in `PATH'.
22258 * The file specified in the `REAL_LD_FILE_NAME' configuration macro,
22261 * `ld' in the compiler's search directories.
22263 * `TARGET-ld' in `PATH'.
22265 `collect2' explicitly avoids running `ld' using the file name under
22266 which `collect2' itself was invoked. In fact, it remembers up a list
22267 of such names--in case one copy of `collect2' finds another copy (or
22268 version) of `collect2' installed as `ld' in a second place in the
22271 `collect2' searches for the utilities `nm' and `strip' using the
22272 same algorithm as above for `ld'.
22275 File: gccint.info, Node: Header Dirs, Next: Type Information, Prev: Collect2, Up: Top
22277 Standard Header File Directories
22278 ********************************
22280 `GCC_INCLUDE_DIR' means the same thing for native and cross. It is
22281 where GCC stores its private include files, and also where GCC stores
22282 the fixed include files. A cross compiled GCC runs `fixincludes' on
22283 the header files in `$(tooldir)/include'. (If the cross compilation
22284 header files need to be fixed, they must be installed before GCC is
22285 built. If the cross compilation header files are already suitable for
22286 GCC, nothing special need be done).
22288 `GPLUSPLUS_INCLUDE_DIR' means the same thing for native and cross.
22289 It is where `g++' looks first for header files. The C++ library
22290 installs only target independent header files in that directory.
22292 `LOCAL_INCLUDE_DIR' is used only by native compilers. GCC doesn't
22293 install anything there. It is normally `/usr/local/include'. This is
22294 where local additions to a packaged system should place header files.
22296 `CROSS_INCLUDE_DIR' is used only by cross compilers. GCC doesn't
22297 install anything there.
22299 `TOOL_INCLUDE_DIR' is used for both native and cross compilers. It
22300 is the place for other packages to install header files that GCC will
22301 use. For a cross-compiler, this is the equivalent of `/usr/include'.
22302 When you build a cross-compiler, `fixincludes' processes any header
22303 files in this directory.
22306 File: gccint.info, Node: Type Information, Next: Funding, Prev: Header Dirs, Up: Top
22308 Memory Management and Type Information
22309 **************************************
22311 GCC uses some fairly sophisticated memory management techniques,
22312 which involve determining information about GCC's data structures from
22313 GCC's source code and using this information to perform garbage
22314 collection and implement precompiled headers.
22316 A full C parser would be too overcomplicated for this task, so a
22317 limited subset of C is interpreted and special markers are used to
22318 determine what parts of the source to look at. The parser can also
22319 detect simple typedefs of the form `typedef struct ID1 *ID2;' and
22320 `typedef int ID3;', and these don't need to be specially marked.
22322 The two forms that do need to be marked are:
22324 struct ID1 GTY(([options]))
22329 typedef struct ID2 GTY(([options]))
22336 * GTY Options:: What goes inside a `GTY(())'.
22337 * GGC Roots:: Making global variables GGC roots.
22338 * Files:: How the generated files work.
22341 File: gccint.info, Node: GTY Options, Next: GGC Roots, Up: Type Information
22343 The Inside of a `GTY(())'
22344 =========================
22346 Sometimes the C code is not enough to fully describe the type
22347 structure. Extra information can be provided by using more `GTY'
22348 markers. These markers can be placed:
22349 * In a structure definition, before the open brace;
22351 * In a global variable declaration, after the keyword `static' or
22354 * In a structure field definition, before the name of the field.
22356 The format of a marker is
22358 GTY (([name] ([param]), [name] ([param]) ...))
22359 The parameter is either a string or a type name.
22361 When the parameter is a string, often it is a fragment of C code.
22362 Three special escapes may be available:
22365 This expands to an expression that evaluates to the current
22369 This expands to an expression that evaluates to the structure that
22370 immediately contains the current structure.
22373 This expands to an expression that evaluates to the outermost
22374 structure that contains the current structure.
22377 This expands to the string of the form `[i1][i2]...' that indexes
22378 the array item currently being marked. For instance, if the field
22379 being marked is `foo', then `%1.foo%a' is the same as `%h'.
22381 The available options are:
22384 There are two places the type machinery will need to be explicitly
22385 told the length of an array. The first case is when a structure
22386 ends in a variable-length array, like this:
22388 struct rtvec_def GTY(()) {
22389 int num_elem; /* number of elements */
22390 rtx GTY ((length ("%h.num_elem"))) elem[1];
22392 In this case, the `length' option is used to override the
22393 specified array length (which should usually be `1'). The
22394 parameter of the option is a fragment of C code that calculates
22397 The second case is when a structure or a global variable contains a
22398 pointer to an array, like this:
22400 GTY ((length ("%h.regno_pointer_align_length"))) regno_decl;
22401 In this case, `regno_decl' has been allocated by writing something
22404 ggc_alloc (x->regno_pointer_align_length * sizeof (tree));
22405 and the `length' provides the length of the field.
22407 This second use of `length' also works on global variables, like:
22409 static GTY((length ("reg_base_value_size")))
22410 rtx *reg_base_value;
22413 If `skip' is applied to a field, the type machinery will ignore it.
22414 This is somewhat dangerous; the only safe use is in a union when
22415 one field really isn't ever used.
22420 The type machinery needs to be told which field of a `union' is
22421 currently active. This is done by giving each field a constant
22422 `tag' value, and then specifying a discriminator using `desc'.
22423 The value of the expression given by `desc' is compared against
22424 each `tag' value, each of which should be different. If no `tag'
22425 is matched, the field marked with `default' is used if there is
22426 one, otherwise no field in the union will be marked.
22428 In the `desc' option, the "current structure" is the union that it
22429 discriminates. Use `%1' to mean the structure containing it.
22430 (There are no escapes available to the `tag' option, since it's
22431 supposed to be a constant.)
22434 struct tree_binding GTY(())
22436 struct tree_common common;
22437 union tree_binding_u {
22438 tree GTY ((tag ("0"))) scope;
22439 struct cp_binding_level * GTY ((tag ("1"))) level;
22440 } GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) xscope;
22444 In this example, the value of BINDING_HAS_LEVEL_P when applied to a
22445 `struct tree_binding *' is presumed to be 0 or 1. If 1, the type
22446 mechanism will treat the field `level' as being present and if 0,
22447 will treat the field `scope' as being present.
22451 Sometimes it's convenient to define some data structure to work on
22452 generic pointers (that is, `PTR') and then use it with a specific
22453 type. `param_is' specifies the real type pointed to, and
22454 `use_param' says where in the generic data structure that type
22457 For instance, to have a `htab_t' that points to trees, one should
22460 htab_t GTY ((param_is (union tree_node))) ict;
22464 In more complicated cases, the data structure might need to work on
22465 several different types, which might not necessarily all be
22466 pointers. For this, `param1_is' through `param9_is' may be used to
22467 specify the real type of a field identified by `use_param1' through
22471 When a structure contains another structure that is parameterized,
22472 there's no need to do anything special, the inner structure
22473 inherits the parameters of the outer one. When a structure
22474 contains a pointer to a parameterized structure, the type
22475 machinery won't automatically detect this (it could, it just
22476 doesn't yet), so it's necessary to tell it that the pointed-to
22477 structure should use the same parameters as the outer structure.
22478 This is done by marking the pointer with the `use_params' option.
22481 `deletable', when applied to a global variable, indicates that when
22482 garbage collection runs, there's no need to mark anything pointed
22483 to by this variable, it can just be set to `NULL' instead. This
22484 is used to keep a list of free structures around for re-use.
22487 Suppose you want some kinds of object to be unique, and so you put
22488 them in a hash table. If garbage collection marks the hash table,
22489 these objects will never be freed, even if the last other
22490 reference to them goes away. GGC has special handling to deal
22491 with this: if you use the `if_marked' option on a global hash
22492 table, GGC will call the routine whose name is the parameter to
22493 the option on each hash table entry. If the routine returns
22494 nonzero, the hash table entry will be marked as usual. If the
22495 routine returns zero, the hash table entry will be deleted.
22497 The routine `ggc_marked_p' can be used to determine if an element
22498 has been marked already; in fact, the usual case is to use
22499 `if_marked ("ggc_marked_p")'.
22502 When applied to a field, `maybe_undef' indicates that it's OK if
22503 the structure that this fields points to is never defined, so long
22504 as this field is always `NULL'. This is used to avoid requiring
22505 backends to define certain optional structures. It doesn't work
22506 with language frontends.
22510 It's helpful for the type machinery to know if objects are often
22511 chained together in long lists; this lets it generate code that
22512 uses less stack space by iterating along the list instead of
22513 recursing down it. `chain_next' is an expression for the next
22514 item in the list, `chain_prev' is an expression for the previous
22515 item. The machinery requires that taking the next item of the
22516 previous item gives the original item.
22519 Some data structures depend on the relative ordering of pointers.
22520 If the type machinery needs to change that ordering, it will call
22521 the function referenced by the `reorder' option, before changing
22522 the pointers in the object that's pointed to by the field the
22523 option applies to. The function must be of the type `void ()(void
22524 *, void *, gt_pointer_operator, void *)'. The second parameter is
22525 the pointed-to object; the third parameter is a routine that,
22526 given a pointer, can update it to its new value. The fourth
22527 parameter is a cookie to be passed to the third parameter. The
22528 first parameter is the structure that contains the object, or the
22529 object itself if it is a structure.
22531 No data structure may depend on the absolute value of pointers.
22532 Even relying on relative orderings and using `reorder' functions
22533 can be expensive. It is better to depend on properties of the
22534 data, like an ID number or the hash of a string instead.
22537 The `special' option is used for those bizarre cases that are just
22538 too hard to deal with otherwise. Don't use it for new code.
22541 File: gccint.info, Node: GGC Roots, Next: Files, Prev: GTY Options, Up: Type Information
22543 Marking Roots for the Garbage Collector
22544 =======================================
22546 In addition to keeping track of types, the type machinery also
22547 locates the global variables that the garbage collector starts at.
22548 There are two syntaxes it accepts to indicate a root:
22550 1. extern GTY (([options])) [type] ID;
22552 2. static GTY (([options])) [type] ID;
22554 These are the only syntaxes that are accepted. In particular, if you
22555 want to mark a variable that is only declared as
22558 or similar, you should either make it `static' or you should create a
22559 `extern' declaration in a header file somewhere.
22562 File: gccint.info, Node: Files, Prev: GGC Roots, Up: Type Information
22564 Source Files Containing Type Information
22565 ========================================
22567 Whenever you add `GTY' markers to a new source file, there are three
22568 things you need to do:
22570 1. You need to add the file to the list of source files the type
22571 machinery scans. There are three cases:
22573 a. For a back-end file, this is usually done automatically; if
22574 not, you should add it to `target_gtfiles' in the appropriate
22575 port's entries in `config.gcc'.
22577 b. For files shared by all front ends, this is done by adding the
22578 filename to the `GTFILES' variable in `Makefile.in'.
22580 c. For any other file used by a front end, this is done by
22581 adding the filename to the `gtfiles' variable defined in
22582 `config-lang.in'. For C, the file is `c-config-lang.in'.
22583 This list should include all files that have GTY macros in
22584 them that are used in that front end, other than those
22585 defined in the previous list items. For example, it is
22586 common for front end writers to use `c-common.c' and other
22587 files from the C front end, and these should be included in
22588 the `gtfiles' variable for such front ends.
22591 2. If the file was a header file, you'll need to check that it's
22592 included in the right place to be visible to the generated files.
22593 For a back-end header file, this should be done automatically.
22594 For a front-end header file, it needs to be included by the same
22595 file that includes `gtype-LANG.h'. For other header files, it
22596 needs to be included in `gtype-desc.c', which is a generated file,
22597 so add it to `ifiles' in `open_base_file' in `gengtype.c'.
22599 For source files that aren't header files, the machinery will
22600 generate a header file that should be included in the source file
22601 you just changed. The file will be called `gt-PATH.h' where PATH
22602 is the pathname relative to the `gcc' directory with slashes
22603 replaced by -, so for example the header file to be included in
22604 `objc/objc-parse.c' is called `gt-objc-objc-parse.c'. The
22605 generated header file should be included after everything else in
22606 the source file. Don't forget to mention this file as a
22607 dependency in the `Makefile'!
22609 3. If a new `gt-PATH.h' file is needed, you need to arrange to add a
22610 `Makefile' rule that will ensure this file can be built. This is
22611 done by making it a dependency of `s-gtype', like this:
22613 gt-path.h : s-gtype ; @true
22615 For language frontends, there is another file that needs to be
22616 included somewhere. It will be called `gtype-LANG.h', where LANG is
22617 the name of the subdirectory the language is contained in. It will
22618 need `Makefile' rules just like the other generated files.
22621 File: gccint.info, Node: Funding, Next: GNU Project, Prev: Type Information, Up: Top
22623 Funding Free Software
22624 *********************
22626 If you want to have more free software a few years from now, it makes
22627 sense for you to help encourage people to contribute funds for its
22628 development. The most effective approach known is to encourage
22629 commercial redistributors to donate.
22631 Users of free software systems can boost the pace of development by
22632 encouraging for-a-fee distributors to donate part of their selling price
22633 to free software developers--the Free Software Foundation, and others.
22635 The way to convince distributors to do this is to demand it and
22636 expect it from them. So when you compare distributors, judge them
22637 partly by how much they give to free software development. Show
22638 distributors they must compete to be the one who gives the most.
22640 To make this approach work, you must insist on numbers that you can
22641 compare, such as, "We will donate ten dollars to the Frobnitz project
22642 for each disk sold." Don't be satisfied with a vague promise, such as
22643 "A portion of the profits are donated," since it doesn't give a basis
22646 Even a precise fraction "of the profits from this disk" is not very
22647 meaningful, since creative accounting and unrelated business decisions
22648 can greatly alter what fraction of the sales price counts as profit.
22649 If the price you pay is $50, ten percent of the profit is probably less
22650 than a dollar; it might be a few cents, or nothing at all.
22652 Some redistributors do development work themselves. This is useful
22653 too; but to keep everyone honest, you need to inquire how much they do,
22654 and what kind. Some kinds of development make much more long-term
22655 difference than others. For example, maintaining a separate version of
22656 a program contributes very little; maintaining the standard version of a
22657 program for the whole community contributes much. Easy new ports
22658 contribute little, since someone else would surely do them; difficult
22659 ports such as adding a new CPU to the GNU Compiler Collection
22660 contribute more; major new features or packages contribute the most.
22662 By establishing the idea that supporting further development is "the
22663 proper thing to do" when distributing free software for a fee, we can
22664 assure a steady flow of resources into making more free software.
22666 Copyright (C) 1994 Free Software Foundation, Inc.
22667 Verbatim copying and redistribution of this section is permitted
22668 without royalty; alteration is not permitted.
22671 File: gccint.info, Node: GNU Project, Next: Copying, Prev: Funding, Up: Top
22673 The GNU Project and GNU/Linux
22674 *****************************
22676 The GNU Project was launched in 1984 to develop a complete Unix-like
22677 operating system which is free software: the GNU system. (GNU is a
22678 recursive acronym for "GNU's Not Unix"; it is pronounced "guh-NEW".)
22679 Variants of the GNU operating system, which use the kernel Linux, are
22680 now widely used; though these systems are often referred to as "Linux",
22681 they are more accurately called GNU/Linux systems.
22683 For more information, see:
22684 `http://www.gnu.org/'
22685 `http://www.gnu.org/gnu/linux-and-gnu.html'
22688 File: gccint.info, Node: Copying, Next: GNU Free Documentation License, Prev: GNU Project, Up: Top
22690 GNU GENERAL PUBLIC LICENSE
22691 **************************
22693 Version 2, June 1991
22694 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
22695 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22697 Everyone is permitted to copy and distribute verbatim copies
22698 of this license document, but changing it is not allowed.
22703 The licenses for most software are designed to take away your
22704 freedom to share and change it. By contrast, the GNU General Public
22705 License is intended to guarantee your freedom to share and change free
22706 software--to make sure the software is free for all its users. This
22707 General Public License applies to most of the Free Software
22708 Foundation's software and to any other program whose authors commit to
22709 using it. (Some other Free Software Foundation software is covered by
22710 the GNU Library General Public License instead.) You can apply it to
22711 your programs, too.
22713 When we speak of free software, we are referring to freedom, not
22714 price. Our General Public Licenses are designed to make sure that you
22715 have the freedom to distribute copies of free software (and charge for
22716 this service if you wish), that you receive source code or can get it
22717 if you want it, that you can change the software or use pieces of it in
22718 new free programs; and that you know you can do these things.
22720 To protect your rights, we need to make restrictions that forbid
22721 anyone to deny you these rights or to ask you to surrender the rights.
22722 These restrictions translate to certain responsibilities for you if you
22723 distribute copies of the software, or if you modify it.
22725 For example, if you distribute copies of such a program, whether
22726 gratis or for a fee, you must give the recipients all the rights that
22727 you have. You must make sure that they, too, receive or can get the
22728 source code. And you must show them these terms so they know their
22731 We protect your rights with two steps: (1) copyright the software,
22732 and (2) offer you this license which gives you legal permission to copy,
22733 distribute and/or modify the software.
22735 Also, for each author's protection and ours, we want to make certain
22736 that everyone understands that there is no warranty for this free
22737 software. If the software is modified by someone else and passed on, we
22738 want its recipients to know that what they have is not the original, so
22739 that any problems introduced by others will not reflect on the original
22740 authors' reputations.
22742 Finally, any free program is threatened constantly by software
22743 patents. We wish to avoid the danger that redistributors of a free
22744 program will individually obtain patent licenses, in effect making the
22745 program proprietary. To prevent this, we have made it clear that any
22746 patent must be licensed for everyone's free use or not licensed at all.
22748 The precise terms and conditions for copying, distribution and
22749 modification follow.
22751 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
22752 0. This License applies to any program or other work which contains a
22753 notice placed by the copyright holder saying it may be distributed
22754 under the terms of this General Public License. The "Program",
22755 below, refers to any such program or work, and a "work based on
22756 the Program" means either the Program or any derivative work under
22757 copyright law: that is to say, a work containing the Program or a
22758 portion of it, either verbatim or with modifications and/or
22759 translated into another language. (Hereinafter, translation is
22760 included without limitation in the term "modification".) Each
22761 licensee is addressed as "you".
22763 Activities other than copying, distribution and modification are
22764 not covered by this License; they are outside its scope. The act
22765 of running the Program is not restricted, and the output from the
22766 Program is covered only if its contents constitute a work based on
22767 the Program (independent of having been made by running the
22768 Program). Whether that is true depends on what the Program does.
22770 1. You may copy and distribute verbatim copies of the Program's
22771 source code as you receive it, in any medium, provided that you
22772 conspicuously and appropriately publish on each copy an appropriate
22773 copyright notice and disclaimer of warranty; keep intact all the
22774 notices that refer to this License and to the absence of any
22775 warranty; and give any other recipients of the Program a copy of
22776 this License along with the Program.
22778 You may charge a fee for the physical act of transferring a copy,
22779 and you may at your option offer warranty protection in exchange
22782 2. You may modify your copy or copies of the Program or any portion
22783 of it, thus forming a work based on the Program, and copy and
22784 distribute such modifications or work under the terms of Section 1
22785 above, provided that you also meet all of these conditions:
22787 a. You must cause the modified files to carry prominent notices
22788 stating that you changed the files and the date of any change.
22790 b. You must cause any work that you distribute or publish, that
22791 in whole or in part contains or is derived from the Program
22792 or any part thereof, to be licensed as a whole at no charge
22793 to all third parties under the terms of this License.
22795 c. If the modified program normally reads commands interactively
22796 when run, you must cause it, when started running for such
22797 interactive use in the most ordinary way, to print or display
22798 an announcement including an appropriate copyright notice and
22799 a notice that there is no warranty (or else, saying that you
22800 provide a warranty) and that users may redistribute the
22801 program under these conditions, and telling the user how to
22802 view a copy of this License. (Exception: if the Program
22803 itself is interactive but does not normally print such an
22804 announcement, your work based on the Program is not required
22805 to print an announcement.)
22807 These requirements apply to the modified work as a whole. If
22808 identifiable sections of that work are not derived from the
22809 Program, and can be reasonably considered independent and separate
22810 works in themselves, then this License, and its terms, do not
22811 apply to those sections when you distribute them as separate
22812 works. But when you distribute the same sections as part of a
22813 whole which is a work based on the Program, the distribution of
22814 the whole must be on the terms of this License, whose permissions
22815 for other licensees extend to the entire whole, and thus to each
22816 and every part regardless of who wrote it.
22818 Thus, it is not the intent of this section to claim rights or
22819 contest your rights to work written entirely by you; rather, the
22820 intent is to exercise the right to control the distribution of
22821 derivative or collective works based on the Program.
22823 In addition, mere aggregation of another work not based on the
22824 Program with the Program (or with a work based on the Program) on
22825 a volume of a storage or distribution medium does not bring the
22826 other work under the scope of this License.
22828 3. You may copy and distribute the Program (or a work based on it,
22829 under Section 2) in object code or executable form under the terms
22830 of Sections 1 and 2 above provided that you also do one of the
22833 a. Accompany it with the complete corresponding machine-readable
22834 source code, which must be distributed under the terms of
22835 Sections 1 and 2 above on a medium customarily used for
22836 software interchange; or,
22838 b. Accompany it with a written offer, valid for at least three
22839 years, to give any third party, for a charge no more than your
22840 cost of physically performing source distribution, a complete
22841 machine-readable copy of the corresponding source code, to be
22842 distributed under the terms of Sections 1 and 2 above on a
22843 medium customarily used for software interchange; or,
22845 c. Accompany it with the information you received as to the offer
22846 to distribute corresponding source code. (This alternative is
22847 allowed only for noncommercial distribution and only if you
22848 received the program in object code or executable form with
22849 such an offer, in accord with Subsection b above.)
22851 The source code for a work means the preferred form of the work for
22852 making modifications to it. For an executable work, complete
22853 source code means all the source code for all modules it contains,
22854 plus any associated interface definition files, plus the scripts
22855 used to control compilation and installation of the executable.
22856 However, as a special exception, the source code distributed need
22857 not include anything that is normally distributed (in either
22858 source or binary form) with the major components (compiler,
22859 kernel, and so on) of the operating system on which the executable
22860 runs, unless that component itself accompanies the executable.
22862 If distribution of executable or object code is made by offering
22863 access to copy from a designated place, then offering equivalent
22864 access to copy the source code from the same place counts as
22865 distribution of the source code, even though third parties are not
22866 compelled to copy the source along with the object code.
22868 4. You may not copy, modify, sublicense, or distribute the Program
22869 except as expressly provided under this License. Any attempt
22870 otherwise to copy, modify, sublicense or distribute the Program is
22871 void, and will automatically terminate your rights under this
22872 License. However, parties who have received copies, or rights,
22873 from you under this License will not have their licenses
22874 terminated so long as such parties remain in full compliance.
22876 5. You are not required to accept this License, since you have not
22877 signed it. However, nothing else grants you permission to modify
22878 or distribute the Program or its derivative works. These actions
22879 are prohibited by law if you do not accept this License.
22880 Therefore, by modifying or distributing the Program (or any work
22881 based on the Program), you indicate your acceptance of this
22882 License to do so, and all its terms and conditions for copying,
22883 distributing or modifying the Program or works based on it.
22885 6. Each time you redistribute the Program (or any work based on the
22886 Program), the recipient automatically receives a license from the
22887 original licensor to copy, distribute or modify the Program
22888 subject to these terms and conditions. You may not impose any
22889 further restrictions on the recipients' exercise of the rights
22890 granted herein. You are not responsible for enforcing compliance
22891 by third parties to this License.
22893 7. If, as a consequence of a court judgment or allegation of patent
22894 infringement or for any other reason (not limited to patent
22895 issues), conditions are imposed on you (whether by court order,
22896 agreement or otherwise) that contradict the conditions of this
22897 License, they do not excuse you from the conditions of this
22898 License. If you cannot distribute so as to satisfy simultaneously
22899 your obligations under this License and any other pertinent
22900 obligations, then as a consequence you may not distribute the
22901 Program at all. For example, if a patent license would not permit
22902 royalty-free redistribution of the Program by all those who
22903 receive copies directly or indirectly through you, then the only
22904 way you could satisfy both it and this License would be to refrain
22905 entirely from distribution of the Program.
22907 If any portion of this section is held invalid or unenforceable
22908 under any particular circumstance, the balance of the section is
22909 intended to apply and the section as a whole is intended to apply
22910 in other circumstances.
22912 It is not the purpose of this section to induce you to infringe any
22913 patents or other property right claims or to contest validity of
22914 any such claims; this section has the sole purpose of protecting
22915 the integrity of the free software distribution system, which is
22916 implemented by public license practices. Many people have made
22917 generous contributions to the wide range of software distributed
22918 through that system in reliance on consistent application of that
22919 system; it is up to the author/donor to decide if he or she is
22920 willing to distribute software through any other system and a
22921 licensee cannot impose that choice.
22923 This section is intended to make thoroughly clear what is believed
22924 to be a consequence of the rest of this License.
22926 8. If the distribution and/or use of the Program is restricted in
22927 certain countries either by patents or by copyrighted interfaces,
22928 the original copyright holder who places the Program under this
22929 License may add an explicit geographical distribution limitation
22930 excluding those countries, so that distribution is permitted only
22931 in or among countries not thus excluded. In such case, this
22932 License incorporates the limitation as if written in the body of
22935 9. The Free Software Foundation may publish revised and/or new
22936 versions of the General Public License from time to time. Such
22937 new versions will be similar in spirit to the present version, but
22938 may differ in detail to address new problems or concerns.
22940 Each version is given a distinguishing version number. If the
22941 Program specifies a version number of this License which applies
22942 to it and "any later version", you have the option of following
22943 the terms and conditions either of that version or of any later
22944 version published by the Free Software Foundation. If the Program
22945 does not specify a version number of this License, you may choose
22946 any version ever published by the Free Software Foundation.
22948 10. If you wish to incorporate parts of the Program into other free
22949 programs whose distribution conditions are different, write to the
22950 author to ask for permission. For software which is copyrighted
22951 by the Free Software Foundation, write to the Free Software
22952 Foundation; we sometimes make exceptions for this. Our decision
22953 will be guided by the two goals of preserving the free status of
22954 all derivatives of our free software and of promoting the sharing
22955 and reuse of software generally.
22959 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
22960 WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
22961 LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
22962 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
22963 WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
22964 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22965 FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
22966 QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
22967 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
22968 SERVICING, REPAIR OR CORRECTION.
22970 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
22971 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
22972 MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
22973 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
22974 INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
22975 INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
22976 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
22977 OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
22978 OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
22979 ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
22981 END OF TERMS AND CONDITIONS
22983 How to Apply These Terms to Your New Programs
22984 =============================================
22986 If you develop a new program, and you want it to be of the greatest
22987 possible use to the public, the best way to achieve this is to make it
22988 free software which everyone can redistribute and change under these
22991 To do so, attach the following notices to the program. It is safest
22992 to attach them to the start of each source file to most effectively
22993 convey the exclusion of warranty; and each file should have at least
22994 the "copyright" line and a pointer to where the full notice is found.
22996 ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
22997 Copyright (C) YEAR NAME OF AUTHOR
22999 This program is free software; you can redistribute it and/or modify
23000 it under the terms of the GNU General Public License as published by
23001 the Free Software Foundation; either version 2 of the License, or
23002 (at your option) any later version.
23004 This program is distributed in the hope that it will be useful,
23005 but WITHOUT ANY WARRANTY; without even the implied warranty of
23006 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23007 GNU General Public License for more details.
23009 You should have received a copy of the GNU General Public License
23010 along with this program; if not, write to the Free Software Foundation,
23011 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23013 Also add information on how to contact you by electronic and paper
23016 If the program is interactive, make it output a short notice like
23017 this when it starts in an interactive mode:
23019 Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR
23020 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
23022 This is free software, and you are welcome to redistribute it
23023 under certain conditions; type `show c' for details.
23025 The hypothetical commands `show w' and `show c' should show the
23026 appropriate parts of the General Public License. Of course, the
23027 commands you use may be called something other than `show w' and `show
23028 c'; they could even be mouse-clicks or menu items--whatever suits your
23031 You should also get your employer (if you work as a programmer) or
23032 your school, if any, to sign a "copyright disclaimer" for the program,
23033 if necessary. Here is a sample; alter the names:
23035 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
23036 `Gnomovision' (which makes passes at compilers) written by James Hacker.
23038 SIGNATURE OF TY COON, 1 April 1989
23039 Ty Coon, President of Vice
23041 This General Public License does not permit incorporating your
23042 program into proprietary programs. If your program is a subroutine
23043 library, you may consider it more useful to permit linking proprietary
23044 applications with the library. If this is what you want to do, use the
23045 GNU Library General Public License instead of this License.
23048 File: gccint.info, Node: GNU Free Documentation License, Next: Contributors, Prev: Copying, Up: Top
23050 GNU Free Documentation License
23051 ******************************
23053 Version 1.2, November 2002
23054 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
23055 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
23057 Everyone is permitted to copy and distribute verbatim copies
23058 of this license document, but changing it is not allowed.
23062 The purpose of this License is to make a manual, textbook, or other
23063 functional and useful document "free" in the sense of freedom: to
23064 assure everyone the effective freedom to copy and redistribute it,
23065 with or without modifying it, either commercially or
23066 noncommercially. Secondarily, this License preserves for the
23067 author and publisher a way to get credit for their work, while not
23068 being considered responsible for modifications made by others.
23070 This License is a kind of "copyleft", which means that derivative
23071 works of the document must themselves be free in the same sense.
23072 It complements the GNU General Public License, which is a copyleft
23073 license designed for free software.
23075 We have designed this License in order to use it for manuals for
23076 free software, because free software needs free documentation: a
23077 free program should come with manuals providing the same freedoms
23078 that the software does. But this License is not limited to
23079 software manuals; it can be used for any textual work, regardless
23080 of subject matter or whether it is published as a printed book.
23081 We recommend this License principally for works whose purpose is
23082 instruction or reference.
23084 1. APPLICABILITY AND DEFINITIONS
23086 This License applies to any manual or other work, in any medium,
23087 that contains a notice placed by the copyright holder saying it
23088 can be distributed under the terms of this License. Such a notice
23089 grants a world-wide, royalty-free license, unlimited in duration,
23090 to use that work under the conditions stated herein. The
23091 "Document", below, refers to any such manual or work. Any member
23092 of the public is a licensee, and is addressed as "you". You
23093 accept the license if you copy, modify or distribute the work in a
23094 way requiring permission under copyright law.
23096 A "Modified Version" of the Document means any work containing the
23097 Document or a portion of it, either copied verbatim, or with
23098 modifications and/or translated into another language.
23100 A "Secondary Section" is a named appendix or a front-matter section
23101 of the Document that deals exclusively with the relationship of the
23102 publishers or authors of the Document to the Document's overall
23103 subject (or to related matters) and contains nothing that could
23104 fall directly within that overall subject. (Thus, if the Document
23105 is in part a textbook of mathematics, a Secondary Section may not
23106 explain any mathematics.) The relationship could be a matter of
23107 historical connection with the subject or with related matters, or
23108 of legal, commercial, philosophical, ethical or political position
23111 The "Invariant Sections" are certain Secondary Sections whose
23112 titles are designated, as being those of Invariant Sections, in
23113 the notice that says that the Document is released under this
23114 License. If a section does not fit the above definition of
23115 Secondary then it is not allowed to be designated as Invariant.
23116 The Document may contain zero Invariant Sections. If the Document
23117 does not identify any Invariant Sections then there are none.
23119 The "Cover Texts" are certain short passages of text that are
23120 listed, as Front-Cover Texts or Back-Cover Texts, in the notice
23121 that says that the Document is released under this License. A
23122 Front-Cover Text may be at most 5 words, and a Back-Cover Text may
23123 be at most 25 words.
23125 A "Transparent" copy of the Document means a machine-readable copy,
23126 represented in a format whose specification is available to the
23127 general public, that is suitable for revising the document
23128 straightforwardly with generic text editors or (for images
23129 composed of pixels) generic paint programs or (for drawings) some
23130 widely available drawing editor, and that is suitable for input to
23131 text formatters or for automatic translation to a variety of
23132 formats suitable for input to text formatters. A copy made in an
23133 otherwise Transparent file format whose markup, or absence of
23134 markup, has been arranged to thwart or discourage subsequent
23135 modification by readers is not Transparent. An image format is
23136 not Transparent if used for any substantial amount of text. A
23137 copy that is not "Transparent" is called "Opaque".
23139 Examples of suitable formats for Transparent copies include plain
23140 ASCII without markup, Texinfo input format, LaTeX input format,
23141 SGML or XML using a publicly available DTD, and
23142 standard-conforming simple HTML, PostScript or PDF designed for
23143 human modification. Examples of transparent image formats include
23144 PNG, XCF and JPG. Opaque formats include proprietary formats that
23145 can be read and edited only by proprietary word processors, SGML or
23146 XML for which the DTD and/or processing tools are not generally
23147 available, and the machine-generated HTML, PostScript or PDF
23148 produced by some word processors for output purposes only.
23150 The "Title Page" means, for a printed book, the title page itself,
23151 plus such following pages as are needed to hold, legibly, the
23152 material this License requires to appear in the title page. For
23153 works in formats which do not have any title page as such, "Title
23154 Page" means the text near the most prominent appearance of the
23155 work's title, preceding the beginning of the body of the text.
23157 A section "Entitled XYZ" means a named subunit of the Document
23158 whose title either is precisely XYZ or contains XYZ in parentheses
23159 following text that translates XYZ in another language. (Here XYZ
23160 stands for a specific section name mentioned below, such as
23161 "Acknowledgements", "Dedications", "Endorsements", or "History".)
23162 To "Preserve the Title" of such a section when you modify the
23163 Document means that it remains a section "Entitled XYZ" according
23164 to this definition.
23166 The Document may include Warranty Disclaimers next to the notice
23167 which states that this License applies to the Document. These
23168 Warranty Disclaimers are considered to be included by reference in
23169 this License, but only as regards disclaiming warranties: any other
23170 implication that these Warranty Disclaimers may have is void and
23171 has no effect on the meaning of this License.
23173 2. VERBATIM COPYING
23175 You may copy and distribute the Document in any medium, either
23176 commercially or noncommercially, provided that this License, the
23177 copyright notices, and the license notice saying this License
23178 applies to the Document are reproduced in all copies, and that you
23179 add no other conditions whatsoever to those of this License. You
23180 may not use technical measures to obstruct or control the reading
23181 or further copying of the copies you make or distribute. However,
23182 you may accept compensation in exchange for copies. If you
23183 distribute a large enough number of copies you must also follow
23184 the conditions in section 3.
23186 You may also lend copies, under the same conditions stated above,
23187 and you may publicly display copies.
23189 3. COPYING IN QUANTITY
23191 If you publish printed copies (or copies in media that commonly
23192 have printed covers) of the Document, numbering more than 100, and
23193 the Document's license notice requires Cover Texts, you must
23194 enclose the copies in covers that carry, clearly and legibly, all
23195 these Cover Texts: Front-Cover Texts on the front cover, and
23196 Back-Cover Texts on the back cover. Both covers must also clearly
23197 and legibly identify you as the publisher of these copies. The
23198 front cover must present the full title with all words of the
23199 title equally prominent and visible. You may add other material
23200 on the covers in addition. Copying with changes limited to the
23201 covers, as long as they preserve the title of the Document and
23202 satisfy these conditions, can be treated as verbatim copying in
23205 If the required texts for either cover are too voluminous to fit
23206 legibly, you should put the first ones listed (as many as fit
23207 reasonably) on the actual cover, and continue the rest onto
23210 If you publish or distribute Opaque copies of the Document
23211 numbering more than 100, you must either include a
23212 machine-readable Transparent copy along with each Opaque copy, or
23213 state in or with each Opaque copy a computer-network location from
23214 which the general network-using public has access to download
23215 using public-standard network protocols a complete Transparent
23216 copy of the Document, free of added material. If you use the
23217 latter option, you must take reasonably prudent steps, when you
23218 begin distribution of Opaque copies in quantity, to ensure that
23219 this Transparent copy will remain thus accessible at the stated
23220 location until at least one year after the last time you
23221 distribute an Opaque copy (directly or through your agents or
23222 retailers) of that edition to the public.
23224 It is requested, but not required, that you contact the authors of
23225 the Document well before redistributing any large number of
23226 copies, to give them a chance to provide you with an updated
23227 version of the Document.
23231 You may copy and distribute a Modified Version of the Document
23232 under the conditions of sections 2 and 3 above, provided that you
23233 release the Modified Version under precisely this License, with
23234 the Modified Version filling the role of the Document, thus
23235 licensing distribution and modification of the Modified Version to
23236 whoever possesses a copy of it. In addition, you must do these
23237 things in the Modified Version:
23239 A. Use in the Title Page (and on the covers, if any) a title
23240 distinct from that of the Document, and from those of
23241 previous versions (which should, if there were any, be listed
23242 in the History section of the Document). You may use the
23243 same title as a previous version if the original publisher of
23244 that version gives permission.
23246 B. List on the Title Page, as authors, one or more persons or
23247 entities responsible for authorship of the modifications in
23248 the Modified Version, together with at least five of the
23249 principal authors of the Document (all of its principal
23250 authors, if it has fewer than five), unless they release you
23251 from this requirement.
23253 C. State on the Title page the name of the publisher of the
23254 Modified Version, as the publisher.
23256 D. Preserve all the copyright notices of the Document.
23258 E. Add an appropriate copyright notice for your modifications
23259 adjacent to the other copyright notices.
23261 F. Include, immediately after the copyright notices, a license
23262 notice giving the public permission to use the Modified
23263 Version under the terms of this License, in the form shown in
23264 the Addendum below.
23266 G. Preserve in that license notice the full lists of Invariant
23267 Sections and required Cover Texts given in the Document's
23270 H. Include an unaltered copy of this License.
23272 I. Preserve the section Entitled "History", Preserve its Title,
23273 and add to it an item stating at least the title, year, new
23274 authors, and publisher of the Modified Version as given on
23275 the Title Page. If there is no section Entitled "History" in
23276 the Document, create one stating the title, year, authors,
23277 and publisher of the Document as given on its Title Page,
23278 then add an item describing the Modified Version as stated in
23279 the previous sentence.
23281 J. Preserve the network location, if any, given in the Document
23282 for public access to a Transparent copy of the Document, and
23283 likewise the network locations given in the Document for
23284 previous versions it was based on. These may be placed in
23285 the "History" section. You may omit a network location for a
23286 work that was published at least four years before the
23287 Document itself, or if the original publisher of the version
23288 it refers to gives permission.
23290 K. For any section Entitled "Acknowledgements" or "Dedications",
23291 Preserve the Title of the section, and preserve in the
23292 section all the substance and tone of each of the contributor
23293 acknowledgements and/or dedications given therein.
23295 L. Preserve all the Invariant Sections of the Document,
23296 unaltered in their text and in their titles. Section numbers
23297 or the equivalent are not considered part of the section
23300 M. Delete any section Entitled "Endorsements". Such a section
23301 may not be included in the Modified Version.
23303 N. Do not retitle any existing section to be Entitled
23304 "Endorsements" or to conflict in title with any Invariant
23307 O. Preserve any Warranty Disclaimers.
23309 If the Modified Version includes new front-matter sections or
23310 appendices that qualify as Secondary Sections and contain no
23311 material copied from the Document, you may at your option
23312 designate some or all of these sections as invariant. To do this,
23313 add their titles to the list of Invariant Sections in the Modified
23314 Version's license notice. These titles must be distinct from any
23315 other section titles.
23317 You may add a section Entitled "Endorsements", provided it contains
23318 nothing but endorsements of your Modified Version by various
23319 parties--for example, statements of peer review or that the text
23320 has been approved by an organization as the authoritative
23321 definition of a standard.
23323 You may add a passage of up to five words as a Front-Cover Text,
23324 and a passage of up to 25 words as a Back-Cover Text, to the end
23325 of the list of Cover Texts in the Modified Version. Only one
23326 passage of Front-Cover Text and one of Back-Cover Text may be
23327 added by (or through arrangements made by) any one entity. If the
23328 Document already includes a cover text for the same cover,
23329 previously added by you or by arrangement made by the same entity
23330 you are acting on behalf of, you may not add another; but you may
23331 replace the old one, on explicit permission from the previous
23332 publisher that added the old one.
23334 The author(s) and publisher(s) of the Document do not by this
23335 License give permission to use their names for publicity for or to
23336 assert or imply endorsement of any Modified Version.
23338 5. COMBINING DOCUMENTS
23340 You may combine the Document with other documents released under
23341 this License, under the terms defined in section 4 above for
23342 modified versions, provided that you include in the combination
23343 all of the Invariant Sections of all of the original documents,
23344 unmodified, and list them all as Invariant Sections of your
23345 combined work in its license notice, and that you preserve all
23346 their Warranty Disclaimers.
23348 The combined work need only contain one copy of this License, and
23349 multiple identical Invariant Sections may be replaced with a single
23350 copy. If there are multiple Invariant Sections with the same name
23351 but different contents, make the title of each such section unique
23352 by adding at the end of it, in parentheses, the name of the
23353 original author or publisher of that section if known, or else a
23354 unique number. Make the same adjustment to the section titles in
23355 the list of Invariant Sections in the license notice of the
23358 In the combination, you must combine any sections Entitled
23359 "History" in the various original documents, forming one section
23360 Entitled "History"; likewise combine any sections Entitled
23361 "Acknowledgements", and any sections Entitled "Dedications". You
23362 must delete all sections Entitled "Endorsements."
23364 6. COLLECTIONS OF DOCUMENTS
23366 You may make a collection consisting of the Document and other
23367 documents released under this License, and replace the individual
23368 copies of this License in the various documents with a single copy
23369 that is included in the collection, provided that you follow the
23370 rules of this License for verbatim copying of each of the
23371 documents in all other respects.
23373 You may extract a single document from such a collection, and
23374 distribute it individually under this License, provided you insert
23375 a copy of this License into the extracted document, and follow
23376 this License in all other respects regarding verbatim copying of
23379 7. AGGREGATION WITH INDEPENDENT WORKS
23381 A compilation of the Document or its derivatives with other
23382 separate and independent documents or works, in or on a volume of
23383 a storage or distribution medium, is called an "aggregate" if the
23384 copyright resulting from the compilation is not used to limit the
23385 legal rights of the compilation's users beyond what the individual
23386 works permit. When the Document is included an aggregate, this
23387 License does not apply to the other works in the aggregate which
23388 are not themselves derivative works of the Document.
23390 If the Cover Text requirement of section 3 is applicable to these
23391 copies of the Document, then if the Document is less than one half
23392 of the entire aggregate, the Document's Cover Texts may be placed
23393 on covers that bracket the Document within the aggregate, or the
23394 electronic equivalent of covers if the Document is in electronic
23395 form. Otherwise they must appear on printed covers that bracket
23396 the whole aggregate.
23400 Translation is considered a kind of modification, so you may
23401 distribute translations of the Document under the terms of section
23402 4. Replacing Invariant Sections with translations requires special
23403 permission from their copyright holders, but you may include
23404 translations of some or all Invariant Sections in addition to the
23405 original versions of these Invariant Sections. You may include a
23406 translation of this License, and all the license notices in the
23407 Document, and any Warrany Disclaimers, provided that you also
23408 include the original English version of this License and the
23409 original versions of those notices and disclaimers. In case of a
23410 disagreement between the translation and the original version of
23411 this License or a notice or disclaimer, the original version will
23414 If a section in the Document is Entitled "Acknowledgements",
23415 "Dedications", or "History", the requirement (section 4) to
23416 Preserve its Title (section 1) will typically require changing the
23421 You may not copy, modify, sublicense, or distribute the Document
23422 except as expressly provided for under this License. Any other
23423 attempt to copy, modify, sublicense or distribute the Document is
23424 void, and will automatically terminate your rights under this
23425 License. However, parties who have received copies, or rights,
23426 from you under this License will not have their licenses
23427 terminated so long as such parties remain in full compliance.
23429 10. FUTURE REVISIONS OF THIS LICENSE
23431 The Free Software Foundation may publish new, revised versions of
23432 the GNU Free Documentation License from time to time. Such new
23433 versions will be similar in spirit to the present version, but may
23434 differ in detail to address new problems or concerns. See
23435 `http://www.gnu.org/copyleft/'.
23437 Each version of the License is given a distinguishing version
23438 number. If the Document specifies that a particular numbered
23439 version of this License "or any later version" applies to it, you
23440 have the option of following the terms and conditions either of
23441 that specified version or of any later version that has been
23442 published (not as a draft) by the Free Software Foundation. If
23443 the Document does not specify a version number of this License,
23444 you may choose any version ever published (not as a draft) by the
23445 Free Software Foundation.
23447 ADDENDUM: How to use this License for your documents
23448 ====================================================
23450 To use this License in a document you have written, include a copy of
23451 the License in the document and put the following copyright and license
23452 notices just after the title page:
23454 Copyright (C) YEAR YOUR NAME.
23455 Permission is granted to copy, distribute and/or modify this document
23456 under the terms of the GNU Free Documentation License, Version 1.2
23457 or any later version published by the Free Software Foundation;
23458 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
23459 A copy of the license is included in the section entitled ``GNU
23460 Free Documentation License''.
23462 If you have Invariant Sections, Front-Cover Texts and Back-Cover
23463 Texts, replace the "with...Texts." line with this:
23465 with the Invariant Sections being LIST THEIR TITLES, with
23466 the Front-Cover Texts being LIST, and with the Back-Cover Texts
23469 If you have Invariant Sections without Cover Texts, or some other
23470 combination of the three, merge those two alternatives to suit the
23473 If your document contains nontrivial examples of program code, we
23474 recommend releasing these examples in parallel under your choice of
23475 free software license, such as the GNU General Public License, to
23476 permit their use in free software.
23479 File: gccint.info, Node: Contributors, Next: Option Index, Prev: GNU Free Documentation License, Up: Top
23481 Contributors to GCC
23482 *******************
23484 The GCC project would like to thank its many contributors. Without
23485 them the project would not have been nearly as successful as it has
23486 been. Any omissions in this list are accidental. Feel free to contact
23487 <law@redhat.com> or <gerald@pfeifer.com> if you have been left out or
23488 some of your contributions are not listed. Please keep this list in
23489 alphabetical order.
23491 * Analog Devices helped implement the support for complex data types
23494 * John David Anglin for threading-related fixes and improvements to
23495 libstdc++-v3, and the HP-UX port.
23497 * James van Artsdalen wrote the code that makes efficient use of the
23498 Intel 80387 register stack.
23500 * Abramo and Roberto Bagnara for the SysV68 Motorola 3300 Delta
23503 * Alasdair Baird for various bug fixes.
23505 * Giovanni Bajo for analyzing lots of complicated C++ problem
23508 * Peter Barada for his work to improve code generation for new
23511 * Gerald Baumgartner added the signature extension to the C++ front
23514 * Godmar Back for his Java improvements and encouragement.
23516 * Scott Bambrough for help porting the Java compiler.
23518 * Wolfgang Bangerth for processing tons of bug reports.
23520 * Jon Beniston for his Microsoft Windows port of Java.
23522 * Daniel Berlin for better DWARF2 support, faster/better
23523 optimizations, improved alias analysis, plus migrating GCC to
23526 * Geoff Berry for his Java object serialization work and various
23529 * Eric Blake for helping to make GCJ and libgcj conform to the
23532 * Segher Boessenkool for various fixes.
23534 * Hans-J. Boehm for his garbage collector, IA-64 libffi port, and
23537 * Neil Booth for work on cpplib, lang hooks, debug hooks and other
23538 miscellaneous clean-ups.
23540 * Eric Botcazou for fixing middle- and backend bugs left and right.
23542 * Per Bothner for his direction via the steering committee and
23543 various improvements to the infrastructure for supporting new
23544 languages. Chill front end implementation. Initial
23545 implementations of cpplib, fix-header, config.guess, libio, and
23546 past C++ library (libg++) maintainer. Dreaming up, designing and
23547 implementing much of GCJ.
23549 * Devon Bowen helped port GCC to the Tahoe.
23551 * Don Bowman for mips-vxworks contributions.
23553 * Dave Brolley for work on cpplib and Chill.
23555 * Robert Brown implemented the support for Encore 32000 systems.
23557 * Christian Bruel for improvements to local store elimination.
23559 * Herman A.J. ten Brugge for various fixes.
23561 * Joerg Brunsmann for Java compiler hacking and help with the GCJ
23564 * Joe Buck for his direction via the steering committee.
23566 * Craig Burley for leadership of the Fortran effort.
23568 * Stephan Buys for contributing Doxygen notes for libstdc++.
23570 * Paolo Carlini for libstdc++ work: lots of efficiency improvements
23571 to the C++ strings, streambufs and formatted I/O, hard detective
23572 work on the frustrating localization issues, and keeping up with
23573 the problem reports.
23575 * John Carr for his alias work, SPARC hacking, infrastructure
23576 improvements, previous contributions to the steering committee,
23577 loop optimizations, etc.
23579 * Stephane Carrez for 68HC11 and 68HC12 ports.
23581 * Steve Chamberlain for support for the Renesas SH and H8 processors
23582 and the PicoJava processor, and for GCJ config fixes.
23584 * Glenn Chambers for help with the GCJ FAQ.
23586 * John-Marc Chandonia for various libgcj patches.
23588 * Scott Christley for his Objective-C contributions.
23590 * Eric Christopher for his Java porting help and clean-ups.
23592 * Branko Cibej for more warning contributions.
23594 * The GNU Classpath project for all of their merged runtime code.
23596 * Nick Clifton for arm, mcore, fr30, v850, m32r work, `--help', and
23597 other random hacking.
23599 * Michael Cook for libstdc++ cleanup patches to reduce warnings.
23601 * R. Kelley Cook for making GCC buildable from a read-only directory
23602 as well as other miscellaneous build process and documentation
23605 * Ralf Corsepius for SH testing and minor bugfixing.
23607 * Stan Cox for care and feeding of the x86 port and lots of behind
23608 the scenes hacking.
23610 * Alex Crain provided changes for the 3b1.
23612 * Ian Dall for major improvements to the NS32k port.
23614 * Paul Dale for his work to add uClinux platform support to the m68k
23617 * Dario Dariol contributed the four varieties of sample programs
23618 that print a copy of their source.
23620 * Russell Davidson for fstream and stringstream fixes in libstdc++.
23622 * Mo DeJong for GCJ and libgcj bug fixes.
23624 * DJ Delorie for the DJGPP port, build and libiberty maintenance, and
23627 * Gabriel Dos Reis for contributions to G++, contributions and
23628 maintenance of GCC diagnostics infrastructure, libstdc++-v3,
23629 including valarray<>, complex<>, maintaining the numerics library
23630 (including that pesky <limits> :-) and keeping up-to-date anything
23631 to do with numbers.
23633 * Ulrich Drepper for his work on glibc, testing of GCC using glibc,
23634 ISO C99 support, CFG dumping support, etc., plus support of the
23635 C++ runtime libraries including for all kinds of C interface
23636 issues, contributing and maintaining complex<>, sanity checking
23637 and disbursement, configuration architecture, libio maintenance,
23638 and early math work.
23640 * Zdenek Dvorak for a new loop unroller and various fixes.
23642 * Richard Earnshaw for his ongoing work with the ARM.
23644 * David Edelsohn for his direction via the steering committee,
23645 ongoing work with the RS6000/PowerPC port, help cleaning up Haifa
23646 loop changes, doing the entire AIX port of libstdc++ with his bare
23647 hands, and for ensuring GCC properly keeps working on AIX.
23649 * Kevin Ediger for the floating point formatting of num_put::do_put
23652 * Phil Edwards for libstdc++ work including configuration hackery,
23653 documentation maintainer, chief breaker of the web pages, the
23654 occasional iostream bug fix, and work on shared library symbol
23657 * Paul Eggert for random hacking all over GCC.
23659 * Mark Elbrecht for various DJGPP improvements, and for libstdc++
23660 configuration support for locales and fstream-related fixes.
23662 * Vadim Egorov for libstdc++ fixes in strings, streambufs, and
23665 * Christian Ehrhardt for dealing with bug reports.
23667 * Ben Elliston for his work to move the Objective-C runtime into its
23668 own subdirectory and for his work on autoconf.
23670 * Marc Espie for OpenBSD support.
23672 * Doug Evans for much of the global optimization framework, arc,
23673 m32r, and SPARC work.
23675 * Christopher Faylor for his work on the Cygwin port and for caring
23676 and feeding the gcc.gnu.org box and saving its users tons of spam.
23678 * Fred Fish for BeOS support and Ada fixes.
23680 * Ivan Fontes Garcia for the Portugese translation of the GCJ FAQ.
23682 * Peter Gerwinski for various bug fixes and the Pascal front end.
23684 * Kaveh Ghazi for his direction via the steering committee, amazing
23685 work to make `-W -Wall' useful, and continuously testing GCC on a
23686 plethora of platforms.
23688 * John Gilmore for a donation to the FSF earmarked improving GNU
23691 * Judy Goldberg for c++ contributions.
23693 * Torbjorn Granlund for various fixes and the c-torture testsuite,
23694 multiply- and divide-by-constant optimization, improved long long
23695 support, improved leaf function register allocation, and his
23696 direction via the steering committee.
23698 * Anthony Green for his `-Os' contributions and Java front end work.
23700 * Stu Grossman for gdb hacking, allowing GCJ developers to debug
23703 * Michael K. Gschwind contributed the port to the PDP-11.
23705 * Ron Guilmette implemented the `protoize' and `unprotoize' tools,
23706 the support for Dwarf symbolic debugging information, and much of
23707 the support for System V Release 4. He has also worked heavily on
23708 the Intel 386 and 860 support.
23710 * Bruno Haible for improvements in the runtime overhead for EH, new
23711 warnings and assorted bug fixes.
23713 * Andrew Haley for his amazing Java compiler and library efforts.
23715 * Chris Hanson assisted in making GCC work on HP-UX for the 9000
23718 * Michael Hayes for various thankless work he's done trying to get
23719 the c30/c40 ports functional. Lots of loop and unroll
23720 improvements and fixes.
23722 * Dara Hazeghi for wading through myriads of target-specific bug
23725 * Kate Hedstrom for staking the G77 folks with an initial testsuite.
23727 * Richard Henderson for his ongoing SPARC, alpha, ia32, and ia64
23728 work, loop opts, and generally fixing lots of old problems we've
23729 ignored for years, flow rewrite and lots of further stuff,
23730 including reviewing tons of patches.
23732 * Aldy Hernandez for working on the PowerPC port, SIMD support, and
23735 * Nobuyuki Hikichi of Software Research Associates, Tokyo,
23736 contributed the support for the Sony NEWS machine.
23738 * Kazu Hirata for caring and feeding the Renesas H8/300 port and
23741 * Manfred Hollstein for his ongoing work to keep the m88k alive, lots
23742 of testing and bug fixing, particularly of GCC configury code.
23744 * Steve Holmgren for MachTen patches.
23746 * Jan Hubicka for his x86 port improvements.
23748 * Falk Hueffner for working on C and optimization bug reports.
23750 * Bernardo Innocenti for his m68k work, including merging of
23751 ColdFire improvements and uClinux support.
23753 * Christian Iseli for various bug fixes.
23755 * Kamil Iskra for general m68k hacking.
23757 * Lee Iverson for random fixes and MIPS testing.
23759 * Andreas Jaeger for testing and benchmarking of GCC and various bug
23762 * Jakub Jelinek for his SPARC work and sibling call optimizations as
23763 well as lots of bug fixes and test cases, and for improving the
23766 * Janis Johnson for ia64 testing and fixes, her quality improvement
23767 sidetracks, and web page maintenance.
23769 * Kean Johnston for SCO OpenServer support and various fixes.
23771 * Tim Josling for the sample language treelang based originally on
23772 Richard Kenner's ""toy" language".
23774 * Nicolai Josuttis for additional libstdc++ documentation.
23776 * Klaus Kaempf for his ongoing work to make alpha-vms a viable
23779 * David Kashtan of SRI adapted GCC to VMS.
23781 * Ryszard Kabatek for many, many libstdc++ bug fixes and
23782 optimizations of strings, especially member functions, and for
23785 * Geoffrey Keating for his ongoing work to make the PPC work for
23786 GNU/Linux and his automatic regression tester.
23788 * Brendan Kehoe for his ongoing work with G++ and for a lot of early
23789 work in just about every part of libstdc++.
23791 * Oliver M. Kellogg of Deutsche Aerospace contributed the port to the
23794 * Richard Kenner of the New York University Ultracomputer Research
23795 Laboratory wrote the machine descriptions for the AMD 29000, the
23796 DEC Alpha, the IBM RT PC, and the IBM RS/6000 as well as the
23797 support for instruction attributes. He also made changes to
23798 better support RISC processors including changes to common
23799 subexpression elimination, strength reduction, function calling
23800 sequence handling, and condition code support, in addition to
23801 generalizing the code for frame pointer elimination and delay slot
23802 scheduling. Richard Kenner was also the head maintainer of GCC
23805 * Mumit Khan for various contributions to the Cygwin and Mingw32
23806 ports and maintaining binary releases for Microsoft Windows hosts,
23807 and for massive libstdc++ porting work to Cygwin/Mingw32.
23809 * Robin Kirkham for cpu32 support.
23811 * Mark Klein for PA improvements.
23813 * Thomas Koenig for various bug fixes.
23815 * Bruce Korb for the new and improved fixincludes code.
23817 * Benjamin Kosnik for his G++ work and for leading the libstdc++-v3
23820 * Charles LaBrec contributed the support for the Integrated Solutions
23823 * Jeff Law for his direction via the steering committee,
23824 coordinating the entire egcs project and GCC 2.95, rolling out
23825 snapshots and releases, handling merges from GCC2, reviewing tons
23826 of patches that might have fallen through the cracks else, and
23827 random but extensive hacking.
23829 * Marc Lehmann for his direction via the steering committee and
23830 helping with analysis and improvements of x86 performance.
23832 * Ted Lemon wrote parts of the RTL reader and printer.
23834 * Kriang Lerdsuwanakij for C++ improvements including template as
23835 template parameter support, and many C++ fixes.
23837 * Warren Levy for tremendous work on libgcj (Java Runtime Library)
23838 and random work on the Java front end.
23840 * Alain Lichnewsky ported GCC to the MIPS CPU.
23842 * Oskar Liljeblad for hacking on AWT and his many Java bug reports
23845 * Robert Lipe for OpenServer support, new testsuites, testing, etc.
23847 * Weiwen Liu for testing and various bug fixes.
23849 * Dave Love for his ongoing work with the Fortran front end and
23852 * Martin von Lo"wis for internal consistency checking infrastructure,
23853 various C++ improvements including namespace support, and tons of
23854 assistance with libstdc++/compiler merges.
23856 * H.J. Lu for his previous contributions to the steering committee,
23857 many x86 bug reports, prototype patches, and keeping the GNU/Linux
23860 * Greg McGary for random fixes and (someday) bounded pointers.
23862 * Andrew MacLeod for his ongoing work in building a real EH system,
23863 various code generation improvements, work on the global
23866 * Vladimir Makarov for hacking some ugly i960 problems, PowerPC
23867 hacking improvements to compile-time performance, overall
23868 knowledge and direction in the area of instruction scheduling, and
23869 design and implementation of the automaton based instruction
23872 * Bob Manson for his behind the scenes work on dejagnu.
23874 * Philip Martin for lots of libstdc++ string and vector iterator
23875 fixes and improvements, and string clean up and testsuites.
23877 * All of the Mauve project contributors, for Java test code.
23879 * Bryce McKinlay for numerous GCJ and libgcj fixes and improvements.
23881 * Adam Megacz for his work on the Microsoft Windows port of GCJ.
23883 * Michael Meissner for LRS framework, ia32, m32r, v850, m88k, MIPS,
23884 powerpc, haifa, ECOFF debug support, and other assorted hacking.
23886 * Jason Merrill for his direction via the steering committee and
23887 leading the G++ effort.
23889 * David Miller for his direction via the steering committee, lots of
23890 SPARC work, improvements in jump.c and interfacing with the Linux
23893 * Gary Miller ported GCC to Charles River Data Systems machines.
23895 * Alfred Minarik for libstdc++ string and ios bug fixes, and turning
23896 the entire libstdc++ testsuite namespace-compatible.
23898 * Mark Mitchell for his direction via the steering committee,
23899 mountains of C++ work, load/store hoisting out of loops, alias
23900 analysis improvements, ISO C `restrict' support, and serving as
23901 release manager for GCC 3.x.
23903 * Alan Modra for various GNU/Linux bits and testing.
23905 * Toon Moene for his direction via the steering committee, Fortran
23906 maintenance, and his ongoing work to make us make Fortran run fast.
23908 * Jason Molenda for major help in the care and feeding of all the
23909 services on the gcc.gnu.org (formerly egcs.cygnus.com)
23910 machine--mail, web services, ftp services, etc etc. Doing all
23911 this work on scrap paper and the backs of envelopes would have
23914 * Catherine Moore for fixing various ugly problems we have sent her
23915 way, including the haifa bug which was killing the Alpha & PowerPC
23918 * Mike Moreton for his various Java patches.
23920 * David Mosberger-Tang for various Alpha improvements, and for the
23921 initial IA-64 port.
23923 * Stephen Moshier contributed the floating point emulator that
23924 assists in cross-compilation and permits support for floating
23925 point numbers wider than 64 bits and for ISO C99 support.
23927 * Bill Moyer for his behind the scenes work on various issues.
23929 * Philippe De Muyter for his work on the m68k port.
23931 * Joseph S. Myers for his work on the PDP-11 port, format checking
23932 and ISO C99 support, and continuous emphasis on (and contributions
23935 * Nathan Myers for his work on libstdc++-v3: architecture and
23936 authorship through the first three snapshots, including
23937 implementation of locale infrastructure, string, shadow C headers,
23938 and the initial project documentation (DESIGN, CHECKLIST, and so
23939 forth). Later, more work on MT-safe string and shadow headers.
23941 * Felix Natter for documentation on porting libstdc++.
23943 * Nathanael Nerode for cleaning up the configuration/build process.
23945 * NeXT, Inc. donated the front end that supports the Objective-C
23948 * Hans-Peter Nilsson for the CRIS and MMIX ports, improvements to
23949 the search engine setup, various documentation fixes and other
23952 * Geoff Noer for this work on getting cygwin native builds working.
23954 * Diego Novillo for his SPEC performance tracking web pages and
23955 assorted fixes in the middle end and various back ends.
23957 * David O'Brien for the FreeBSD/alpha, FreeBSD/AMD x86-64,
23958 FreeBSD/ARM, FreeBSD/PowerPC, and FreeBSD/SPARC64 ports and
23959 related infrastructure improvements.
23961 * Alexandre Oliva for various build infrastructure improvements,
23962 scripts and amazing testing work, including keeping libtool issues
23965 * Melissa O'Neill for various NeXT fixes.
23967 * Rainer Orth for random MIPS work, including improvements to GCC's
23968 o32 ABI support, improvements to dejagnu's MIPS support, Java
23969 configuration clean-ups and porting work, etc.
23971 * Hartmut Penner for work on the s390 port.
23973 * Paul Petersen wrote the machine description for the Alliant FX/8.
23975 * Alexandre Petit-Bianco for implementing much of the Java compiler
23976 and continued Java maintainership.
23978 * Matthias Pfaller for major improvements to the NS32k port.
23980 * Gerald Pfeifer for his direction via the steering committee,
23981 pointing out lots of problems we need to solve, maintenance of the
23982 web pages, and taking care of documentation maintenance in general.
23984 * Andrew Pinski for processing bug reports by the dozen.
23986 * Ovidiu Predescu for his work on the Objective-C front end and
23989 * Jerry Quinn for major performance improvements in C++ formatted
23992 * Ken Raeburn for various improvements to checker, MIPS ports and
23993 various cleanups in the compiler.
23995 * Rolf W. Rasmussen for hacking on AWT.
23997 * David Reese of Sun Microsystems contributed to the Solaris on
24000 * Volker Reichelt for keeping up with the problem reports.
24002 * Joern Rennecke for maintaining the sh port, loop, regmove & reload
24005 * Loren J. Rittle for improvements to libstdc++-v3 including the
24006 FreeBSD port, threading fixes, thread-related configury changes,
24007 critical threading documentation, and solutions to really tricky
24008 I/O problems, as well as keeping GCC properly working on FreeBSD
24009 and continuous testing.
24011 * Craig Rodrigues for processing tons of bug reports.
24013 * Gavin Romig-Koch for lots of behind the scenes MIPS work.
24015 * Ken Rose for fixes to GCC's delay slot filling code.
24017 * Paul Rubin wrote most of the preprocessor.
24019 * Pe'tur Runo'lfsson for major performance improvements in C++
24020 formatted I/O and large file support in C++ filebuf.
24022 * Chip Salzenberg for libstdc++ patches and improvements to locales,
24023 traits, Makefiles, libio, libtool hackery, and "long long" support.
24025 * Juha Sarlin for improvements to the H8 code generator.
24027 * Greg Satz assisted in making GCC work on HP-UX for the 9000 series
24030 * Roger Sayle for improvements to constant folding and GCC's RTL
24031 optimizers as well as for fixing numerous bugs.
24033 * Bradley Schatz for his work on the GCJ FAQ.
24035 * Peter Schauer wrote the code to allow debugging to work on the
24038 * William Schelter did most of the work on the Intel 80386 support.
24040 * Bernd Schmidt for various code generation improvements and major
24041 work in the reload pass as well a serving as release manager for
24044 * Peter Schmid for constant testing of libstdc++ - especially
24045 application testing, going above and beyond what was requested for
24046 the release criteria - and libstdc++ header file tweaks.
24048 * Jason Schroeder for jcf-dump patches.
24050 * Andreas Schwab for his work on the m68k port.
24052 * Joel Sherrill for his direction via the steering committee, RTEMS
24053 contributions and RTEMS testing.
24055 * Nathan Sidwell for many C++ fixes/improvements.
24057 * Jeffrey Siegal for helping RMS with the original design of GCC,
24058 some code which handles the parse tree and RTL data structures,
24059 constant folding and help with the original VAX & m68k ports.
24061 * Kenny Simpson for prompting libstdc++ fixes due to defect reports
24062 from the LWG (thereby keeping GCC in line with updates from the
24065 * Franz Sirl for his ongoing work with making the PPC port stable
24068 * Andrey Slepuhin for assorted AIX hacking.
24070 * Christopher Smith did the port for Convex machines.
24072 * Danny Smith for his major efforts on the Mingw (and Cygwin) ports.
24074 * Randy Smith finished the Sun FPA support.
24076 * Scott Snyder for queue, iterator, istream, and string fixes and
24077 libstdc++ testsuite entries.
24079 * Brad Spencer for contributions to the GLIBCPP_FORCE_NEW technique.
24081 * Richard Stallman, for writing the original GCC and launching the
24084 * Jan Stein of the Chalmers Computer Society provided support for
24085 Genix, as well as part of the 32000 machine description.
24087 * Nigel Stephens for various mips16 related fixes/improvements.
24089 * Jonathan Stone wrote the machine description for the Pyramid
24092 * Graham Stott for various infrastructure improvements.
24094 * John Stracke for his Java HTTP protocol fixes.
24096 * Mike Stump for his Elxsi port, G++ contributions over the years
24097 and more recently his vxworks contributions
24099 * Jeff Sturm for Java porting help, bug fixes, and encouragement.
24101 * Shigeya Suzuki for this fixes for the bsdi platforms.
24103 * Ian Lance Taylor for his mips16 work, general configury hacking,
24106 * Holger Teutsch provided the support for the Clipper CPU.
24108 * Gary Thomas for his ongoing work to make the PPC work for
24111 * Philipp Thomas for random bug fixes throughout the compiler
24113 * Jason Thorpe for thread support in libstdc++ on NetBSD.
24115 * Kresten Krab Thorup wrote the run time support for the Objective-C
24116 language and the fantastic Java bytecode interpreter.
24118 * Michael Tiemann for random bug fixes, the first instruction
24119 scheduler, initial C++ support, function integration, NS32k, SPARC
24120 and M88k machine description work, delay slot scheduling.
24122 * Andreas Tobler for his work porting libgcj to Darwin.
24124 * Teemu Torma for thread safe exception handling support.
24126 * Leonard Tower wrote parts of the parser, RTL generator, and RTL
24127 definitions, and of the VAX machine description.
24129 * Tom Tromey for internationalization support and for his many Java
24130 contributions and libgcj maintainership.
24132 * Lassi Tuura for improvements to config.guess to determine HP
24135 * Petter Urkedal for libstdc++ CXXFLAGS, math, and algorithms fixes.
24137 * Brent Verner for work with the libstdc++ cshadow files and their
24138 associated configure steps.
24140 * Todd Vierling for contributions for NetBSD ports.
24142 * Jonathan Wakely for contributing libstdc++ Doxygen notes and XHTML
24145 * Dean Wakerley for converting the install documentation from HTML
24146 to texinfo in time for GCC 3.0.
24148 * Krister Walfridsson for random bug fixes.
24150 * Stephen M. Webb for time and effort on making libstdc++ shadow
24151 files work with the tricky Solaris 8+ headers, and for pushing the
24152 build-time header tree.
24154 * John Wehle for various improvements for the x86 code generator,
24155 related infrastructure improvements to help x86 code generation,
24156 value range propagation and other work, WE32k port.
24158 * Ulrich Weigand for work on the s390 port.
24160 * Zack Weinberg for major work on cpplib and various other bug fixes.
24162 * Matt Welsh for help with Linux Threads support in GCJ.
24164 * Urban Widmark for help fixing java.io.
24166 * Mark Wielaard for new Java library code and his work integrating
24169 * Dale Wiles helped port GCC to the Tahoe.
24171 * Bob Wilson from Tensilica, Inc. for the Xtensa port.
24173 * Jim Wilson for his direction via the steering committee, tackling
24174 hard problems in various places that nobody else wanted to work
24175 on, strength reduction and other loop optimizations.
24177 * Carlo Wood for various fixes.
24179 * Tom Wood for work on the m88k port.
24181 * Masanobu Yuhara of Fujitsu Laboratories implemented the machine
24182 description for the Tron architecture (specifically, the Gmicro).
24184 * Kevin Zachmann helped ported GCC to the Tahoe.
24186 * Gilles Zunino for help porting Java to Irix.
24189 In addition to the above, all of which also contributed time and
24190 energy in testing GCC, we would like to thank the following for their
24191 contributions to testing:
24193 * Michael Abd-El-Malek
24203 * David Billinghurst
24207 * Stephane Bortzmeyer
24217 * Bradford Castalia
24233 * Charles-Antoine Gauthier
24253 * Kevin B. Hendricks
24257 * Christian Joensson
24263 * Anand Krishnaswamy
24321 And finally we'd like to thank everyone who uses the compiler,
24322 submits bug reports and generally reminds us why we're doing this work
24323 in the first place.
24326 File: gccint.info, Node: Option Index, Next: Index, Prev: Contributors, Up: Top
24331 GCC's command line options are indexed here without any initial `-'
24332 or `--'. Where an option has both positive and negative forms (such as
24333 `-fOPTION' and `-fno-OPTION'), relevant entries in the manual are
24334 indexed under the most appropriate form; it may sometimes be useful to
24335 look up both forms.
24359 * frerun-cse-after-loop: Passes.
24360 * fthread-jumps: Passes.
24361 * msoft-float: Soft float library routines.
24364 File: gccint.info, Node: Index, Prev: Option Index, Up: Top
24371 * ! in constraint: Multi-Alternative.
24372 * # in constraint: Modifiers.
24373 * # in template: Output Template.
24375 * % in constraint: Modifiers.
24376 * % in GTY option: GTY Options.
24377 * % in template: Output Template.
24378 * & in constraint: Modifiers.
24379 * (nil): RTL Objects.
24380 * * <1>: PCH Target.
24382 * * in constraint: Modifiers.
24383 * * in template: Output Statement.
24384 * + in constraint: Modifiers.
24385 * /c in RTL dump: Flags.
24386 * /f in RTL dump: Flags.
24387 * /i in RTL dump: Flags.
24388 * /j in RTL dump: Flags.
24389 * /s in RTL dump: Flags.
24390 * /u in RTL dump: Flags.
24391 * /v in RTL dump: Flags.
24392 * 0 in constraint: Simple Constraints.
24393 * < in constraint: Simple Constraints.
24394 * = in constraint: Modifiers.
24395 * > in constraint: Simple Constraints.
24396 * ? in constraint: Multi-Alternative.
24397 * \: Output Template.
24398 * __absvdi2: Integer library routines.
24399 * __absvsi2: Integer library routines.
24400 * __adddf3: Soft float library routines.
24401 * __addsf3: Soft float library routines.
24402 * __addtf3: Soft float library routines.
24403 * __addvdi3: Integer library routines.
24404 * __addvsi3: Integer library routines.
24405 * __addxf3: Soft float library routines.
24406 * __ashldi3: Integer library routines.
24407 * __ashlsi3: Integer library routines.
24408 * __ashlti3: Integer library routines.
24409 * __ashrdi3: Integer library routines.
24410 * __ashrsi3: Integer library routines.
24411 * __ashrti3: Integer library routines.
24412 * __builtin_args_info: Varargs.
24413 * __builtin_classify_type: Varargs.
24414 * __builtin_next_arg: Varargs.
24415 * __builtin_saveregs: Varargs.
24416 * __clear_cache: Miscellaneous routines.
24417 * __clzdi2: Integer library routines.
24418 * __clzsi2: Integer library routines.
24419 * __clzti2: Integer library routines.
24420 * __cmpdf2: Soft float library routines.
24421 * __cmpdi2: Integer library routines.
24422 * __cmpsf2: Soft float library routines.
24423 * __cmptf2: Soft float library routines.
24424 * __cmpti2: Integer library routines.
24425 * __CTOR_LIST__: Initialization.
24426 * __ctzdi2: Integer library routines.
24427 * __ctzsi2: Integer library routines.
24428 * __ctzti2: Integer library routines.
24429 * __divdf3: Soft float library routines.
24430 * __divdi3: Integer library routines.
24431 * __divsf3: Soft float library routines.
24432 * __divsi3: Integer library routines.
24433 * __divtf3: Soft float library routines.
24434 * __divti3: Integer library routines.
24435 * __divxf3: Soft float library routines.
24436 * __DTOR_LIST__: Initialization.
24437 * __eqdf2: Soft float library routines.
24438 * __eqsf2: Soft float library routines.
24439 * __eqtf2: Soft float library routines.
24440 * __extenddftf2: Soft float library routines.
24441 * __extenddfxf2: Soft float library routines.
24442 * __extendsfdf2: Soft float library routines.
24443 * __extendsftf2: Soft float library routines.
24444 * __extendsfxf2: Soft float library routines.
24445 * __ffsdi2: Integer library routines.
24446 * __ffsti2: Integer library routines.
24447 * __fixdfdi: Soft float library routines.
24448 * __fixdfsi: Soft float library routines.
24449 * __fixdfti: Soft float library routines.
24450 * __fixsfdi: Soft float library routines.
24451 * __fixsfsi: Soft float library routines.
24452 * __fixsfti: Soft float library routines.
24453 * __fixtfdi: Soft float library routines.
24454 * __fixtfsi: Soft float library routines.
24455 * __fixtfti: Soft float library routines.
24456 * __fixunsdfdi: Soft float library routines.
24457 * __fixunsdfsi: Soft float library routines.
24458 * __fixunsdfti: Soft float library routines.
24459 * __fixunssfdi: Soft float library routines.
24460 * __fixunssfsi: Soft float library routines.
24461 * __fixunssfti: Soft float library routines.
24462 * __fixunstfdi: Soft float library routines.
24463 * __fixunstfsi: Soft float library routines.
24464 * __fixunstfti: Soft float library routines.
24465 * __fixunsxfdi: Soft float library routines.
24466 * __fixunsxfsi: Soft float library routines.
24467 * __fixunsxfti: Soft float library routines.
24468 * __fixxfdi: Soft float library routines.
24469 * __fixxfsi: Soft float library routines.
24470 * __fixxfti: Soft float library routines.
24471 * __floatdidf: Soft float library routines.
24472 * __floatdisf: Soft float library routines.
24473 * __floatditf: Soft float library routines.
24474 * __floatdixf: Soft float library routines.
24475 * __floatsidf: Soft float library routines.
24476 * __floatsisf: Soft float library routines.
24477 * __floatsitf: Soft float library routines.
24478 * __floatsixf: Soft float library routines.
24479 * __floattidf: Soft float library routines.
24480 * __floattisf: Soft float library routines.
24481 * __floattitf: Soft float library routines.
24482 * __floattixf: Soft float library routines.
24483 * __gedf2: Soft float library routines.
24484 * __gesf2: Soft float library routines.
24485 * __getf2: Soft float library routines.
24486 * __gtdf2: Soft float library routines.
24487 * __gtsf2: Soft float library routines.
24488 * __gttf2: Soft float library routines.
24489 * __ledf2: Soft float library routines.
24490 * __lesf2: Soft float library routines.
24491 * __letf2: Soft float library routines.
24492 * __lshrdi3: Integer library routines.
24493 * __lshrsi3: Integer library routines.
24494 * __lshrti3: Integer library routines.
24495 * __ltdf2: Soft float library routines.
24496 * __ltsf2: Soft float library routines.
24497 * __lttf2: Soft float library routines.
24498 * __main: Collect2.
24499 * __moddi3: Integer library routines.
24500 * __modsi3: Integer library routines.
24501 * __modti3: Integer library routines.
24502 * __muldf3: Soft float library routines.
24503 * __muldi3: Integer library routines.
24504 * __mulsf3: Soft float library routines.
24505 * __mulsi3: Integer library routines.
24506 * __multf3: Soft float library routines.
24507 * __multi3: Integer library routines.
24508 * __mulvdi3: Integer library routines.
24509 * __mulvsi3: Integer library routines.
24510 * __mulxf3: Soft float library routines.
24511 * __nedf2: Soft float library routines.
24512 * __negdf2: Soft float library routines.
24513 * __negdi2: Integer library routines.
24514 * __negsf2: Soft float library routines.
24515 * __negtf2: Soft float library routines.
24516 * __negti2: Integer library routines.
24517 * __negvdi2: Integer library routines.
24518 * __negvsi2: Integer library routines.
24519 * __negxf2: Soft float library routines.
24520 * __nesf2: Soft float library routines.
24521 * __netf2: Soft float library routines.
24522 * __paritydi2: Integer library routines.
24523 * __paritysi2: Integer library routines.
24524 * __parityti2: Integer library routines.
24525 * __popcountdi2: Integer library routines.
24526 * __popcountsi2: Integer library routines.
24527 * __popcountti2: Integer library routines.
24528 * __subdf3: Soft float library routines.
24529 * __subsf3: Soft float library routines.
24530 * __subtf3: Soft float library routines.
24531 * __subvdi3: Integer library routines.
24532 * __subvsi3: Integer library routines.
24533 * __subxf3: Soft float library routines.
24534 * __truncdfsf2: Soft float library routines.
24535 * __trunctfdf2: Soft float library routines.
24536 * __trunctfsf2: Soft float library routines.
24537 * __truncxfdf2: Soft float library routines.
24538 * __truncxfsf2: Soft float library routines.
24539 * __ucmpdi2: Integer library routines.
24540 * __ucmpti2: Integer library routines.
24541 * __udivdi3: Integer library routines.
24542 * __udivmoddi3: Integer library routines.
24543 * __udivsi3: Integer library routines.
24544 * __udivti3: Integer library routines.
24545 * __umoddi3: Integer library routines.
24546 * __umodsi3: Integer library routines.
24547 * __umodti3: Integer library routines.
24548 * __unorddf2: Soft float library routines.
24549 * __unordsf2: Soft float library routines.
24550 * __unordtf2: Soft float library routines.
24551 * abort: Portability.
24553 * abs and attributes: Expressions.
24554 * ABS_EXPR: Expression trees.
24555 * absence_set: Automaton pipeline description.
24556 * absM2 instruction pattern: Standard Names.
24557 * absolute value: Arithmetic.
24558 * access to operands: Accessors.
24559 * access to special operands: Special Accessors.
24560 * accessors: Accessors.
24561 * ACCUMULATE_OUTGOING_ARGS: Stack Arguments.
24562 * ACCUMULATE_OUTGOING_ARGS and stack frames: Function Entry.
24563 * ADA_LONG_TYPE_SIZE: Type Layout.
24564 * ADDITIONAL_REGISTER_NAMES: Instruction Output.
24565 * addM3 instruction pattern: Standard Names.
24566 * addMODEcc instruction pattern: Standard Names.
24567 * addr_diff_vec: Side Effects.
24568 * addr_diff_vec, length of: Insn Lengths.
24569 * ADDR_EXPR: Expression trees.
24570 * addr_vec: Side Effects.
24571 * addr_vec, length of: Insn Lengths.
24572 * address constraints: Simple Constraints.
24573 * address_operand: Simple Constraints.
24574 * addressing modes: Addressing Modes.
24575 * addressof: Regs and Memory.
24576 * ADJUST_FIELD_ALIGN: Storage Layout.
24577 * ADJUST_INSN_LENGTH: Insn Lengths.
24578 * aggregates as return values: Aggregate Return.
24579 * ALL_COP_ADDITIONAL_REGISTER_NAMES: MIPS Coprocessors.
24580 * ALL_REGS: Register Classes.
24581 * ALLOCATE_INITIAL_VALUE: Misc.
24582 * allocate_stack instruction pattern: Standard Names.
24583 * alternate entry points: Insns.
24584 * analysis, data flow: Passes.
24586 * and and attributes: Expressions.
24587 * and, canonicalization of: Insn Canonicalizations.
24588 * andM3 instruction pattern: Standard Names.
24589 * APPLY_RESULT_SIZE: Scalar Return.
24590 * ARG_POINTER_CFA_OFFSET: Frame Layout.
24591 * ARG_POINTER_REGNUM: Frame Registers.
24592 * ARG_POINTER_REGNUM and virtual registers: Regs and Memory.
24593 * arg_pointer_rtx: Frame Registers.
24594 * ARGS_GROW_DOWNWARD: Frame Layout.
24595 * argument passing: Interface.
24596 * arguments in registers: Register Arguments.
24597 * arguments on stack: Stack Arguments.
24598 * arithmetic library: Soft float library routines.
24599 * arithmetic shift: Arithmetic.
24600 * arithmetic simplifications: Passes.
24601 * arithmetic, in RTL: Arithmetic.
24602 * ARITHMETIC_TYPE_P: Types.
24604 * ARRAY_REF: Expression trees.
24605 * ARRAY_TYPE: Types.
24606 * AS_NEEDS_DASH_FOR_PIPED_INPUT: Driver.
24607 * ashift: Arithmetic.
24608 * ashift and attributes: Expressions.
24609 * ashiftrt: Arithmetic.
24610 * ashiftrt and attributes: Expressions.
24611 * ashlM3 instruction pattern: Standard Names.
24612 * ashrM3 instruction pattern: Standard Names.
24613 * ASM_APP_OFF: File Framework.
24614 * ASM_APP_ON: File Framework.
24615 * ASM_CLOBBERS: Function Bodies.
24616 * ASM_COMMENT_START: File Framework.
24617 * ASM_CV_QUAL: Function Bodies.
24618 * ASM_DECLARE_CLASS_REFERENCE: Label Output.
24619 * ASM_DECLARE_CONSTANT_NAME: Label Output.
24620 * ASM_DECLARE_FUNCTION_NAME: Label Output.
24621 * ASM_DECLARE_FUNCTION_SIZE: Label Output.
24622 * ASM_DECLARE_OBJECT_NAME: Label Output.
24623 * ASM_DECLARE_REGISTER_GLOBAL: Label Output.
24624 * ASM_DECLARE_UNRESOLVED_REFERENCE: Label Output.
24625 * ASM_FINAL_SPEC: Driver.
24626 * ASM_FINISH_DECLARE_OBJECT: Label Output.
24627 * ASM_FORMAT_PRIVATE_NAME: Label Output.
24628 * asm_fprintf: Instruction Output.
24629 * ASM_FPRINTF_EXTENSIONS: Instruction Output.
24630 * ASM_GENERATE_INTERNAL_LABEL: Label Output.
24631 * asm_input: Side Effects.
24632 * asm_input and /v: Flags.
24633 * ASM_INPUTS: Function Bodies.
24634 * ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX: Exception Handling.
24635 * ASM_NO_SKIP_IN_TEXT: Alignment Output.
24636 * asm_noperands: Insns.
24637 * asm_operands and /v: Flags.
24638 * asm_operands, RTL sharing: Sharing.
24639 * asm_operands, usage: Assembler.
24640 * ASM_OUTPUT_ADDR_DIFF_ELT: Dispatch Tables.
24641 * ASM_OUTPUT_ADDR_VEC_ELT: Dispatch Tables.
24642 * ASM_OUTPUT_ALIGN: Alignment Output.
24643 * ASM_OUTPUT_ALIGN_WITH_NOP: Alignment Output.
24644 * ASM_OUTPUT_ALIGNED_BSS: Uninitialized Data.
24645 * ASM_OUTPUT_ALIGNED_COMMON: Uninitialized Data.
24646 * ASM_OUTPUT_ALIGNED_DECL_COMMON: Uninitialized Data.
24647 * ASM_OUTPUT_ALIGNED_DECL_LOCAL: Uninitialized Data.
24648 * ASM_OUTPUT_ALIGNED_LOCAL: Uninitialized Data.
24649 * ASM_OUTPUT_ASCII: Data Output.
24650 * ASM_OUTPUT_BSS: Uninitialized Data.
24651 * ASM_OUTPUT_CASE_END: Dispatch Tables.
24652 * ASM_OUTPUT_CASE_LABEL: Dispatch Tables.
24653 * ASM_OUTPUT_COMMON: Uninitialized Data.
24654 * ASM_OUTPUT_DEBUG_LABEL: Label Output.
24655 * ASM_OUTPUT_DEF: Label Output.
24656 * ASM_OUTPUT_DEF_FROM_DECLS: Label Output.
24657 * ASM_OUTPUT_DWARF_DELTA: SDB and DWARF.
24658 * ASM_OUTPUT_DWARF_OFFSET: SDB and DWARF.
24659 * ASM_OUTPUT_DWARF_PCREL: SDB and DWARF.
24660 * ASM_OUTPUT_EXTERNAL: Label Output.
24661 * ASM_OUTPUT_FDESC: Data Output.
24662 * ASM_OUTPUT_IDENT: File Framework.
24663 * ASM_OUTPUT_LABEL: Label Output.
24664 * ASM_OUTPUT_LABEL_REF: Label Output.
24665 * ASM_OUTPUT_LABELREF: Label Output.
24666 * ASM_OUTPUT_LOCAL: Uninitialized Data.
24667 * ASM_OUTPUT_MAX_SKIP_ALIGN: Alignment Output.
24668 * ASM_OUTPUT_MEASURED_SIZE: Label Output.
24669 * ASM_OUTPUT_OPCODE: Instruction Output.
24670 * ASM_OUTPUT_POOL_EPILOGUE: Data Output.
24671 * ASM_OUTPUT_POOL_PROLOGUE: Data Output.
24672 * ASM_OUTPUT_REG_POP: Instruction Output.
24673 * ASM_OUTPUT_REG_PUSH: Instruction Output.
24674 * ASM_OUTPUT_SHARED_BSS: Uninitialized Data.
24675 * ASM_OUTPUT_SHARED_COMMON: Uninitialized Data.
24676 * ASM_OUTPUT_SHARED_LOCAL: Uninitialized Data.
24677 * ASM_OUTPUT_SIZE_DIRECTIVE: Label Output.
24678 * ASM_OUTPUT_SKIP: Alignment Output.
24679 * ASM_OUTPUT_SOURCE_FILENAME: File Framework.
24680 * ASM_OUTPUT_SOURCE_LINE: File Framework.
24681 * ASM_OUTPUT_SPECIAL_POOL_ENTRY: Data Output.
24682 * ASM_OUTPUT_SYMBOL_REF: Label Output.
24683 * ASM_OUTPUT_TYPE_DIRECTIVE: Label Output.
24684 * ASM_OUTPUT_WEAK_ALIAS: Label Output.
24685 * ASM_OUTPUTS: Function Bodies.
24686 * ASM_PREFERRED_EH_DATA_FORMAT: Exception Handling.
24687 * ASM_SPEC: Driver.
24688 * ASM_STABD_OP: DBX Options.
24689 * ASM_STABN_OP: DBX Options.
24690 * ASM_STABS_OP: DBX Options.
24691 * ASM_STMT: Function Bodies.
24692 * ASM_STRING: Function Bodies.
24693 * ASM_WEAKEN_DECL: Label Output.
24694 * ASM_WEAKEN_LABEL: Label Output.
24695 * assemble_name: Label Output.
24696 * assembler format: File Framework.
24697 * assembler instructions in RTL: Assembler.
24698 * ASSEMBLER_DIALECT: Instruction Output.
24699 * assigning attribute values to insns: Tagging Insns.
24700 * assignment operator: Function Basics.
24701 * asterisk in template: Output Statement.
24702 * atan2M3 instruction pattern: Standard Names.
24703 * attr <1>: Expressions.
24704 * attr: Tagging Insns.
24705 * attr_flag: Expressions.
24706 * attribute expressions: Expressions.
24707 * attribute specifications: Attr Example.
24708 * attribute specifications example: Attr Example.
24709 * attributes: Attributes.
24710 * attributes, defining: Defining Attributes.
24711 * attributes, target-specific: Target Attributes.
24712 * autoincrement addressing, availability: Portability.
24713 * autoincrement/decrement addressing: Simple Constraints.
24714 * autoincrement/decrement analysis: Passes.
24715 * automata_option: Automaton pipeline description.
24716 * automaton based pipeline description <1>: Automaton pipeline description.
24717 * automaton based pipeline description <2>: Comparison of the two descriptions.
24718 * automaton based pipeline description: Processor pipeline description.
24719 * automaton based scheduler: Processor pipeline description.
24720 * AVOID_CCMODE_COPIES: Values in Registers.
24721 * backslash: Output Template.
24723 * barrier and /f: Flags.
24724 * barrier and /i: Flags.
24725 * barrier and /v: Flags.
24726 * BASE_REG_CLASS: Register Classes.
24727 * basic block reordering: Passes.
24728 * basic blocks: Passes.
24729 * bCOND instruction pattern: Standard Names.
24730 * bcopy, implicit usage: Library Calls.
24731 * BIGGEST_ALIGNMENT: Storage Layout.
24732 * BIGGEST_FIELD_ALIGNMENT: Storage Layout.
24733 * BImode: Machine Modes.
24734 * BIND_EXPR: Expression trees.
24735 * BINFO_TYPE: Classes.
24736 * bit-fields: Bit-Fields.
24737 * BIT_AND_EXPR: Expression trees.
24738 * BIT_IOR_EXPR: Expression trees.
24739 * BIT_NOT_EXPR: Expression trees.
24740 * BIT_XOR_EXPR: Expression trees.
24741 * BITFIELD_NBYTES_LIMITED: Storage Layout.
24742 * BITS_BIG_ENDIAN: Storage Layout.
24743 * BITS_BIG_ENDIAN, effect on sign_extract: Bit-Fields.
24744 * BITS_PER_UNIT: Storage Layout.
24745 * BITS_PER_WORD: Storage Layout.
24746 * bitwise complement: Arithmetic.
24747 * bitwise exclusive-or: Arithmetic.
24748 * bitwise inclusive-or: Arithmetic.
24749 * bitwise logical-and: Arithmetic.
24750 * BLKmode: Machine Modes.
24751 * BLKmode, and function return values: Calls.
24752 * BLOCK_REG_PADDING: Register Arguments.
24753 * bool <1>: Sections.
24754 * bool <2>: Exception Region Output.
24756 * BOOL_TYPE_SIZE: Type Layout.
24757 * BOOLEAN_TYPE: Types.
24758 * branch shortening: Passes.
24759 * BRANCH_COST: Costs.
24760 * break_out_memory_refs: Addressing Modes.
24761 * BREAK_STMT: Function Bodies.
24762 * BSS_SECTION_ASM_OP: Sections.
24763 * builtin_longjmp instruction pattern: Standard Names.
24764 * BUILTIN_SETJMP_FRAME_VALUE: Frame Layout.
24765 * builtin_setjmp_receiver instruction pattern: Standard Names.
24766 * builtin_setjmp_setup instruction pattern: Standard Names.
24767 * byte_mode: Machine Modes.
24768 * BYTES_BIG_ENDIAN: Storage Layout.
24769 * BYTES_BIG_ENDIAN, effect on subreg: Regs and Memory.
24770 * bzero, implicit usage: Library Calls.
24771 * C statements for assembler output: Output Statement.
24772 * C/C++ Internal Representation: Trees.
24773 * C4X_FLOAT_FORMAT: Storage Layout.
24774 * C99 math functions, implicit usage: Library Calls.
24775 * c_register_pragma: Misc.
24776 * call <1>: Side Effects.
24778 * call instruction pattern: Standard Names.
24779 * call usage: Calls.
24780 * call, in mem: Flags.
24781 * call-clobbered register: Register Basics.
24782 * call-saved register: Register Basics.
24783 * call-used register: Register Basics.
24784 * CALL_EXPR: Expression trees.
24785 * call_insn: Insns.
24786 * call_insn and /f: Flags.
24787 * call_insn and /i: Flags.
24788 * call_insn and /j: Flags.
24789 * call_insn and /s: Flags.
24790 * call_insn and /u: Flags.
24791 * call_insn and /v: Flags.
24792 * CALL_INSN_FUNCTION_USAGE: Insns.
24793 * call_pop instruction pattern: Standard Names.
24794 * CALL_POPS_ARGS: Stack Arguments.
24795 * CALL_REALLY_USED_REGISTERS: Register Basics.
24796 * CALL_USED_REGISTERS: Register Basics.
24797 * call_used_regs: Register Basics.
24798 * call_value instruction pattern: Standard Names.
24799 * call_value_pop instruction pattern: Standard Names.
24800 * CALLER_SAVE_PROFITABLE: Caller Saves.
24801 * calling conventions: Stack and Calling.
24802 * calling functions in RTL: Calls.
24803 * CAN_DEBUG_WITHOUT_FP: Run-time Target.
24804 * CAN_ELIMINATE: Elimination.
24805 * canadian: Configure Terms.
24806 * CANNOT_CHANGE_MODE_CLASS: Register Classes.
24807 * canonicalization of instructions: Insn Canonicalizations.
24808 * CANONICALIZE_COMPARISON: Condition Code.
24809 * canonicalize_funcptr_for_compare instruction pattern: Standard Names.
24810 * CASE_DROPS_THROUGH: Misc.
24811 * CASE_USE_BIT_TESTS: Misc.
24812 * CASE_VALUES_THRESHOLD: Misc.
24813 * CASE_VECTOR_MODE: Misc.
24814 * CASE_VECTOR_PC_RELATIVE: Misc.
24815 * CASE_VECTOR_SHORTEN_MODE: Misc.
24816 * casesi instruction pattern: Standard Names.
24817 * cc0: Regs and Memory.
24818 * cc0, RTL sharing: Sharing.
24819 * cc0_rtx: Regs and Memory.
24820 * CC1_SPEC: Driver.
24821 * CC1PLUS_SPEC: Driver.
24822 * cc_status: Condition Code.
24823 * CC_STATUS_MDEP: Condition Code.
24824 * CC_STATUS_MDEP_INIT: Condition Code.
24825 * CCmode: Machine Modes.
24826 * CDImode: Machine Modes.
24827 * ceilM2 instruction pattern: Standard Names.
24828 * chain_next: GTY Options.
24829 * chain_prev: GTY Options.
24830 * change_address: Standard Names.
24831 * char <1>: Sections.
24832 * char: PCH Target.
24833 * CHAR_TYPE_SIZE: Type Layout.
24834 * check_stack instruction pattern: Standard Names.
24835 * CHImode: Machine Modes.
24837 * class definitions, register: Register Classes.
24838 * class preference constraints: Class Preferences.
24839 * CLASS_LIKELY_SPILLED_P: Register Classes.
24840 * CLASS_MAX_NREGS: Register Classes.
24841 * CLASS_TYPE_P: Types.
24842 * classes of RTX codes: RTL Classes.
24843 * CLASSTYPE_DECLARED_CLASS: Classes.
24844 * CLASSTYPE_HAS_MUTABLE: Classes.
24845 * CLASSTYPE_NON_POD_P: Classes.
24846 * CLEANUP_DECL: Function Bodies.
24847 * CLEANUP_EXPR: Function Bodies.
24848 * CLEANUP_POINT_EXPR: Expression trees.
24849 * CLEANUP_STMT: Function Bodies.
24850 * CLEAR_BY_PIECES_P: Costs.
24851 * CLEAR_INSN_CACHE: Trampolines.
24852 * CLEAR_RATIO: Costs.
24853 * clobber: Side Effects.
24854 * clrstrM instruction pattern: Standard Names.
24856 * CLZ_DEFINED_VALUE_AT_ZERO: Misc.
24857 * clzM2 instruction pattern: Standard Names.
24858 * cmpM instruction pattern: Standard Names.
24859 * cmpmemM instruction pattern: Standard Names.
24860 * cmpstrM instruction pattern: Standard Names.
24861 * code generation RTL sequences: Expander Definitions.
24862 * code motion: Passes.
24863 * code_label: Insns.
24864 * code_label and /i: Flags.
24865 * code_label and /v: Flags.
24866 * CODE_LABEL_NUMBER: Insns.
24867 * codes, RTL expression: RTL Objects.
24868 * COImode: Machine Modes.
24869 * COLLECT2_HOST_INITIALIZATION: Host Misc.
24870 * COLLECT_EXPORT_LIST: Misc.
24871 * COLLECT_PARSE_FLAG: Macros for Initialization.
24872 * COLLECT_SHARED_FINI_FUNC: Macros for Initialization.
24873 * COLLECT_SHARED_INIT_FUNC: Macros for Initialization.
24874 * combiner pass: Regs and Memory.
24875 * common subexpression elimination: Passes.
24876 * compare: Arithmetic.
24877 * compare, canonicalization of: Insn Canonicalizations.
24878 * compiler passes and files: Passes.
24879 * complement, bitwise: Arithmetic.
24880 * COMPLEX_CST: Expression trees.
24881 * COMPLEX_EXPR: Expression trees.
24882 * COMPLEX_TYPE: Types.
24883 * COMPONENT_REF: Expression trees.
24884 * COMPOUND_BODY: Function Bodies.
24885 * COMPOUND_EXPR: Expression trees.
24886 * COMPOUND_LITERAL_EXPR: Expression trees.
24887 * COMPOUND_LITERAL_EXPR_DECL: Expression trees.
24888 * COMPOUND_LITERAL_EXPR_DECL_STMT: Expression trees.
24889 * COMPOUND_STMT: Function Bodies.
24890 * computing the length of an insn: Insn Lengths.
24891 * concat and /u: Flags.
24892 * cond: Comparisons.
24893 * cond and attributes: Expressions.
24894 * cond_exec: Side Effects.
24895 * COND_EXPR: Expression trees.
24896 * condition code register: Regs and Memory.
24897 * condition code status: Condition Code.
24898 * condition codes: Comparisons.
24899 * conditional execution: Conditional Execution.
24900 * CONDITIONAL_REGISTER_USAGE: Register Basics.
24901 * conditional_trap instruction pattern: Standard Names.
24902 * conditions, in patterns: Patterns.
24903 * configuration file <1>: Filesystem.
24904 * configuration file: Host Misc.
24905 * configure terms: Configure Terms.
24906 * CONJ_EXPR: Expression trees.
24907 * const and /i: Flags.
24908 * const0_rtx: Constants.
24909 * CONST0_RTX: Constants.
24910 * CONST1_RTX: Constants.
24911 * const1_rtx: Constants.
24912 * CONST2_RTX: Constants.
24913 * const2_rtx: Constants.
24914 * CONST_DECL: Declarations.
24915 * const_double: Constants.
24916 * const_double, RTL sharing: Sharing.
24917 * CONST_DOUBLE_CHAIN: Constants.
24918 * CONST_DOUBLE_LOW: Constants.
24919 * CONST_DOUBLE_MEM: Constants.
24920 * CONST_DOUBLE_OK_FOR_CONSTRAINT_P: Register Classes.
24921 * CONST_DOUBLE_OK_FOR_LETTER_P: Register Classes.
24922 * const_int: Constants.
24923 * const_int and attribute tests: Expressions.
24924 * const_int and attributes: Expressions.
24925 * const_int, RTL sharing: Sharing.
24926 * CONST_OK_FOR_CONSTRAINT_P: Register Classes.
24927 * CONST_OK_FOR_LETTER_P: Register Classes.
24928 * CONST_OR_PURE_CALL_P: Flags.
24929 * const_string: Constants.
24930 * const_string and attributes: Expressions.
24931 * const_true_rtx: Constants.
24932 * const_vector: Constants.
24933 * const_vector, RTL sharing: Sharing.
24934 * constant attributes: Constant Attributes.
24935 * constant definitions: Constant Definitions.
24936 * constant folding: Passes.
24937 * constant propagation: Passes.
24938 * CONSTANT_ADDRESS_P: Addressing Modes.
24939 * CONSTANT_ALIGNMENT: Storage Layout.
24940 * CONSTANT_P: Addressing Modes.
24941 * CONSTANT_POOL_ADDRESS_P: Flags.
24942 * CONSTANT_POOL_BEFORE_FUNCTION: Data Output.
24943 * constants in constraints: Simple Constraints.
24944 * constm1_rtx: Constants.
24945 * constraint modifier characters: Modifiers.
24946 * constraint, matching: Simple Constraints.
24947 * CONSTRAINT_LEN: Register Classes.
24948 * constraints: Constraints.
24949 * constraints, machine specific: Machine Constraints.
24950 * CONSTRUCTOR: Expression trees.
24951 * constructor: Function Basics.
24952 * constructors, automatic calls: Collect2.
24953 * constructors, output of: Initialization.
24954 * container: Containers.
24955 * CONTINUE_STMT: Function Bodies.
24956 * contributors: Contributors.
24957 * controlling register usage: Register Basics.
24958 * controlling the compilation driver: Driver.
24959 * conventions, run-time: Interface.
24960 * conversions: Conversions.
24961 * CONVERT_EXPR: Expression trees.
24962 * copy constructor: Function Basics.
24963 * copy propagation: Passes.
24964 * copy_rtx: Addressing Modes.
24965 * copy_rtx_if_shared: Sharing.
24966 * cosM2 instruction pattern: Standard Names.
24967 * costs of instructions: Costs.
24968 * CP_INTEGRAL_TYPE: Types.
24969 * cp_namespace_decls: Namespaces.
24970 * CP_TYPE_CONST_NON_VOLATILE_P: Types.
24971 * CP_TYPE_CONST_P: Types.
24972 * CP_TYPE_QUALS: Types.
24973 * CP_TYPE_RESTRICT_P: Types.
24974 * CP_TYPE_VOLATILE_P: Types.
24975 * CPLUSPLUS_CPP_SPEC: Driver.
24976 * CPP_SPEC: Driver.
24977 * CQImode: Machine Modes.
24978 * cross compilation and floating point: Floating Point.
24979 * CRT_CALL_STATIC_FUNCTION: Sections.
24980 * CRTSTUFF_T_CFLAGS: Target Fragment.
24981 * CRTSTUFF_T_CFLAGS_S: Target Fragment.
24982 * CSImode: Machine Modes.
24983 * CTImode: Machine Modes.
24985 * CTZ_DEFINED_VALUE_AT_ZERO: Misc.
24986 * ctzM2 instruction pattern: Standard Names.
24987 * CUMULATIVE_ARGS: Register Arguments.
24988 * current_function_epilogue_delay_list: Function Entry.
24989 * current_function_is_leaf: Leaf Functions.
24990 * current_function_outgoing_args_size: Stack Arguments.
24991 * current_function_pops_args: Function Entry.
24992 * current_function_pretend_args_size: Function Entry.
24993 * current_function_uses_only_leaf_regs: Leaf Functions.
24994 * current_insn_predicate: Conditional Execution.
24995 * data bypass <1>: Automaton pipeline description.
24996 * data bypass: Comparison of the two descriptions.
24997 * data dependence delays: Processor pipeline description.
24998 * data flow analysis: Passes.
24999 * data structures: Per-Function Data.
25000 * DATA_ALIGNMENT: Storage Layout.
25001 * data_section: Sections.
25002 * DATA_SECTION_ASM_OP: Sections.
25003 * DBR_OUTPUT_SEQEND: Instruction Output.
25004 * dbr_sequence_length: Instruction Output.
25005 * DBX_BLOCKS_FUNCTION_RELATIVE: DBX Options.
25006 * DBX_CONTIN_CHAR: DBX Options.
25007 * DBX_CONTIN_LENGTH: DBX Options.
25008 * DBX_DEBUGGING_INFO: DBX Options.
25009 * DBX_FUNCTION_FIRST: DBX Options.
25010 * DBX_MEMPARM_STABS_LETTER: DBX Options.
25011 * DBX_NO_XREFS: DBX Options.
25012 * DBX_OUTPUT_FUNCTION_END: DBX Hooks.
25013 * DBX_OUTPUT_LBRAC: DBX Hooks.
25014 * DBX_OUTPUT_MAIN_SOURCE_DIRECTORY: File Names and DBX.
25015 * DBX_OUTPUT_MAIN_SOURCE_FILE_END: File Names and DBX.
25016 * DBX_OUTPUT_MAIN_SOURCE_FILENAME: File Names and DBX.
25017 * DBX_OUTPUT_NFUN: DBX Hooks.
25018 * DBX_OUTPUT_RBRAC: DBX Hooks.
25019 * DBX_OUTPUT_STANDARD_TYPES: DBX Hooks.
25020 * DBX_REGISTER_NUMBER: All Debuggers.
25021 * DBX_REGPARM_STABS_CODE: DBX Options.
25022 * DBX_REGPARM_STABS_LETTER: DBX Options.
25023 * DBX_STATIC_CONST_VAR_CODE: DBX Options.
25024 * DBX_STATIC_STAB_DATA_SECTION: DBX Options.
25025 * DBX_TYPE_DECL_STABS_CODE: DBX Options.
25026 * DBX_USE_BINCL: DBX Options.
25027 * DCmode: Machine Modes.
25028 * De Morgan's law: Insn Canonicalizations.
25029 * dead code: Passes.
25030 * dead_or_set_p: define_peephole.
25031 * DEBUG_SYMS_TEXT: DBX Options.
25032 * DEBUGGER_ARG_OFFSET: All Debuggers.
25033 * DEBUGGER_AUTO_OFFSET: All Debuggers.
25034 * debugging information generation: Passes.
25035 * DECL_ALIGN: Declarations.
25036 * DECL_ANTICIPATED: Function Basics.
25037 * DECL_ARGUMENTS: Function Basics.
25038 * DECL_ARRAY_DELETE_OPERATOR_P: Function Basics.
25039 * DECL_ARTIFICIAL <1>: Function Basics.
25040 * DECL_ARTIFICIAL: Declarations.
25041 * DECL_ASSEMBLER_NAME: Function Basics.
25042 * DECL_ATTRIBUTES: Attributes.
25043 * DECL_BASE_CONSTRUCTOR_P: Function Basics.
25044 * DECL_CLASS_SCOPE_P: Declarations.
25045 * DECL_COMPLETE_CONSTRUCTOR_P: Function Basics.
25046 * DECL_COMPLETE_DESTRUCTOR_P: Function Basics.
25047 * DECL_CONST_MEMFUNC_P: Function Basics.
25048 * DECL_CONSTRUCTOR_P: Function Basics.
25049 * DECL_CONTEXT: Namespaces.
25050 * DECL_CONV_FN_P: Function Basics.
25051 * DECL_COPY_CONSTRUCTOR_P: Function Basics.
25052 * DECL_DESTRUCTOR_P: Function Basics.
25053 * DECL_EXTERN_C_FUNCTION_P: Function Basics.
25054 * DECL_EXTERNAL <1>: Declarations.
25055 * DECL_EXTERNAL: Function Basics.
25056 * DECL_FUNCTION_MEMBER_P: Function Basics.
25057 * DECL_FUNCTION_SCOPE_P: Declarations.
25058 * DECL_GLOBAL_CTOR_P: Function Basics.
25059 * DECL_GLOBAL_DTOR_P: Function Basics.
25060 * DECL_INITIAL: Declarations.
25061 * DECL_LINKONCE_P: Function Basics.
25062 * DECL_LOCAL_FUNCTION_P: Function Basics.
25063 * DECL_MAIN_P: Function Basics.
25064 * DECL_NAME <1>: Namespaces.
25065 * DECL_NAME <2>: Declarations.
25066 * DECL_NAME: Function Basics.
25067 * DECL_NAMESPACE_ALIAS: Namespaces.
25068 * DECL_NAMESPACE_SCOPE_P: Declarations.
25069 * DECL_NAMESPACE_STD_P: Namespaces.
25070 * DECL_NON_THUNK_FUNCTION_P: Function Basics.
25071 * DECL_NONCONVERTING_P: Function Basics.
25072 * DECL_NONSTATIC_MEMBER_FUNCTION_P: Function Basics.
25073 * DECL_OVERLOADED_OPERATOR_P: Function Basics.
25074 * DECL_RESULT: Function Basics.
25075 * DECL_SIZE: Declarations.
25076 * DECL_SOURCE_FILE: Declarations.
25077 * DECL_SOURCE_LINE: Declarations.
25078 * DECL_STATIC_FUNCTION_P: Function Basics.
25079 * DECL_STMT: Function Bodies.
25080 * DECL_STMT_DECL: Function Bodies.
25081 * DECL_THUNK_P: Function Basics.
25082 * DECL_VOLATILE_MEMFUNC_P: Function Basics.
25083 * declaration: Declarations.
25084 * declarations, RTL: RTL Declarations.
25085 * DECLARE_LIBRARY_RENAMES: Library Calls.
25086 * decrement_and_branch_until_zero instruction pattern: Standard Names.
25087 * default: GTY Options.
25088 * default_file_start: File Framework.
25089 * DEFAULT_GDB_EXTENSIONS: DBX Options.
25090 * DEFAULT_MAIN_RETURN: Misc.
25091 * DEFAULT_PCC_STRUCT_RETURN: Aggregate Return.
25092 * DEFAULT_SHORT_ENUMS: Type Layout.
25093 * DEFAULT_SIGNED_CHAR: Type Layout.
25094 * define_asm_attributes: Tagging Insns.
25095 * define_attr: Defining Attributes.
25096 * define_automaton: Automaton pipeline description.
25097 * define_bypass: Automaton pipeline description.
25098 * define_cond_exec: Conditional Execution.
25099 * define_constants: Constant Definitions.
25100 * define_cpu_unit: Automaton pipeline description.
25101 * define_delay: Delay Slots.
25102 * define_expand: Expander Definitions.
25103 * define_function_unit: Old pipeline description.
25104 * define_insn: Patterns.
25105 * define_insn example: Example.
25106 * define_insn_and_split: Insn Splitting.
25107 * define_insn_reservation: Automaton pipeline description.
25108 * define_peephole: define_peephole.
25109 * define_peephole2: define_peephole2.
25110 * define_query_cpu_unit: Automaton pipeline description.
25111 * define_reservation: Automaton pipeline description.
25112 * define_split: Insn Splitting.
25113 * defining attributes and their values: Defining Attributes.
25114 * defining jump instruction patterns: Jump Patterns.
25115 * defining looping instruction patterns: Looping Patterns.
25116 * defining peephole optimizers: Peephole Definitions.
25117 * defining RTL sequences for code generation: Expander Definitions.
25118 * delay slots, defining: Delay Slots.
25119 * DELAY_SLOTS_FOR_EPILOGUE: Function Entry.
25120 * delayed branch scheduling: Passes.
25121 * deletable: GTY Options.
25122 * Dependent Patterns: Dependent Patterns.
25123 * desc: GTY Options.
25124 * destructor: Function Basics.
25125 * destructors, output of: Initialization.
25126 * deterministic finite state automaton <1>: Processor pipeline description.
25127 * deterministic finite state automaton: Automaton pipeline description.
25128 * DFA_PIPELINE_INTERFACE: Scheduling.
25129 * DFmode: Machine Modes.
25130 * digits in constraint: Simple Constraints.
25131 * DImode: Machine Modes.
25132 * DIR_SEPARATOR: Filesystem.
25133 * DIR_SEPARATOR_2: Filesystem.
25134 * directory options .md: Including Patterns.
25135 * disabling certain registers: Register Basics.
25136 * dispatch table: Dispatch Tables.
25138 * div and attributes: Expressions.
25139 * division: Arithmetic.
25140 * divM3 instruction pattern: Standard Names.
25141 * divmodM4 instruction pattern: Standard Names.
25142 * DO_BODY: Function Bodies.
25143 * DO_COND: Function Bodies.
25144 * DO_STMT: Function Bodies.
25145 * DOLLARS_IN_IDENTIFIERS: Misc.
25146 * doloop_begin instruction pattern: Standard Names.
25147 * doloop_end instruction pattern: Standard Names.
25148 * DONE: Expander Definitions.
25149 * DOUBLE_TYPE_SIZE: Type Layout.
25151 * DRIVER_SELF_SPECS: Driver.
25152 * DUMPFILE_FORMAT: Filesystem.
25153 * DWARF2_ASM_LINE_DEBUG_INFO: SDB and DWARF.
25154 * DWARF2_DEBUGGING_INFO: SDB and DWARF.
25155 * DWARF2_FRAME_INFO: SDB and DWARF.
25156 * DWARF2_FRAME_REG_OUT: Frame Registers.
25157 * DWARF2_GENERATE_TEXT_SECTION_LABEL: SDB and DWARF.
25158 * DWARF2_UNWIND_INFO: Exception Region Output.
25159 * DWARF_ALT_FRAME_RETURN_COLUMN: Frame Layout.
25160 * DWARF_CIE_DATA_ALIGNMENT: Exception Region Output.
25161 * DWARF_FRAME_REGISTERS: Frame Registers.
25162 * DWARF_FRAME_REGNUM: Frame Registers.
25163 * DWARF_REG_TO_UNWIND_COLUMN: Frame Registers.
25164 * DYNAMIC_CHAIN_ADDRESS: Frame Layout.
25165 * E in constraint: Simple Constraints.
25166 * earlyclobber operand: Modifiers.
25167 * EDOM, implicit usage: Library Calls.
25168 * EH_FRAME_IN_DATA_SECTION: Exception Region Output.
25169 * EH_FRAME_SECTION_NAME: Exception Region Output.
25170 * eh_return instruction pattern: Standard Names.
25171 * EH_RETURN_DATA_REGNO: Exception Handling.
25172 * EH_RETURN_HANDLER_RTX: Exception Handling.
25173 * EH_RETURN_STACKADJ_RTX: Exception Handling.
25174 * EH_USES: Function Entry.
25175 * ELIGIBLE_FOR_EPILOGUE_DELAY: Function Entry.
25176 * ELIMINABLE_REGS: Elimination.
25177 * ELSE_CLAUSE: Function Bodies.
25178 * EMIT_MODE_SET: Mode Switching.
25179 * EMPTY_CLASS_EXPR: Function Bodies.
25180 * EMPTY_FIELD_BOUNDARY: Storage Layout.
25181 * ENABLE_EXECUTE_STACK: Trampolines.
25182 * ENDFILE_SPEC: Driver.
25183 * endianness: Portability.
25184 * enum machine_mode: Machine Modes.
25185 * enum reg_class: Register Classes.
25186 * ENUMERAL_TYPE: Types.
25187 * epilogue: Function Entry.
25188 * epilogue instruction pattern: Standard Names.
25189 * EPILOGUE_USES: Function Entry.
25191 * eq and attributes: Expressions.
25192 * eq_attr: Expressions.
25193 * EQ_EXPR: Expression trees.
25194 * equal: Comparisons.
25195 * errno, implicit usage: Library Calls.
25196 * escape sequences: Escape Sequences.
25197 * exception handling: Exception Handling.
25198 * exception_receiver instruction pattern: Standard Names.
25199 * exclamation point: Multi-Alternative.
25200 * exclusion_set: Automaton pipeline description.
25201 * exclusive-or, bitwise: Arithmetic.
25202 * EXIT_EXPR: Expression trees.
25203 * EXIT_IGNORE_STACK: Function Entry.
25204 * expander definitions: Expander Definitions.
25205 * expM2 instruction pattern: Standard Names.
25206 * expr_list: Insns.
25207 * EXPR_STMT: Function Bodies.
25208 * EXPR_STMT_EXPR: Function Bodies.
25209 * expression: Expression trees.
25210 * expression codes: RTL Objects.
25211 * extendMN2 instruction pattern: Standard Names.
25212 * extensible constraints: Simple Constraints.
25213 * EXTRA_ADDRESS_CONSTRAINT: Register Classes.
25214 * EXTRA_CONSTRAINT: Register Classes.
25215 * EXTRA_CONSTRAINT_STR: Register Classes.
25216 * EXTRA_MEMORY_CONSTRAINT: Register Classes.
25217 * EXTRA_SECTION_FUNCTIONS: Sections.
25218 * EXTRA_SECTIONS: Sections.
25219 * EXTRA_SPECS: Driver.
25220 * extv instruction pattern: Standard Names.
25221 * extzv instruction pattern: Standard Names.
25222 * F in constraint: Simple Constraints.
25223 * FAIL: Expander Definitions.
25224 * FATAL_EXIT_CODE: Host Misc.
25225 * FDL, GNU Free Documentation License: GNU Free Documentation License.
25226 * features, optional, in system conventions: Run-time Target.
25228 * ffsM2 instruction pattern: Standard Names.
25229 * FIELD_DECL: Declarations.
25230 * file_end_indicate_exec_stack: File Framework.
25231 * FILE_STMT: Function Bodies.
25232 * FILE_STMT_FILENAME: Function Bodies.
25233 * files and passes of the compiler: Passes.
25234 * files, generated: Files.
25235 * final pass: Passes.
25236 * final_absence_set: Automaton pipeline description.
25237 * FINAL_PRESCAN_INSN: Instruction Output.
25238 * final_presence_set: Automaton pipeline description.
25239 * FINAL_REG_PARM_STACK_SPACE: Stack Arguments.
25240 * final_scan_insn: Function Entry.
25241 * final_sequence: Instruction Output.
25242 * FINALIZE_PIC: PIC.
25243 * FIND_BASE_TERM: Addressing Modes.
25244 * FINI_SECTION_ASM_OP: Sections.
25245 * finite state automaton minimization: Automaton pipeline description.
25246 * FIRST_PARM_OFFSET: Frame Layout.
25247 * FIRST_PARM_OFFSET and virtual registers: Regs and Memory.
25248 * FIRST_PSEUDO_REGISTER: Register Basics.
25249 * FIRST_STACK_REG: Stack Registers.
25250 * FIRST_VIRTUAL_REGISTER: Regs and Memory.
25251 * fix: Conversions.
25252 * FIX_TRUNC_EXPR: Expression trees.
25253 * fix_truncMN2 instruction pattern: Standard Names.
25254 * fixed register: Register Basics.
25255 * FIXED_REGISTERS: Register Basics.
25256 * fixed_regs: Register Basics.
25257 * fixMN2 instruction pattern: Standard Names.
25258 * FIXUNS_TRUNC_LIKE_FIX_TRUNC: Misc.
25259 * fixuns_truncMN2 instruction pattern: Standard Names.
25260 * fixunsMN2 instruction pattern: Standard Names.
25261 * flags in RTL expression: Flags.
25262 * float: Conversions.
25263 * FLOAT_EXPR: Expression trees.
25264 * float_extend: Conversions.
25265 * FLOAT_STORE_FLAG_VALUE: Misc.
25266 * float_truncate: Conversions.
25267 * FLOAT_TYPE_SIZE: Type Layout.
25268 * FLOAT_WORDS_BIG_ENDIAN: Storage Layout.
25269 * FLOAT_WORDS_BIG_ENDIAN, (lack of) effect on subreg: Regs and Memory.
25270 * floating point and cross compilation: Floating Point.
25271 * Floating Point Emulation: Target Fragment.
25272 * floating point emulation library, US Software GOFAST: Library Calls.
25273 * floatMN2 instruction pattern: Standard Names.
25274 * floatunsMN2 instruction pattern: Standard Names.
25275 * floorM2 instruction pattern: Standard Names.
25276 * FOR_BODY: Function Bodies.
25277 * FOR_COND: Function Bodies.
25278 * FOR_EXPR: Function Bodies.
25279 * FOR_INIT_STMT: Function Bodies.
25280 * FOR_STMT: Function Bodies.
25281 * FORCE_CODE_SECTION_ALIGN: Sections.
25282 * FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN: Storage Layout.
25283 * force_reg: Standard Names.
25284 * frame layout: Frame Layout.
25285 * FRAME_GROWS_DOWNWARD: Frame Layout.
25286 * FRAME_GROWS_DOWNWARD and virtual registers: Regs and Memory.
25287 * frame_pointer_needed: Function Entry.
25288 * FRAME_POINTER_REGNUM: Frame Registers.
25289 * FRAME_POINTER_REGNUM and virtual registers: Regs and Memory.
25290 * FRAME_POINTER_REQUIRED: Elimination.
25291 * frame_pointer_rtx: Frame Registers.
25292 * frame_related: Flags.
25293 * frame_related, in insn, call_insn, jump_insn, barrier, and set: Flags.
25294 * frame_related, in mem: Flags.
25295 * frame_related, in reg: Flags.
25296 * frame_related, in symbol_ref: Flags.
25297 * ftruncM2 instruction pattern: Standard Names.
25298 * function: Functions.
25299 * function body: Function Bodies.
25300 * function call conventions: Interface.
25301 * function entry and exit: Function Entry.
25302 * function units, for scheduling: Old pipeline description.
25303 * function-call insns: Calls.
25304 * FUNCTION_ARG: Register Arguments.
25305 * FUNCTION_ARG_ADVANCE: Register Arguments.
25306 * FUNCTION_ARG_BOUNDARY: Register Arguments.
25307 * FUNCTION_ARG_CALLEE_COPIES: Register Arguments.
25308 * FUNCTION_ARG_PADDING: Register Arguments.
25309 * FUNCTION_ARG_PARTIAL_NREGS: Register Arguments.
25310 * FUNCTION_ARG_PASS_BY_REFERENCE: Register Arguments.
25311 * FUNCTION_ARG_REGNO_P: Register Arguments.
25312 * FUNCTION_BOUNDARY: Storage Layout.
25313 * FUNCTION_DECL: Functions.
25314 * FUNCTION_INCOMING_ARG: Register Arguments.
25315 * FUNCTION_MODE: Misc.
25316 * FUNCTION_OUTGOING_VALUE: Scalar Return.
25317 * FUNCTION_PROFILER: Profiling.
25318 * FUNCTION_TYPE: Types.
25319 * FUNCTION_VALUE: Scalar Return.
25320 * FUNCTION_VALUE_REGNO_P: Scalar Return.
25321 * functions, leaf: Leaf Functions.
25322 * fundamental type: Types.
25323 * g in constraint: Simple Constraints.
25324 * G in constraint: Simple Constraints.
25325 * GCC and portability: Portability.
25326 * GCC_DRIVER_HOST_INITIALIZATION: Host Misc.
25327 * GCOV_TYPE_SIZE: Type Layout.
25329 * ge and attributes: Expressions.
25330 * GE_EXPR: Expression trees.
25331 * GEN_ERRNO_RTX: Library Calls.
25332 * gencodes: Passes.
25333 * genconfig: Passes.
25334 * general_operand: RTL Template.
25335 * GENERAL_REGS: Register Classes.
25336 * generated files: Files.
25337 * generating assembler output: Output Statement.
25338 * generating insns: RTL Template.
25339 * genflags: Passes.
25340 * get_attr: Expressions.
25341 * get_attr_length: Insn Lengths.
25342 * GET_CLASS_NARROWEST_MODE: Machine Modes.
25343 * GET_CODE: RTL Objects.
25344 * get_frame_size: Elimination.
25345 * get_insns: Insns.
25346 * get_last_insn: Insns.
25347 * GET_MODE: Machine Modes.
25348 * GET_MODE_ALIGNMENT: Machine Modes.
25349 * GET_MODE_BITSIZE: Machine Modes.
25350 * GET_MODE_CLASS: Machine Modes.
25351 * GET_MODE_MASK: Machine Modes.
25352 * GET_MODE_NAME: Machine Modes.
25353 * GET_MODE_NUNITS: Machine Modes.
25354 * GET_MODE_SIZE: Machine Modes.
25355 * GET_MODE_UNIT_SIZE: Machine Modes.
25356 * GET_MODE_WIDER_MODE: Machine Modes.
25357 * GET_RTX_CLASS: RTL Classes.
25358 * GET_RTX_FORMAT: RTL Classes.
25359 * GET_RTX_LENGTH: RTL Classes.
25360 * geu: Comparisons.
25361 * geu and attributes: Expressions.
25362 * GGC: Type Information.
25363 * global common subexpression elimination: Passes.
25364 * global register allocation: Passes.
25365 * GLOBAL_INIT_PRIORITY: Function Basics.
25366 * global_regs: Register Basics.
25367 * GO_IF_LEGITIMATE_ADDRESS: Addressing Modes.
25368 * GO_IF_MODE_DEPENDENT_ADDRESS: Addressing Modes.
25369 * GOFAST, floating point emulation library: Library Calls.
25370 * gofast_maybe_init_libfuncs: Library Calls.
25371 * GOTO_DESTINATION: Function Bodies.
25372 * GOTO_FAKE_P: Function Bodies.
25373 * GOTO_STMT: Function Bodies.
25374 * graph coloring register allocation: Passes.
25375 * greater than: Comparisons.
25377 * gt and attributes: Expressions.
25378 * GT_EXPR: Expression trees.
25379 * gtu: Comparisons.
25380 * gtu and attributes: Expressions.
25381 * GTY: Type Information.
25382 * H in constraint: Simple Constraints.
25383 * HANDLE_PRAGMA_PACK_PUSH_POP: Misc.
25384 * HANDLE_SYSV_PRAGMA: Misc.
25385 * HANDLER: Function Bodies.
25386 * HANDLER_BODY: Function Bodies.
25387 * HANDLER_PARMS: Function Bodies.
25388 * hard registers: Regs and Memory.
25389 * HARD_FRAME_POINTER_REGNUM: Frame Registers.
25390 * HARD_REGNO_CALL_PART_CLOBBERED: Register Basics.
25391 * HARD_REGNO_CALLER_SAVE_MODE: Caller Saves.
25392 * HARD_REGNO_MODE_OK: Values in Registers.
25393 * HARD_REGNO_NREGS: Values in Registers.
25394 * HAS_INIT_SECTION: Macros for Initialization.
25395 * HAVE_DOS_BASED_FILE_SYSTEM: Filesystem.
25396 * HAVE_POST_DECREMENT: Addressing Modes.
25397 * HAVE_POST_INCREMENT: Addressing Modes.
25398 * HAVE_POST_MODIFY_DISP: Addressing Modes.
25399 * HAVE_POST_MODIFY_REG: Addressing Modes.
25400 * HAVE_PRE_DECREMENT: Addressing Modes.
25401 * HAVE_PRE_INCREMENT: Addressing Modes.
25402 * HAVE_PRE_MODIFY_DISP: Addressing Modes.
25403 * HAVE_PRE_MODIFY_REG: Addressing Modes.
25404 * HCmode: Machine Modes.
25405 * HFmode: Machine Modes.
25407 * HImode: Machine Modes.
25408 * HImode, in insn: Insns.
25409 * host configuration: Host Config.
25410 * host functions: Host Common.
25411 * host hooks: Host Common.
25412 * host makefile fragment: Host Fragment.
25413 * HOST_BIT_BUCKET: Filesystem.
25414 * HOST_EXECUTABLE_SUFFIX: Filesystem.
25415 * HOST_HOOKS_EXTRA_SIGNALS: Host Common.
25416 * HOST_HOOKS_GT_PCH_USE_ADDRESS: Host Common.
25417 * HOST_LL_PREFIX: Host Misc.
25418 * HOST_OBJECT_SUFFIX: Filesystem.
25419 * HOT_TEXT_SECTION_NAME: Sections.
25420 * I in constraint: Simple Constraints.
25421 * i in constraint: Simple Constraints.
25422 * IBM_FLOAT_FORMAT: Storage Layout.
25423 * identifier: Identifiers.
25424 * IDENTIFIER_LENGTH: Identifiers.
25425 * IDENTIFIER_NODE: Identifiers.
25426 * IDENTIFIER_OPNAME_P: Identifiers.
25427 * IDENTIFIER_POINTER: Identifiers.
25428 * IDENTIFIER_TYPENAME_P: Identifiers.
25429 * IEEE_FLOAT_FORMAT: Storage Layout.
25430 * if conversion: Passes.
25431 * IF_COND: Function Bodies.
25432 * if_marked: GTY Options.
25433 * IF_STMT: Function Bodies.
25434 * if_then_else: Comparisons.
25435 * if_then_else and attributes: Expressions.
25436 * if_then_else usage: Side Effects.
25437 * IFCVT_EXTRA_FIELDS: Misc.
25438 * IFCVT_INIT_EXTRA_FIELDS: Misc.
25439 * IFCVT_MODIFY_CANCEL: Misc.
25440 * IFCVT_MODIFY_FINAL: Misc.
25441 * IFCVT_MODIFY_INSN: Misc.
25442 * IFCVT_MODIFY_MULTIPLE_TESTS: Misc.
25443 * IFCVT_MODIFY_TESTS: Misc.
25444 * IMAGPART_EXPR: Expression trees.
25445 * immediate_operand: RTL Template.
25446 * IMMEDIATE_PREFIX: Instruction Output.
25447 * in_data: Sections.
25448 * in_struct: Flags.
25449 * in_struct, in code_label and note: Flags.
25450 * in_struct, in insn: Flags.
25451 * in_struct, in insn and jump_insn and call_insn: Flags.
25452 * in_struct, in insn, jump_insn and call_insn: Flags.
25453 * in_struct, in label_ref: Flags.
25454 * in_struct, in mem: Flags.
25455 * in_struct, in reg: Flags.
25456 * in_struct, in subreg: Flags.
25457 * in_text: Sections.
25458 * include: Including Patterns.
25459 * INCLUDE_DEFAULTS: Driver.
25460 * inclusive-or, bitwise: Arithmetic.
25461 * INCOMING_FRAME_SP_OFFSET: Frame Layout.
25462 * INCOMING_REGNO: Register Basics.
25463 * INCOMING_RETURN_ADDR_RTX: Frame Layout.
25464 * INDEX_REG_CLASS: Register Classes.
25465 * indirect_jump instruction pattern: Standard Names.
25466 * INDIRECT_REF: Expression trees.
25467 * INIT_CUMULATIVE_ARGS: Register Arguments.
25468 * INIT_CUMULATIVE_INCOMING_ARGS: Register Arguments.
25469 * INIT_CUMULATIVE_LIBCALL_ARGS: Register Arguments.
25470 * INIT_ENVIRONMENT: Driver.
25471 * INIT_EXPANDERS: Per-Function Data.
25472 * INIT_EXPR: Expression trees.
25473 * init_machine_status: Per-Function Data.
25474 * init_one_libfunc: Library Calls.
25475 * INIT_SECTION_ASM_OP <1>: Sections.
25476 * INIT_SECTION_ASM_OP: Macros for Initialization.
25477 * INITIAL_ELIMINATION_OFFSET: Elimination.
25478 * INITIAL_FRAME_POINTER_OFFSET: Elimination.
25479 * initialization routines: Initialization.
25480 * INITIALIZE_TRAMPOLINE: Trampolines.
25481 * inline on rtx, automatic: Passes.
25482 * inline on trees, automatic: Passes.
25483 * inlining: Target Attributes.
25485 * insn and /f: Flags.
25486 * insn and /i: Flags.
25487 * insn and /j: Flags.
25488 * insn and /s: Flags.
25489 * insn and /u: Flags.
25490 * insn and /v: Flags.
25491 * insn attributes: Insn Attributes.
25492 * insn canonicalization: Insn Canonicalizations.
25493 * insn includes: Including Patterns.
25494 * insn lengths, computing: Insn Lengths.
25495 * insn splitting: Insn Splitting.
25496 * insn-attr.h: Defining Attributes.
25497 * INSN_ANNULLED_BRANCH_P: Flags.
25498 * INSN_CODE: Insns.
25499 * INSN_DEAD_CODE_P: Flags.
25500 * INSN_DELETED_P: Flags.
25501 * INSN_FROM_TARGET_P: Flags.
25502 * insn_list: Insns.
25503 * insn_list and /i: Flags.
25504 * INSN_REFERENCES_ARE_DELAYED: Misc.
25505 * INSN_SETS_ARE_DELAYED: Misc.
25508 * insns, generating: RTL Template.
25509 * insns, recognizing: RTL Template.
25510 * instruction attributes: Insn Attributes.
25511 * instruction combination: Passes.
25512 * instruction latency time <1>: Automaton pipeline description.
25513 * instruction latency time <2>: Processor pipeline description.
25514 * instruction latency time <3>: Comparison of the two descriptions.
25515 * instruction latency time: Automaton pipeline description.
25516 * instruction patterns: Patterns.
25517 * instruction recognizer: Passes.
25518 * instruction scheduling: Passes.
25519 * instruction splitting: Insn Splitting.
25520 * insv instruction pattern: Standard Names.
25521 * INT_TYPE_SIZE: Type Layout.
25522 * INTEGER_CST: Expression trees.
25523 * INTEGER_TYPE: Types.
25524 * INTEGRATE_THRESHOLD: Misc.
25525 * integrated: Flags.
25526 * integrated, in insn, call_insn, jump_insn, barrier, code_label, insn_list, const, and note: Flags.
25527 * integrated, in reg: Flags.
25528 * integrated, in symbol_ref: Flags.
25529 * Interdependence of Patterns: Dependent Patterns.
25530 * interfacing to GCC output: Interface.
25531 * interlock delays <1>: Processor pipeline description.
25532 * interlock delays: Comparison of the two descriptions.
25533 * INTMAX_TYPE: Type Layout.
25534 * introduction: Top.
25535 * INVOKE__main: Macros for Initialization.
25537 * ior and attributes: Expressions.
25538 * ior, canonicalization of: Insn Canonicalizations.
25539 * iorM3 instruction pattern: Standard Names.
25540 * IS_ASM_LOGICAL_LINE_SEPARATOR: Data Output.
25541 * IS_COSTLY_DEPENDENCE: Scheduling.
25543 * jump bypassing: Passes.
25544 * jump instruction pattern: Standard Names.
25545 * jump instruction patterns: Jump Patterns.
25546 * jump instructions and set: Side Effects.
25547 * jump optimization: Passes.
25548 * jump threading: Passes.
25549 * jump, in call_insn: Flags.
25550 * jump, in insn: Flags.
25551 * jump, in mem: Flags.
25552 * JUMP_ALIGN: Alignment Output.
25553 * jump_insn: Insns.
25554 * jump_insn and /f: Flags.
25555 * jump_insn and /i: Flags.
25556 * jump_insn and /s: Flags.
25557 * jump_insn and /u: Flags.
25558 * jump_insn and /v: Flags.
25559 * JUMP_LABEL: Insns.
25560 * JUMP_TABLES_IN_TEXT_SECTION: Sections.
25561 * LABEL_ALIGN: Alignment Output.
25562 * LABEL_ALIGN_AFTER_BARRIER: Alignment Output.
25563 * LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP: Alignment Output.
25564 * LABEL_ALIGN_MAX_SKIP: Alignment Output.
25565 * LABEL_ALT_ENTRY_P: Insns.
25566 * LABEL_DECL: Declarations.
25567 * LABEL_KIND: Insns.
25568 * LABEL_NUSES: Insns.
25569 * LABEL_OUTSIDE_LOOP_P: Flags.
25570 * LABEL_PRESERVE_P: Flags.
25571 * label_ref: Constants.
25572 * label_ref and /s: Flags.
25573 * label_ref and /v: Flags.
25574 * label_ref, RTL sharing: Sharing.
25575 * LABEL_REF_NONLOCAL_P: Flags.
25576 * LABEL_STMT: Function Bodies.
25577 * LABEL_STMT_LABEL: Function Bodies.
25578 * large return values: Aggregate Return.
25579 * LARGEST_EXPONENT_IS_NORMAL: Storage Layout.
25580 * LAST_STACK_REG: Stack Registers.
25581 * LAST_VIRTUAL_REGISTER: Regs and Memory.
25582 * LD_FINI_SWITCH: Macros for Initialization.
25583 * LD_INIT_SWITCH: Macros for Initialization.
25584 * LDD_SUFFIX: Macros for Initialization.
25586 * le and attributes: Expressions.
25587 * LE_EXPR: Expression trees.
25588 * leaf functions: Leaf Functions.
25589 * leaf_function_p: Standard Names.
25590 * LEAF_REG_REMAP: Leaf Functions.
25591 * LEAF_REGISTERS: Leaf Functions.
25592 * left rotate: Arithmetic.
25593 * left shift: Arithmetic.
25594 * LEGITIMATE_CONSTANT_P: Addressing Modes.
25595 * LEGITIMATE_PIC_OPERAND_P: PIC.
25596 * LEGITIMIZE_ADDRESS: Addressing Modes.
25597 * LEGITIMIZE_RELOAD_ADDRESS: Addressing Modes.
25598 * length: GTY Options.
25599 * less than: Comparisons.
25600 * less than or equal: Comparisons.
25601 * leu: Comparisons.
25602 * leu and attributes: Expressions.
25603 * LIB2FUNCS_EXTRA: Target Fragment.
25604 * LIB_SPEC: Driver.
25605 * LIBCALL_VALUE: Scalar Return.
25606 * libgcc.a: Library Calls.
25607 * LIBGCC2_CFLAGS: Target Fragment.
25608 * LIBGCC2_WORDS_BIG_ENDIAN: Storage Layout.
25609 * LIBGCC_SPEC: Driver.
25610 * library subroutine names: Library Calls.
25611 * LIBRARY_PATH_ENV: Misc.
25612 * LIMIT_RELOAD_CLASS: Register Classes.
25613 * LINK_COMMAND_SPEC: Driver.
25614 * LINK_ELIMINATE_DUPLICATE_LDIRECTORIES: Driver.
25615 * LINK_GCC_C_SEQUENCE_SPEC: Driver.
25616 * LINK_LIBGCC_SPECIAL: Driver.
25617 * LINK_LIBGCC_SPECIAL_1: Driver.
25618 * LINK_SPEC: Driver.
25619 * linkage: Function Basics.
25620 * list: Containers.
25621 * lo_sum: Arithmetic.
25622 * load address instruction: Simple Constraints.
25623 * LOAD_EXTEND_OP: Misc.
25624 * load_multiple instruction pattern: Standard Names.
25625 * local register allocation: Passes.
25626 * LOCAL_ALIGNMENT: Storage Layout.
25627 * LOCAL_CLASS_P: Classes.
25628 * LOCAL_INCLUDE_DIR: Driver.
25629 * LOCAL_LABEL_PREFIX: Instruction Output.
25630 * LOCAL_REGNO: Register Basics.
25631 * LOG_LINKS: Insns.
25632 * logical-and, bitwise: Arithmetic.
25633 * logM2 instruction pattern: Standard Names.
25634 * LONG_DOUBLE_TYPE_SIZE: Type Layout.
25635 * LONG_LONG_TYPE_SIZE: Type Layout.
25636 * LONG_TYPE_SIZE: Type Layout.
25637 * longjmp and automatic variables: Interface.
25638 * loop optimization: Passes.
25639 * LOOP_ALIGN: Alignment Output.
25640 * LOOP_ALIGN_MAX_SKIP: Alignment Output.
25641 * LOOP_EXPR: Expression trees.
25642 * looping instruction patterns: Looping Patterns.
25643 * LSHIFT_EXPR: Expression trees.
25644 * lshiftrt: Arithmetic.
25645 * lshiftrt and attributes: Expressions.
25646 * lshrM3 instruction pattern: Standard Names.
25648 * lt and attributes: Expressions.
25649 * LT_EXPR: Expression trees.
25650 * ltu: Comparisons.
25651 * m in constraint: Simple Constraints.
25652 * machine attributes: Target Attributes.
25653 * machine description macros: Target Macros.
25654 * machine descriptions: Machine Desc.
25655 * machine mode conversions: Conversions.
25656 * machine modes: Machine Modes.
25657 * machine specific constraints: Machine Constraints.
25658 * machine_mode: Condition Code.
25659 * macros, target description: Target Macros.
25660 * MAKE_DECL_ONE_ONLY: Label Output.
25661 * make_safe_from: Expander Definitions.
25662 * makefile fragment: Fragments.
25663 * makefile targets: Makefile.
25664 * marking roots: GGC Roots.
25665 * MASK_RETURN_ADDR: Exception Region Output.
25666 * match_dup <1>: define_peephole2.
25667 * match_dup: RTL Template.
25668 * match_dup and attributes: Insn Lengths.
25669 * match_insn: RTL Template.
25670 * match_insn2: RTL Template.
25671 * match_op_dup: RTL Template.
25672 * match_operand: RTL Template.
25673 * match_operand and attributes: Expressions.
25674 * match_operator: RTL Template.
25675 * match_par_dup: RTL Template.
25676 * match_parallel: RTL Template.
25677 * match_scratch <1>: RTL Template.
25678 * match_scratch: define_peephole2.
25679 * matching constraint: Simple Constraints.
25680 * matching operands: Output Template.
25681 * math library: Soft float library routines.
25682 * math, in RTL: Arithmetic.
25683 * MATH_LIBRARY: Misc.
25684 * matherr: Library Calls.
25685 * MAX_BITS_PER_WORD: Storage Layout.
25686 * MAX_CONDITIONAL_EXECUTE: Misc.
25687 * MAX_DFA_ISSUE_RATE: Scheduling.
25688 * MAX_FIXED_MODE_SIZE: Storage Layout.
25689 * MAX_LONG_DOUBLE_TYPE_SIZE: Type Layout.
25690 * MAX_LONG_TYPE_SIZE: Type Layout.
25691 * MAX_MOVE_MAX: Misc.
25692 * MAX_OFILE_ALIGNMENT: Storage Layout.
25693 * MAX_REGS_PER_ADDRESS: Addressing Modes.
25694 * MAX_WCHAR_TYPE_SIZE: Type Layout.
25695 * maxM3 instruction pattern: Standard Names.
25696 * MAYBE_REG_PARM_STACK_SPACE: Stack Arguments.
25697 * maybe_undef: GTY Options.
25698 * mcount: Profiling.
25699 * MD_ASM_CLOBBERS: Misc.
25700 * MD_CAN_REDIRECT_BRANCH: Misc.
25701 * MD_EXEC_PREFIX: Driver.
25702 * MD_FALLBACK_FRAME_STATE_FOR: Exception Handling.
25703 * MD_HANDLE_UNWABI: Exception Handling.
25704 * MD_STARTFILE_PREFIX: Driver.
25705 * MD_STARTFILE_PREFIX_1: Driver.
25706 * mem: Regs and Memory.
25707 * mem and /c: Flags.
25708 * mem and /f: Flags.
25709 * mem and /j: Flags.
25710 * mem and /s: Flags.
25711 * mem and /u: Flags.
25712 * mem and /v: Flags.
25713 * mem, RTL sharing: Sharing.
25714 * MEM_ALIAS_SET: Special Accessors.
25715 * MEM_ALIGN: Special Accessors.
25716 * MEM_EXPR: Special Accessors.
25717 * MEM_IN_STRUCT_P: Flags.
25718 * MEM_KEEP_ALIAS_SET_P: Flags.
25719 * MEM_NOTRAP_P: Flags.
25720 * MEM_OFFSET: Special Accessors.
25721 * MEM_SCALAR_P: Flags.
25722 * MEM_SIZE: Special Accessors.
25723 * MEM_VOLATILE_P: Flags.
25724 * MEMBER_TYPE_FORCES_BLK: Storage Layout.
25725 * memcpy, implicit usage: Library Calls.
25726 * memmove, implicit usage: Library Calls.
25727 * memory reference, nonoffsettable: Simple Constraints.
25728 * memory references in constraints: Simple Constraints.
25729 * MEMORY_MOVE_COST: Costs.
25730 * memset, implicit usage: Library Calls.
25731 * METHOD_TYPE: Types.
25732 * MIN_UNITS_PER_WORD: Storage Layout.
25733 * MINIMUM_ATOMIC_ALIGNMENT: Storage Layout.
25734 * minM3 instruction pattern: Standard Names.
25735 * minus: Arithmetic.
25736 * minus and attributes: Expressions.
25737 * minus, canonicalization of: Insn Canonicalizations.
25738 * MINUS_EXPR: Expression trees.
25739 * MIPS coprocessor-definition macros: MIPS Coprocessors.
25741 * mod and attributes: Expressions.
25742 * mode classes: Machine Modes.
25743 * mode switching: Mode Switching.
25744 * MODE_AFTER: Mode Switching.
25745 * MODE_BASE_REG_CLASS: Register Classes.
25746 * MODE_CC: Machine Modes.
25747 * MODE_COMPLEX_FLOAT: Machine Modes.
25748 * MODE_COMPLEX_INT: Machine Modes.
25749 * MODE_ENTRY: Mode Switching.
25750 * MODE_EXIT: Mode Switching.
25751 * MODE_FLOAT: Machine Modes.
25752 * MODE_FUNCTION: Machine Modes.
25753 * MODE_HAS_INFINITIES: Storage Layout.
25754 * MODE_HAS_NANS: Storage Layout.
25755 * MODE_HAS_SIGN_DEPENDENT_ROUNDING: Storage Layout.
25756 * MODE_HAS_SIGNED_ZEROS: Storage Layout.
25757 * MODE_INT: Machine Modes.
25758 * MODE_NEEDED: Mode Switching.
25759 * MODE_PARTIAL_INT: Machine Modes.
25760 * MODE_PRIORITY_TO_MODE: Mode Switching.
25761 * MODE_RANDOM: Machine Modes.
25762 * MODES_TIEABLE_P: Values in Registers.
25763 * modifiers in constraints: Modifiers.
25764 * MODIFY_EXPR: Expression trees.
25765 * MODIFY_JNI_METHOD_CALL: Misc.
25766 * MODIFY_TARGET_NAME: Driver.
25767 * modM3 instruction pattern: Standard Names.
25768 * MOVE_BY_PIECES_P: Costs.
25770 * MOVE_MAX_PIECES: Costs.
25771 * MOVE_RATIO: Costs.
25772 * movM instruction pattern: Standard Names.
25773 * movMODEcc instruction pattern: Standard Names.
25774 * movstrictM instruction pattern: Standard Names.
25775 * movstrM instruction pattern: Standard Names.
25776 * mulhisi3 instruction pattern: Standard Names.
25777 * mulM3 instruction pattern: Standard Names.
25778 * mulqihi3 instruction pattern: Standard Names.
25779 * mulsidi3 instruction pattern: Standard Names.
25780 * mult: Arithmetic.
25781 * mult and attributes: Expressions.
25782 * mult, canonicalization of: Insn Canonicalizations.
25783 * MULT_EXPR: Expression trees.
25784 * MULTILIB_DEFAULTS: Driver.
25785 * MULTILIB_DIRNAMES: Target Fragment.
25786 * MULTILIB_EXCEPTIONS: Target Fragment.
25787 * MULTILIB_EXTRA_OPTS: Target Fragment.
25788 * MULTILIB_MATCHES: Target Fragment.
25789 * MULTILIB_OPTIONS: Target Fragment.
25790 * multiple alternative constraints: Multi-Alternative.
25791 * MULTIPLE_SYMBOL_SPACES: Misc.
25792 * multiplication: Arithmetic.
25793 * MUST_PASS_IN_STACK: Register Arguments.
25794 * MUST_PASS_IN_STACK, and FUNCTION_ARG: Register Arguments.
25795 * MUST_USE_SJLJ_EXCEPTIONS: Exception Region Output.
25796 * n in constraint: Simple Constraints.
25797 * N_REG_CLASSES: Register Classes.
25798 * name: Identifiers.
25799 * named patterns and conditions: Patterns.
25800 * names, pattern: Standard Names.
25801 * namespace: Namespaces.
25802 * namespace, class, scope: Scopes.
25803 * NAMESPACE_DECL <1>: Namespaces.
25804 * NAMESPACE_DECL: Declarations.
25806 * ne and attributes: Expressions.
25807 * NE_EXPR: Expression trees.
25808 * nearbyintM2 instruction pattern: Standard Names.
25810 * neg and attributes: Expressions.
25811 * neg, canonicalization of: Insn Canonicalizations.
25812 * NEGATE_EXPR: Expression trees.
25813 * negM2 instruction pattern: Standard Names.
25814 * nested functions, trampolines for: Trampolines.
25815 * next_cc0_user: Jump Patterns.
25816 * NEXT_INSN: Insns.
25817 * NEXT_OBJC_RUNTIME: Library Calls.
25818 * nil: RTL Objects.
25819 * NO_DBX_FUNCTION_END: DBX Hooks.
25820 * NO_DOLLAR_IN_LABEL: Misc.
25821 * NO_DOT_IN_LABEL: Misc.
25822 * NO_FUNCTION_CSE: Costs.
25823 * NO_IMPLICIT_EXTERN_C: Misc.
25824 * no_new_pseudos: Standard Names.
25825 * NO_PROFILE_COUNTERS: Profiling.
25826 * NO_RECURSIVE_FUNCTION_CSE: Costs.
25827 * NO_REGS: Register Classes.
25828 * NON_SAVING_SETJMP: Register Basics.
25829 * nondeterministic finite state automaton: Automaton pipeline description.
25830 * nonlocal_goto instruction pattern: Standard Names.
25831 * nonlocal_goto_receiver instruction pattern: Standard Names.
25832 * nonoffsettable memory reference: Simple Constraints.
25833 * nop instruction pattern: Standard Names.
25834 * NOP_EXPR: Expression trees.
25836 * not and attributes: Expressions.
25837 * not equal: Comparisons.
25838 * not, canonicalization of: Insn Canonicalizations.
25840 * note and /i: Flags.
25841 * note and /v: Flags.
25842 * NOTE_INSN_BLOCK_BEG: Insns.
25843 * NOTE_INSN_BLOCK_END: Insns.
25844 * NOTE_INSN_DELETED: Insns.
25845 * NOTE_INSN_DELETED_LABEL: Insns.
25846 * NOTE_INSN_EH_REGION_BEG: Insns.
25847 * NOTE_INSN_EH_REGION_END: Insns.
25848 * NOTE_INSN_FUNCTION_END: Insns.
25849 * NOTE_INSN_LOOP_BEG: Insns.
25850 * NOTE_INSN_LOOP_CONT: Insns.
25851 * NOTE_INSN_LOOP_END: Insns.
25852 * NOTE_INSN_LOOP_VTOP: Insns.
25853 * NOTE_INSN_SETJMP: Insns.
25854 * NOTE_LINE_NUMBER: Insns.
25855 * NOTE_SOURCE_FILE: Insns.
25856 * NOTICE_UPDATE_CC: Condition Code.
25857 * NUM_MACHINE_MODES: Machine Modes.
25858 * NUM_MODES_FOR_MODE_SWITCHING: Mode Switching.
25859 * o in constraint: Simple Constraints.
25860 * OBJC_GEN_METHOD_LABEL: Label Output.
25861 * OBJECT_FORMAT_COFF: Macros for Initialization.
25862 * OFFSET_TYPE: Types.
25863 * offsettable address: Simple Constraints.
25864 * OImode: Machine Modes.
25865 * old pipeline description <1>: Comparison of the two descriptions.
25866 * old pipeline description: Old pipeline description.
25867 * one_cmplM2 instruction pattern: Standard Names.
25868 * operand access: Accessors.
25869 * operand constraints: Constraints.
25870 * operand substitution: Output Template.
25871 * operands: Patterns.
25872 * OPTIMIZATION_OPTIONS: Run-time Target.
25873 * OPTIMIZE_MODE_SWITCHING: Mode Switching.
25874 * OPTION_DEFAULT_SPECS: Driver.
25875 * optional hardware or system features: Run-time Target.
25876 * options, directory search: Including Patterns.
25877 * order of register allocation: Allocation Order.
25878 * ORDER_REGS_FOR_LOCAL_ALLOC: Allocation Order.
25879 * Ordering of Patterns: Pattern Ordering.
25880 * ORIGINAL_REGNO: Special Accessors.
25881 * other register constraints: Simple Constraints.
25882 * OUTGOING_REG_PARM_STACK_SPACE: Stack Arguments.
25883 * OUTGOING_REGNO: Register Basics.
25884 * output of assembler code: File Framework.
25885 * output statements: Output Statement.
25886 * output templates: Output Template.
25887 * OUTPUT_ADDR_CONST_EXTRA: Data Output.
25888 * output_asm_insn: Output Statement.
25889 * OUTPUT_QUOTED_STRING: File Framework.
25890 * OVERLOAD: Functions.
25891 * OVERRIDE_OPTIONS: Run-time Target.
25892 * OVL_CURRENT: Functions.
25893 * OVL_NEXT: Functions.
25894 * p in constraint: Simple Constraints.
25895 * PAD_VARARGS_DOWN: Register Arguments.
25896 * parallel: Side Effects.
25897 * param_is: GTY Options.
25898 * parameters, miscellaneous: Misc.
25899 * parameters, precompiled headers: PCH Target.
25900 * paramN_is: GTY Options.
25901 * parity: Arithmetic.
25902 * parityM2 instruction pattern: Standard Names.
25903 * PARM_BOUNDARY: Storage Layout.
25904 * PARM_DECL: Declarations.
25905 * PARSE_LDD_OUTPUT: Macros for Initialization.
25906 * parsing pass: Passes.
25907 * passes and files of the compiler: Passes.
25908 * passing arguments: Interface.
25909 * PATH_SEPARATOR: Filesystem.
25911 * pattern conditions: Patterns.
25912 * pattern names: Standard Names.
25913 * Pattern Ordering: Pattern Ordering.
25914 * patterns: Patterns.
25915 * pc: Regs and Memory.
25916 * pc and attributes: Insn Lengths.
25917 * pc, RTL sharing: Sharing.
25918 * PC_REGNUM: Register Basics.
25919 * pc_rtx: Regs and Memory.
25920 * PCC_BITFIELD_TYPE_MATTERS: Storage Layout.
25921 * PCC_STATIC_STRUCT_RETURN: Aggregate Return.
25922 * PDImode: Machine Modes.
25923 * peephole optimization: Passes.
25924 * peephole optimization, RTL representation: Side Effects.
25925 * peephole optimizer definitions: Peephole Definitions.
25926 * per-function data: Per-Function Data.
25927 * percent sign: Output Template.
25929 * PIC_OFFSET_TABLE_REG_CALL_CLOBBERED: PIC.
25930 * PIC_OFFSET_TABLE_REGNUM: PIC.
25931 * pipeline hazard recognizer <1>: Comparison of the two descriptions.
25932 * pipeline hazard recognizer <2>: Processor pipeline description.
25933 * pipeline hazard recognizer: Automaton pipeline description.
25934 * plus: Arithmetic.
25935 * plus and attributes: Expressions.
25936 * plus, canonicalization of: Insn Canonicalizations.
25937 * PLUS_EXPR: Expression trees.
25940 * POINTER_SIZE: Storage Layout.
25941 * POINTER_TYPE: Types.
25942 * POINTERS_EXTEND_UNSIGNED: Storage Layout.
25943 * popcount: Arithmetic.
25944 * popcountM2 instruction pattern: Standard Names.
25945 * portability: Portability.
25946 * position independent code: PIC.
25947 * post_dec: Incdec.
25948 * post_inc: Incdec.
25949 * post_modify: Incdec.
25950 * POWI_MAX_MULTS: Misc.
25951 * powM3 instruction pattern: Standard Names.
25954 * PRE_GCC3_DWARF_FRAME_REGISTERS: Frame Registers.
25956 * pre_modify: Incdec.
25957 * predefined macros: Run-time Target.
25958 * PREDICATE_CODES: Misc.
25959 * predication: Conditional Execution.
25960 * PREFERRED_DEBUGGING_TYPE: All Debuggers.
25961 * PREFERRED_OUTPUT_RELOAD_CLASS: Register Classes.
25962 * PREFERRED_RELOAD_CLASS: Register Classes.
25963 * PREFERRED_STACK_BOUNDARY: Storage Layout.
25964 * prefetch: Side Effects.
25965 * prefetch instruction pattern: Standard Names.
25966 * presence_set: Automaton pipeline description.
25967 * prev_active_insn: define_peephole.
25968 * prev_cc0_setter: Jump Patterns.
25969 * PREV_INSN: Insns.
25970 * PRINT_OPERAND: Instruction Output.
25971 * PRINT_OPERAND_ADDRESS: Instruction Output.
25972 * PRINT_OPERAND_PUNCT_VALID_P: Instruction Output.
25973 * processor functional units <1>: Comparison of the two descriptions.
25974 * processor functional units <2>: Automaton pipeline description.
25975 * processor functional units: Processor pipeline description.
25976 * processor pipeline description: Processor pipeline description.
25977 * product: Arithmetic.
25978 * PROFILE_BEFORE_PROLOGUE: Profiling.
25979 * PROFILE_HOOK: Profiling.
25980 * profiling, code generation: Profiling.
25981 * program counter: Regs and Memory.
25982 * prologue: Function Entry.
25983 * prologue instruction pattern: Standard Names.
25984 * PROMOTE_FOR_CALL_ONLY: Storage Layout.
25985 * PROMOTE_MODE: Storage Layout.
25986 * pseudo registers: Regs and Memory.
25987 * PSImode: Machine Modes.
25988 * PTRDIFF_TYPE: Type Layout.
25989 * PTRMEM_CST: Expression trees.
25990 * PTRMEM_CST_CLASS: Expression trees.
25991 * PTRMEM_CST_MEMBER: Expression trees.
25992 * push address instruction: Simple Constraints.
25993 * PUSH_ARGS: Stack Arguments.
25994 * PUSH_ARGS_REVERSED: Stack Arguments.
25995 * push_reload: Addressing Modes.
25996 * PUSH_ROUNDING: Stack Arguments.
25997 * PUSH_ROUNDING, interaction with PREFERRED_STACK_BOUNDARY: Storage Layout.
25998 * pushM instruction pattern: Standard Names.
25999 * PUT_CODE: RTL Objects.
26000 * PUT_MODE: Machine Modes.
26001 * PUT_REG_NOTE_KIND: Insns.
26002 * PUT_SDB_: SDB and DWARF.
26003 * QCmode: Machine Modes.
26004 * QFmode: Machine Modes.
26005 * QImode: Machine Modes.
26006 * QImode, in insn: Insns.
26007 * qualified type: Types.
26008 * querying function unit reservations: Automaton pipeline description.
26009 * question mark: Multi-Alternative.
26010 * quotient: Arithmetic.
26011 * r in constraint: Simple Constraints.
26012 * RANGE_TEST_NON_SHORT_CIRCUIT: Costs.
26013 * RDIV_EXPR: Expression trees.
26014 * READONLY_DATA_SECTION: Sections.
26015 * READONLY_DATA_SECTION_ASM_OP: Sections.
26016 * REAL_ARITHMETIC: Floating Point.
26017 * REAL_CST: Expression trees.
26018 * REAL_NM_FILE_NAME: Macros for Initialization.
26019 * REAL_TYPE: Types.
26020 * REAL_VALUE_ABS: Floating Point.
26021 * REAL_VALUE_ATOF: Floating Point.
26022 * REAL_VALUE_FIX: Floating Point.
26023 * REAL_VALUE_FROM_INT: Floating Point.
26024 * REAL_VALUE_ISINF: Floating Point.
26025 * REAL_VALUE_ISNAN: Floating Point.
26026 * REAL_VALUE_NEGATE: Floating Point.
26027 * REAL_VALUE_NEGATIVE: Floating Point.
26028 * REAL_VALUE_TO_INT: Floating Point.
26029 * REAL_VALUE_TO_TARGET_DOUBLE: Data Output.
26030 * REAL_VALUE_TO_TARGET_LONG_DOUBLE: Data Output.
26031 * REAL_VALUE_TO_TARGET_SINGLE: Data Output.
26032 * REAL_VALUE_TRUNCATE: Floating Point.
26033 * REAL_VALUE_TYPE: Floating Point.
26034 * REAL_VALUE_UNSIGNED_FIX: Floating Point.
26035 * REAL_VALUES_EQUAL: Floating Point.
26036 * REAL_VALUES_LESS: Floating Point.
26037 * REALPART_EXPR: Expression trees.
26038 * recog_data.operand: Instruction Output.
26039 * recognizing insns: RTL Template.
26040 * RECORD_TYPE <1>: Types.
26041 * RECORD_TYPE: Classes.
26042 * reference: Types.
26043 * REFERENCE_TYPE: Types.
26044 * reg: Regs and Memory.
26045 * reg and /f: Flags.
26046 * reg and /i: Flags.
26047 * reg and /s: Flags.
26048 * reg and /u: Flags.
26049 * reg and /v: Flags.
26050 * reg, RTL sharing: Sharing.
26051 * REG_ALLOC_ORDER: Allocation Order.
26052 * REG_BR_PRED: Insns.
26053 * REG_BR_PROB: Insns.
26054 * REG_CC_SETTER: Insns.
26055 * REG_CC_USER: Insns.
26056 * reg_class_contents: Register Basics.
26057 * REG_CLASS_CONTENTS: Register Classes.
26058 * REG_CLASS_FROM_CONSTRAINT: Register Classes.
26059 * REG_CLASS_FROM_LETTER: Register Classes.
26060 * REG_CLASS_NAMES: Register Classes.
26062 * REG_DEP_ANTI: Insns.
26063 * REG_DEP_OUTPUT: Insns.
26064 * REG_EQUAL: Insns.
26065 * REG_EQUIV: Insns.
26066 * REG_EXPR: Special Accessors.
26067 * REG_FRAME_RELATED_EXPR: Insns.
26068 * REG_FUNCTION_VALUE_P: Flags.
26070 * REG_LABEL: Insns.
26071 * reg_label and /v: Flags.
26072 * REG_LIBCALL: Insns.
26073 * REG_LOOP_TEST_P: Flags.
26074 * REG_MODE_OK_FOR_BASE_P: Addressing Modes.
26075 * reg_names <1>: Register Basics.
26076 * reg_names: Instruction Output.
26077 * REG_NO_CONFLICT: Insns.
26078 * REG_NONNEG: Insns.
26079 * REG_NOTE_KIND: Insns.
26080 * REG_NOTES: Insns.
26081 * REG_OFFSET: Special Accessors.
26082 * REG_OK_FOR_BASE_P: Addressing Modes.
26083 * REG_OK_FOR_INDEX_P: Addressing Modes.
26084 * REG_OK_STRICT: Addressing Modes.
26085 * REG_PARM_STACK_SPACE: Stack Arguments.
26086 * REG_PARM_STACK_SPACE, and FUNCTION_ARG: Register Arguments.
26087 * REG_POINTER: Flags.
26088 * REG_RETVAL: Insns.
26089 * REG_UNUSED: Insns.
26090 * REG_USERVAR_P: Flags.
26091 * register allocation: Passes.
26092 * register allocation order: Allocation Order.
26093 * register class definitions: Register Classes.
26094 * register class preference constraints: Class Preferences.
26095 * register class preference pass: Passes.
26096 * register movement: Passes.
26097 * register pairs: Values in Registers.
26098 * Register Transfer Language (RTL): RTL.
26099 * register usage: Registers.
26100 * register use analysis: Passes.
26101 * register-to-stack conversion: Passes.
26102 * REGISTER_MOVE_COST: Costs.
26103 * REGISTER_NAMES: Instruction Output.
26104 * register_operand: RTL Template.
26105 * REGISTER_PREFIX: Instruction Output.
26106 * REGISTER_TARGET_PRAGMAS: Misc.
26107 * registers arguments: Register Arguments.
26108 * registers in constraints: Simple Constraints.
26109 * REGMODE_NATURAL_SIZE: Values in Registers.
26110 * REGNO_MODE_OK_FOR_BASE_P: Register Classes.
26111 * REGNO_OK_FOR_BASE_P: Register Classes.
26112 * REGNO_OK_FOR_INDEX_P: Register Classes.
26113 * REGNO_REG_CLASS: Register Classes.
26114 * regs_ever_live: Function Entry.
26115 * regular expressions <1>: Automaton pipeline description.
26116 * regular expressions: Processor pipeline description.
26117 * relative costs: Costs.
26118 * RELATIVE_PREFIX_NOT_LINKDIR: Driver.
26119 * reload pass: Regs and Memory.
26120 * reload_completed: Standard Names.
26121 * reload_in instruction pattern: Standard Names.
26122 * reload_in_progress: Standard Names.
26123 * reload_out instruction pattern: Standard Names.
26124 * reloading: Passes.
26125 * remainder: Arithmetic.
26126 * reorder: GTY Options.
26127 * reordering, block: Passes.
26128 * representation of RTL: RTL.
26129 * reservation delays: Processor pipeline description.
26130 * rest_of_compilation: Passes.
26131 * rest_of_decl_compilation: Passes.
26132 * restore_stack_block instruction pattern: Standard Names.
26133 * restore_stack_function instruction pattern: Standard Names.
26134 * restore_stack_nonlocal instruction pattern: Standard Names.
26135 * RESULT_DECL: Declarations.
26136 * return: Side Effects.
26137 * return instruction pattern: Standard Names.
26138 * return values in registers: Scalar Return.
26139 * RETURN_ADDR_IN_PREVIOUS_FRAME: Frame Layout.
26140 * RETURN_ADDR_OFFSET: Exception Handling.
26141 * RETURN_ADDR_RTX: Frame Layout.
26142 * RETURN_ADDRESS_POINTER_REGNUM: Frame Registers.
26143 * RETURN_EXPR: Function Bodies.
26144 * RETURN_INIT: Function Bodies.
26145 * RETURN_POPS_ARGS: Stack Arguments.
26146 * RETURN_STMT: Function Bodies.
26147 * returning aggregate values: Aggregate Return.
26148 * returning structures and unions: Interface.
26149 * REVERSE_CONDEXEC_PREDICATES_P: Condition Code.
26150 * REVERSE_CONDITION: Condition Code.
26151 * REVERSIBLE_CC_MODE: Condition Code.
26152 * right rotate: Arithmetic.
26153 * right shift: Arithmetic.
26154 * RISC <1>: Processor pipeline description.
26155 * RISC: Automaton pipeline description.
26156 * roots, marking: GGC Roots.
26157 * rotate: Arithmetic.
26158 * rotatert: Arithmetic.
26159 * rotlM3 instruction pattern: Standard Names.
26160 * rotrM3 instruction pattern: Standard Names.
26161 * ROUND_TOWARDS_ZERO: Storage Layout.
26162 * ROUND_TYPE_ALIGN: Storage Layout.
26163 * roundM2 instruction pattern: Standard Names.
26164 * RSHIFT_EXPR: Expression trees.
26165 * RTL addition: Arithmetic.
26166 * RTL addition with signed saturation: Arithmetic.
26167 * RTL addition with unsigned saturation: Arithmetic.
26168 * RTL classes: RTL Classes.
26169 * RTL comparison: Arithmetic.
26170 * RTL comparison operations: Comparisons.
26171 * RTL constant expression types: Constants.
26172 * RTL constants: Constants.
26173 * RTL declarations: RTL Declarations.
26174 * RTL difference: Arithmetic.
26175 * RTL expression: RTL Objects.
26176 * RTL expressions for arithmetic: Arithmetic.
26177 * RTL format: RTL Classes.
26178 * RTL format characters: RTL Classes.
26179 * RTL function-call insns: Calls.
26180 * RTL generation: Passes.
26181 * RTL insn template: RTL Template.
26182 * RTL integers: RTL Objects.
26183 * RTL memory expressions: Regs and Memory.
26184 * RTL object types: RTL Objects.
26185 * RTL postdecrement: Incdec.
26186 * RTL postincrement: Incdec.
26187 * RTL predecrement: Incdec.
26188 * RTL preincrement: Incdec.
26189 * RTL register expressions: Regs and Memory.
26190 * RTL representation: RTL.
26191 * RTL side effect expressions: Side Effects.
26192 * RTL strings: RTL Objects.
26193 * RTL structure sharing assumptions: Sharing.
26194 * RTL subtraction: Arithmetic.
26195 * RTL sum: Arithmetic.
26196 * RTL vectors: RTL Objects.
26197 * RTX (See RTL): RTL Objects.
26198 * RTX codes, classes of: RTL Classes.
26199 * RTX_FRAME_RELATED_P: Flags.
26200 * RTX_INTEGRATED_P: Flags.
26201 * RTX_UNCHANGING_P: Flags.
26202 * run-time conventions: Interface.
26203 * run-time target specification: Run-time Target.
26204 * s in constraint: Simple Constraints.
26205 * same_type_p: Types.
26206 * save_stack_block instruction pattern: Standard Names.
26207 * save_stack_function instruction pattern: Standard Names.
26208 * save_stack_nonlocal instruction pattern: Standard Names.
26209 * scalars, returned as values: Scalar Return.
26210 * SCHED_GROUP_P: Flags.
26211 * scheduling, delayed branch: Passes.
26212 * scheduling, instruction: Passes.
26213 * SCmode: Machine Modes.
26214 * sCOND instruction pattern: Standard Names.
26215 * SCOPE_BEGIN_P: Function Bodies.
26216 * SCOPE_END_P: Function Bodies.
26217 * SCOPE_NULLIFIED_P: Function Bodies.
26218 * SCOPE_STMT: Function Bodies.
26219 * scratch: Regs and Memory.
26220 * scratch operands: Regs and Memory.
26221 * scratch, RTL sharing: Sharing.
26222 * SDB_ALLOW_FORWARD_REFERENCES: SDB and DWARF.
26223 * SDB_ALLOW_UNKNOWN_REFERENCES: SDB and DWARF.
26224 * SDB_DEBUGGING_INFO: SDB and DWARF.
26225 * SDB_DELIM: SDB and DWARF.
26226 * SDB_GENERATE_FAKE: SDB and DWARF.
26227 * search options: Including Patterns.
26228 * SECONDARY_INPUT_RELOAD_CLASS: Register Classes.
26229 * SECONDARY_MEMORY_NEEDED: Register Classes.
26230 * SECONDARY_MEMORY_NEEDED_MODE: Register Classes.
26231 * SECONDARY_MEMORY_NEEDED_RTX: Register Classes.
26232 * SECONDARY_OUTPUT_RELOAD_CLASS: Register Classes.
26233 * SECONDARY_RELOAD_CLASS: Register Classes.
26234 * SELECT_CC_MODE: Condition Code.
26235 * sequence: Side Effects.
26236 * set: Side Effects.
26237 * set and /f: Flags.
26238 * SET_ASM_OP: Label Output.
26239 * set_attr: Tagging Insns.
26240 * set_attr_alternative: Tagging Insns.
26241 * SET_DEST: Side Effects.
26242 * SET_IS_RETURN_P: Flags.
26243 * SET_LABEL_KIND: Insns.
26244 * set_optab_libfunc: Library Calls.
26245 * SET_SRC: Side Effects.
26246 * SETUP_FRAME_ADDRESSES: Frame Layout.
26247 * SFmode: Machine Modes.
26248 * SHARED_SECTION_ASM_OP: Sections.
26249 * sharing of RTL components: Sharing.
26250 * shift: Arithmetic.
26251 * SHIFT_COUNT_TRUNCATED: Misc.
26252 * SHORT_IMMEDIATES_SIGN_EXTEND: Misc.
26253 * SHORT_TYPE_SIZE: Type Layout.
26254 * sibcall_epilogue instruction pattern: Standard Names.
26255 * sibling call optimization: Passes.
26256 * SIBLING_CALL_P: Flags.
26257 * sign_extend: Conversions.
26258 * sign_extract: Bit-Fields.
26259 * sign_extract, canonicalization of: Insn Canonicalizations.
26260 * signed division: Arithmetic.
26261 * signed maximum: Arithmetic.
26262 * signed minimum: Arithmetic.
26263 * SImode: Machine Modes.
26264 * simple constraints: Simple Constraints.
26265 * simplifications, arithmetic: Passes.
26266 * sinM2 instruction pattern: Standard Names.
26267 * SIZE_ASM_OP: Label Output.
26268 * SIZE_TYPE: Type Layout.
26269 * skip: GTY Options.
26270 * SLOW_BYTE_ACCESS: Costs.
26271 * SLOW_UNALIGNED_ACCESS: Costs.
26272 * SMALL_ARG_MAX: Host Misc.
26273 * SMALL_REGISTER_CLASSES: Register Classes.
26274 * smax: Arithmetic.
26275 * smaxM3 instruction pattern: Standard Names.
26276 * smin: Arithmetic.
26277 * sminM3 instruction pattern: Standard Names.
26278 * smulM3_highpart instruction pattern: Standard Names.
26279 * soft float library: Soft float library routines.
26280 * special: GTY Options.
26281 * SPECIAL_MODE_PREDICATES: Misc.
26282 * SPECS: Target Fragment.
26283 * speed of instructions: Costs.
26284 * splitting instructions: Insn Splitting.
26285 * sqrt: Arithmetic.
26286 * sqrtM2 instruction pattern: Standard Names.
26287 * square root: Arithmetic.
26288 * ss_minus: Arithmetic.
26289 * ss_plus: Arithmetic.
26290 * ss_truncate: Conversions.
26291 * stack arguments: Stack Arguments.
26292 * stack frame layout: Frame Layout.
26293 * STACK_ALIGNMENT_NEEDED: Frame Layout.
26294 * STACK_BOUNDARY: Storage Layout.
26295 * STACK_CHECK_BUILTIN: Stack Checking.
26296 * STACK_CHECK_FIXED_FRAME_SIZE: Stack Checking.
26297 * STACK_CHECK_MAX_FRAME_SIZE: Stack Checking.
26298 * STACK_CHECK_MAX_VAR_SIZE: Stack Checking.
26299 * STACK_CHECK_PROBE_INTERVAL: Stack Checking.
26300 * STACK_CHECK_PROBE_LOAD: Stack Checking.
26301 * STACK_CHECK_PROTECT: Stack Checking.
26302 * STACK_DYNAMIC_OFFSET: Frame Layout.
26303 * STACK_DYNAMIC_OFFSET and virtual registers: Regs and Memory.
26304 * STACK_GROWS_DOWNWARD: Frame Layout.
26305 * STACK_PARMS_IN_REG_PARM_AREA: Stack Arguments.
26306 * STACK_POINTER_OFFSET: Frame Layout.
26307 * STACK_POINTER_OFFSET and virtual registers: Regs and Memory.
26308 * STACK_POINTER_REGNUM: Frame Registers.
26309 * STACK_POINTER_REGNUM and virtual registers: Regs and Memory.
26310 * stack_pointer_rtx: Frame Registers.
26311 * STACK_PUSH_CODE: Frame Layout.
26312 * STACK_REGS: Stack Registers.
26313 * STACK_SAVEAREA_MODE: Storage Layout.
26314 * STACK_SIZE_MODE: Storage Layout.
26315 * standard pattern names: Standard Names.
26316 * STANDARD_INCLUDE_COMPONENT: Driver.
26317 * STANDARD_INCLUDE_DIR: Driver.
26318 * STANDARD_STARTFILE_PREFIX: Driver.
26319 * STARTFILE_SPEC: Driver.
26320 * STARTING_FRAME_OFFSET: Frame Layout.
26321 * STARTING_FRAME_OFFSET and virtual registers: Regs and Memory.
26322 * statements: Function Bodies.
26323 * STATIC_CHAIN: Frame Registers.
26324 * STATIC_CHAIN_INCOMING: Frame Registers.
26325 * STATIC_CHAIN_INCOMING_REGNUM: Frame Registers.
26326 * STATIC_CHAIN_REGNUM: Frame Registers.
26327 * stdarg.h and register arguments: Register Arguments.
26328 * STDC_0_IN_SYSTEM_HEADERS: Misc.
26329 * STMT_EXPR: Expression trees.
26330 * STMT_IS_FULL_EXPR_P: Function Bodies.
26331 * STMT_LINENO: Function Bodies.
26332 * storage layout: Storage Layout.
26333 * STORE_BY_PIECES_P: Costs.
26334 * STORE_FLAG_VALUE: Misc.
26335 * store_multiple instruction pattern: Standard Names.
26336 * strcpy: Storage Layout.
26337 * strength-reduction: Passes.
26338 * STRICT_ALIGNMENT: Storage Layout.
26339 * strict_low_part: RTL Declarations.
26340 * strict_memory_address_p: Addressing Modes.
26341 * STRING_CST: Expression trees.
26342 * STRING_POOL_ADDRESS_P: Flags.
26343 * strlenM instruction pattern: Standard Names.
26344 * structure value address: Aggregate Return.
26345 * STRUCTURE_SIZE_BOUNDARY: Storage Layout.
26346 * structures, returning: Interface.
26347 * subM3 instruction pattern: Standard Names.
26348 * SUBOBJECT: Function Bodies.
26349 * SUBOBJECT_CLEANUP: Function Bodies.
26350 * subreg: Regs and Memory.
26351 * subreg and /s: Flags.
26352 * subreg and /u: Flags.
26353 * subreg and /u and /v: Flags.
26354 * subreg, in strict_low_part: RTL Declarations.
26355 * subreg, special reload handling: Regs and Memory.
26356 * SUBREG_BYTE: Regs and Memory.
26357 * SUBREG_PROMOTED_UNSIGNED_P: Flags.
26358 * SUBREG_PROMOTED_UNSIGNED_SET: Flags.
26359 * SUBREG_PROMOTED_VAR_P: Flags.
26360 * SUBREG_REG: Regs and Memory.
26361 * SUCCESS_EXIT_CODE: Host Misc.
26362 * SUPPORTS_INIT_PRIORITY: Macros for Initialization.
26363 * SUPPORTS_ONE_ONLY: Label Output.
26364 * SUPPORTS_WEAK: Label Output.
26365 * SWITCH_BODY: Function Bodies.
26366 * SWITCH_COND: Function Bodies.
26367 * SWITCH_CURTAILS_COMPILATION: Driver.
26368 * SWITCH_STMT: Function Bodies.
26369 * SWITCH_TAKES_ARG: Driver.
26370 * SWITCHES_NEED_SPACES: Driver.
26371 * SYMBOL_FLAG_EXTERNAL: Special Accessors.
26372 * SYMBOL_FLAG_FUNCTION: Special Accessors.
26373 * SYMBOL_FLAG_LOCAL: Special Accessors.
26374 * SYMBOL_FLAG_SMALL: Special Accessors.
26375 * SYMBOL_FLAG_TLS_SHIFT: Special Accessors.
26376 * symbol_ref: Constants.
26377 * symbol_ref and /f: Flags.
26378 * symbol_ref and /i: Flags.
26379 * symbol_ref and /u: Flags.
26380 * symbol_ref and /v: Flags.
26381 * symbol_ref, RTL sharing: Sharing.
26382 * SYMBOL_REF_DECL: Special Accessors.
26383 * SYMBOL_REF_EXTERNAL_P: Special Accessors.
26384 * SYMBOL_REF_FLAG: Flags.
26385 * SYMBOL_REF_FLAG, in TARGET_ENCODE_SECTION_INFO: Sections.
26386 * SYMBOL_REF_FLAGS: Special Accessors.
26387 * SYMBOL_REF_FUNCTION_P: Special Accessors.
26388 * SYMBOL_REF_LOCAL_P: Special Accessors.
26389 * SYMBOL_REF_SMALL_P: Special Accessors.
26390 * SYMBOL_REF_TLS_MODEL: Special Accessors.
26391 * SYMBOL_REF_USED: Flags.
26392 * SYMBOL_REF_WEAK: Flags.
26393 * symbolic label: Sharing.
26394 * SYSROOT_HEADERS_SUFFIX_SPEC: Driver.
26395 * SYSROOT_SUFFIX_SPEC: Driver.
26396 * SYSTEM_INCLUDE_DIR: Driver.
26397 * t-TARGET: Target Fragment.
26398 * tablejump instruction pattern: Standard Names.
26399 * tag: GTY Options.
26400 * tagging insns: Tagging Insns.
26401 * tail calls: Tail Calls.
26402 * tail recursion optimization: Passes.
26403 * target attributes: Target Attributes.
26404 * target description macros: Target Macros.
26405 * target functions: Target Structure.
26406 * target hooks: Target Structure.
26407 * target makefile fragment: Target Fragment.
26408 * target specifications: Run-time Target.
26409 * target-parameter-dependent code: Passes.
26410 * TARGET_: Run-time Target.
26411 * TARGET_ADDRESS_COST: Costs.
26412 * TARGET_ASM_ALIGNED_DI_OP: Data Output.
26413 * TARGET_ASM_ALIGNED_HI_OP: Data Output.
26414 * TARGET_ASM_ALIGNED_SI_OP: Data Output.
26415 * TARGET_ASM_ALIGNED_TI_OP: Data Output.
26416 * TARGET_ASM_ASSEMBLE_VISIBILITY: Label Output.
26417 * TARGET_ASM_BYTE_OP: Data Output.
26418 * TARGET_ASM_CLOSE_PAREN: Data Output.
26419 * TARGET_ASM_CONSTRUCTOR: Macros for Initialization.
26420 * TARGET_ASM_DESTRUCTOR: Macros for Initialization.
26421 * TARGET_ASM_EH_FRAME_SECTION: Exception Region Output.
26422 * TARGET_ASM_EXCEPTION_SECTION: Exception Region Output.
26423 * TARGET_ASM_EXTERNAL_LIBCALL: Label Output.
26424 * TARGET_ASM_FILE_END: File Framework.
26425 * TARGET_ASM_FILE_START: File Framework.
26426 * TARGET_ASM_FILE_START_APP_OFF: File Framework.
26427 * TARGET_ASM_FILE_START_FILE_DIRECTIVE: File Framework.
26428 * TARGET_ASM_FUNCTION_BEGIN_EPILOGUE: Function Entry.
26429 * TARGET_ASM_FUNCTION_END_PROLOGUE: Function Entry.
26430 * TARGET_ASM_FUNCTION_EPILOGUE: Function Entry.
26431 * TARGET_ASM_FUNCTION_EPILOGUE and trampolines: Trampolines.
26432 * TARGET_ASM_FUNCTION_PROLOGUE: Function Entry.
26433 * TARGET_ASM_FUNCTION_PROLOGUE and trampolines: Trampolines.
26434 * TARGET_ASM_GLOBALIZE_LABEL: Label Output.
26435 * TARGET_ASM_INTEGER: Data Output.
26436 * TARGET_ASM_INTERNAL_LABEL: Label Output.
26437 * TARGET_ASM_NAMED_SECTION: File Framework.
26438 * TARGET_ASM_OPEN_PAREN: Data Output.
26439 * TARGET_ASM_OUTPUT_MI_THUNK: Function Entry.
26440 * TARGET_ASM_OUTPUT_MI_VCALL_THUNK: Function Entry.
26441 * TARGET_ASM_SELECT_RTX_SECTION: Sections.
26442 * TARGET_ASM_SELECT_SECTION: Sections.
26443 * TARGET_ASM_UNALIGNED_DI_OP: Data Output.
26444 * TARGET_ASM_UNALIGNED_HI_OP: Data Output.
26445 * TARGET_ASM_UNALIGNED_SI_OP: Data Output.
26446 * TARGET_ASM_UNALIGNED_TI_OP: Data Output.
26447 * TARGET_ASM_UNIQUE_SECTION: Sections.
26448 * TARGET_ATTRIBUTE_TABLE: Target Attributes.
26449 * TARGET_BELL: Escape Sequences.
26450 * TARGET_BINDS_LOCAL_P: Sections.
26451 * TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED: Misc.
26452 * TARGET_BRANCH_TARGET_REGISTER_CLASS: Misc.
26453 * TARGET_C99_FUNCTIONS: Library Calls.
26454 * TARGET_CANNOT_MODIFY_JUMPS_P: Misc.
26455 * TARGET_COMP_TYPE_ATTRIBUTES: Target Attributes.
26456 * TARGET_CPU_CPP_BUILTINS: Run-time Target.
26457 * TARGET_CR: Escape Sequences.
26458 * TARGET_DLLIMPORT_DECL_ATTRIBUTES: Target Attributes.
26459 * TARGET_DWARF_REGISTER_SPAN: Exception Region Output.
26460 * TARGET_EDOM: Library Calls.
26461 * TARGET_ENCODE_SECTION_INFO: Sections.
26462 * TARGET_ENCODE_SECTION_INFO and address validation: Addressing Modes.
26463 * TARGET_ENCODE_SECTION_INFO usage: Instruction Output.
26464 * TARGET_ESC: Escape Sequences.
26465 * TARGET_EXECUTABLE_SUFFIX: Misc.
26466 * TARGET_EXPAND_BUILTIN: Misc.
26467 * TARGET_EXPAND_BUILTIN_SAVEREGS: Varargs.
26468 * TARGET_FF: Escape Sequences.
26469 * TARGET_FIXED_CONDITION_CODE_REGS: Condition Code.
26470 * target_flags: Run-time Target.
26471 * TARGET_FLOAT_FORMAT: Storage Layout.
26472 * TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL: Library Calls.
26473 * TARGET_FLT_EVAL_METHOD: Type Layout.
26474 * TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P: Target Attributes.
26475 * TARGET_FUNCTION_OK_FOR_SIBCALL: Tail Calls.
26476 * TARGET_HAS_F_SETLKW: Misc.
26477 * TARGET_HAVE_CTORS_DTORS: Macros for Initialization.
26478 * TARGET_HAVE_NAMED_SECTIONS: File Framework.
26479 * TARGET_IN_SMALL_DATA_P: Sections.
26480 * TARGET_INIT_BUILTINS: Misc.
26481 * TARGET_INIT_LIBFUNCS: Library Calls.
26482 * TARGET_INSERT_ATTRIBUTES: Target Attributes.
26483 * TARGET_MACHINE_DEPENDENT_REORG: Misc.
26484 * TARGET_MANGLE_FUNDAMENTAL_TYPE: Storage Layout.
26485 * TARGET_MEM_FUNCTIONS: Library Calls.
26486 * TARGET_MERGE_DECL_ATTRIBUTES: Target Attributes.
26487 * TARGET_MERGE_TYPE_ATTRIBUTES: Target Attributes.
26488 * TARGET_MS_BITFIELD_LAYOUT_P: Storage Layout.
26489 * TARGET_NEWLINE: Escape Sequences.
26490 * TARGET_OBJECT_SUFFIX: Misc.
26491 * TARGET_OBJFMT_CPP_BUILTINS: Run-time Target.
26492 * TARGET_OPTION_TRANSLATE_TABLE: Driver.
26493 * TARGET_OPTIONS: Run-time Target.
26494 * TARGET_OS_CPP_BUILTINS: Run-time Target.
26495 * TARGET_PRETEND_OUTGOING_VARARGS_NAMED: Varargs.
26496 * TARGET_PROMOTE_FUNCTION_ARGS: Storage Layout.
26497 * TARGET_PROMOTE_FUNCTION_RETURN: Storage Layout.
26498 * TARGET_PROMOTE_PROTOTYPES: Stack Arguments.
26499 * TARGET_PTRMEMFUNC_VBIT_LOCATION: Type Layout.
26500 * TARGET_RETURN_IN_MEMORY: Aggregate Return.
26501 * TARGET_RETURN_IN_MSB: Scalar Return.
26502 * TARGET_RTX_COSTS: Costs.
26503 * TARGET_SCHED_ADJUST_COST: Scheduling.
26504 * TARGET_SCHED_ADJUST_PRIORITY: Scheduling.
26505 * TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK: Scheduling.
26506 * TARGET_SCHED_DFA_BUBBLE: Scheduling.
26507 * TARGET_SCHED_DFA_NEW_CYCLE: Scheduling.
26508 * TARGET_SCHED_DFA_POST_CYCLE_INSN: Scheduling.
26509 * TARGET_SCHED_DFA_PRE_CYCLE_INSN: Scheduling.
26510 * TARGET_SCHED_FINISH: Scheduling.
26511 * TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD: Scheduling.
26512 * TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD: Scheduling.
26513 * TARGET_SCHED_INIT: Scheduling.
26514 * TARGET_SCHED_INIT_DFA_BUBBLES: Scheduling.
26515 * TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN: Scheduling.
26516 * TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN: Scheduling.
26517 * TARGET_SCHED_ISSUE_RATE: Scheduling.
26518 * TARGET_SCHED_REORDER: Scheduling.
26519 * TARGET_SCHED_REORDER2: Scheduling.
26520 * TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE: Scheduling.
26521 * TARGET_SCHED_VARIABLE_ISSUE: Scheduling.
26522 * TARGET_SECTION_TYPE_FLAGS: File Framework.
26523 * TARGET_SET_DEFAULT_TYPE_ATTRIBUTES: Target Attributes.
26524 * TARGET_SETUP_INCOMING_VARARGS: Varargs.
26525 * TARGET_SPLIT_COMPLEX_ARG: Register Arguments.
26526 * TARGET_STRICT_ARGUMENT_NAMING: Varargs.
26527 * TARGET_STRUCT_VALUE_RTX: Aggregate Return.
26528 * TARGET_SWITCHES: Run-time Target.
26529 * TARGET_TAB: Escape Sequences.
26530 * TARGET_VECTOR_OPAQUE_P: Storage Layout.
26531 * TARGET_VERSION: Run-time Target.
26532 * TARGET_VT: Escape Sequences.
26533 * TARGET_VTABLE_DATA_ENTRY_DISTANCE: Type Layout.
26534 * TARGET_VTABLE_ENTRY_ALIGN: Type Layout.
26535 * TARGET_VTABLE_USES_DESCRIPTORS: Type Layout.
26536 * targetm: Target Structure.
26537 * targets, makefile: Makefile.
26538 * TCmode: Machine Modes.
26539 * TEMPLATE_DECL: Declarations.
26540 * termination routines: Initialization.
26541 * text_section: Sections.
26542 * TEXT_SECTION_ASM_OP: Sections.
26543 * TFmode: Machine Modes.
26544 * THEN_CLAUSE: Function Bodies.
26545 * THREAD_MODEL_SPEC: Driver.
26546 * THROW_EXPR: Expression trees.
26547 * THUNK_DECL: Declarations.
26548 * THUNK_DELTA: Declarations.
26549 * TImode: Machine Modes.
26550 * TImode, in insn: Insns.
26551 * tm.h macros: Target Macros.
26552 * top level of compiler: Passes.
26553 * TQFmode: Machine Modes.
26554 * TRADITIONAL_PIPELINE_INTERFACE: Scheduling.
26555 * TRAMPOLINE_ADJUST_ADDRESS: Trampolines.
26556 * TRAMPOLINE_ALIGNMENT: Trampolines.
26557 * TRAMPOLINE_SECTION: Trampolines.
26558 * TRAMPOLINE_SIZE: Trampolines.
26559 * TRAMPOLINE_TEMPLATE: Trampolines.
26560 * trampolines for nested functions: Trampolines.
26561 * TRANSFER_FROM_TRAMPOLINE: Trampolines.
26562 * trap instruction pattern: Standard Names.
26563 * tree <1>: Macros and Functions.
26564 * tree: Tree overview.
26565 * Tree optimization: Passes.
26566 * TREE_CODE: Tree overview.
26567 * tree_int_cst_equal: Expression trees.
26568 * TREE_INT_CST_HIGH: Expression trees.
26569 * TREE_INT_CST_LOW: Expression trees.
26570 * tree_int_cst_lt: Expression trees.
26571 * TREE_LIST: Containers.
26572 * TREE_OPERAND: Expression trees.
26573 * TREE_PUBLIC: Function Basics.
26574 * TREE_PURPOSE: Containers.
26575 * TREE_STRING_LENGTH: Expression trees.
26576 * TREE_STRING_POINTER: Expression trees.
26577 * TREE_TYPE <1>: Function Basics.
26578 * TREE_TYPE <2>: Declarations.
26579 * TREE_TYPE <3>: Types.
26580 * TREE_TYPE: Expression trees.
26581 * TREE_VALUE: Containers.
26582 * TREE_VEC: Containers.
26583 * TREE_VEC_ELT: Containers.
26584 * TREE_VEC_LENGTH: Containers.
26585 * TREE_VIA_PRIVATE: Classes.
26586 * TREE_VIA_PROTECTED: Classes.
26587 * TREE_VIA_PUBLIC: Classes.
26589 * TRULY_NOOP_TRUNCATION: Misc.
26590 * TRUNC_DIV_EXPR: Expression trees.
26591 * TRUNC_MOD_EXPR: Expression trees.
26592 * truncate: Conversions.
26593 * truncM2 instruction pattern: Standard Names.
26594 * truncMN2 instruction pattern: Standard Names.
26595 * TRUTH_AND_EXPR: Expression trees.
26596 * TRUTH_ANDIF_EXPR: Expression trees.
26597 * TRUTH_NOT_EXPR: Expression trees.
26598 * TRUTH_OR_EXPR: Expression trees.
26599 * TRUTH_ORIF_EXPR: Expression trees.
26600 * TRUTH_XOR_EXPR: Expression trees.
26601 * TRY_BLOCK: Function Bodies.
26602 * TRY_HANDLERS: Function Bodies.
26603 * TRY_STMTS: Function Bodies.
26604 * tstM instruction pattern: Standard Names.
26606 * type declaration: Declarations.
26607 * TYPE_ALIGN: Types.
26608 * TYPE_ARG_TYPES: Types.
26609 * TYPE_ASM_OP: Label Output.
26610 * TYPE_ATTRIBUTES: Attributes.
26611 * TYPE_BINFO: Classes.
26612 * TYPE_BUILT_IN: Types.
26613 * TYPE_CONTEXT: Types.
26614 * TYPE_DECL: Declarations.
26615 * TYPE_FIELDS <1>: Types.
26616 * TYPE_FIELDS: Classes.
26617 * TYPE_HAS_ARRAY_NEW_OPERATOR: Classes.
26618 * TYPE_HAS_DEFAULT_CONSTRUCTOR: Classes.
26619 * TYPE_HAS_MUTABLE_P: Classes.
26620 * TYPE_HAS_NEW_OPERATOR: Classes.
26621 * TYPE_MAIN_VARIANT: Types.
26622 * TYPE_MAX_VALUE: Types.
26623 * TYPE_METHOD_BASETYPE: Types.
26624 * TYPE_METHODS: Classes.
26625 * TYPE_MIN_VALUE: Types.
26626 * TYPE_NAME: Types.
26627 * TYPE_NOTHROW_P: Function Basics.
26628 * TYPE_OFFSET_BASETYPE: Types.
26629 * TYPE_OPERAND_FMT: Label Output.
26630 * TYPE_OVERLOADS_ARRAY_REF: Classes.
26631 * TYPE_OVERLOADS_ARROW: Classes.
26632 * TYPE_OVERLOADS_CALL_EXPR: Classes.
26633 * TYPE_POLYMORPHIC_P: Classes.
26634 * TYPE_PRECISION: Types.
26635 * TYPE_PTR_P: Types.
26636 * TYPE_PTRFN_P: Types.
26637 * TYPE_PTRMEM_P: Types.
26638 * TYPE_PTROB_P: Types.
26639 * TYPE_PTROBV_P: Types.
26640 * TYPE_QUAL_CONST: Types.
26641 * TYPE_QUAL_RESTRICT: Types.
26642 * TYPE_QUAL_VOLATILE: Types.
26643 * TYPE_RAISES_EXCEPTIONS: Function Basics.
26644 * TYPE_SIZE: Types.
26645 * TYPE_UNQUALIFIED: Types.
26646 * TYPE_VFIELD: Classes.
26647 * TYPENAME_TYPE: Types.
26648 * TYPENAME_TYPE_FULLNAME: Types.
26649 * TYPEOF_TYPE: Types.
26650 * udiv: Arithmetic.
26651 * udivM3 instruction pattern: Standard Names.
26652 * udivmodM4 instruction pattern: Standard Names.
26653 * UINTMAX_TYPE: Type Layout.
26654 * umax: Arithmetic.
26655 * umaxM3 instruction pattern: Standard Names.
26656 * umin: Arithmetic.
26657 * uminM3 instruction pattern: Standard Names.
26658 * umod: Arithmetic.
26659 * umodM3 instruction pattern: Standard Names.
26660 * umulhisi3 instruction pattern: Standard Names.
26661 * umulM3_highpart instruction pattern: Standard Names.
26662 * umulqihi3 instruction pattern: Standard Names.
26663 * umulsidi3 instruction pattern: Standard Names.
26664 * unchanging: Flags.
26665 * unchanging, in call_insn: Flags.
26666 * unchanging, in jump_insn, call_insn and insn: Flags.
26667 * unchanging, in reg and mem: Flags.
26668 * unchanging, in subreg: Flags.
26669 * unchanging, in symbol_ref: Flags.
26670 * UNION_TYPE <1>: Types.
26671 * UNION_TYPE: Classes.
26672 * unions, returning: Interface.
26673 * UNITS_PER_WORD: Storage Layout.
26674 * UNKNOWN_TYPE: Types.
26675 * UNLIKELY_EXECUTED_TEXT_SECTION_NAME: Sections.
26676 * unreachable code: Passes.
26677 * unshare_all_rtl: Sharing.
26678 * unsigned division: Arithmetic.
26679 * unsigned greater than: Comparisons.
26680 * unsigned less than: Comparisons.
26681 * unsigned minimum and maximum: Arithmetic.
26682 * unsigned_fix: Conversions.
26683 * unsigned_float: Conversions.
26684 * unspec: Side Effects.
26685 * unspec_volatile: Side Effects.
26686 * untyped_call instruction pattern: Standard Names.
26687 * untyped_return instruction pattern: Standard Names.
26688 * UPDATE_PATH_HOST_CANONICALIZE (PATH): Filesystem.
26689 * US Software GOFAST, floating point emulation library: Library Calls.
26690 * us_minus: Arithmetic.
26691 * us_plus: Arithmetic.
26692 * US_SOFTWARE_GOFAST: Library Calls.
26693 * us_truncate: Conversions.
26694 * use: Side Effects.
26695 * USE_C_ALLOCA: Host Misc.
26696 * USE_LOAD_POST_DECREMENT: Costs.
26697 * USE_LOAD_POST_INCREMENT: Costs.
26698 * USE_LOAD_PRE_DECREMENT: Costs.
26699 * USE_LOAD_PRE_INCREMENT: Costs.
26700 * use_param: GTY Options.
26701 * use_paramN: GTY Options.
26702 * use_params: GTY Options.
26703 * USE_STORE_POST_DECREMENT: Costs.
26704 * USE_STORE_POST_INCREMENT: Costs.
26705 * USE_STORE_PRE_DECREMENT: Costs.
26706 * USE_STORE_PRE_INCREMENT: Costs.
26708 * used, in symbol_ref: Flags.
26709 * USER_LABEL_PREFIX: Instruction Output.
26710 * USING_DECL: Declarations.
26711 * USING_STMT: Function Bodies.
26712 * V in constraint: Simple Constraints.
26713 * VA_ARG_EXPR: Expression trees.
26714 * values, returned by functions: Scalar Return.
26715 * VAR_DECL <1>: Expression trees.
26716 * VAR_DECL: Declarations.
26717 * varargs implementation: Varargs.
26718 * variable: Declarations.
26719 * VAX_FLOAT_FORMAT: Storage Layout.
26720 * vec_concat: Vector Operations.
26721 * vec_duplicate: Vector Operations.
26722 * vec_merge: Vector Operations.
26723 * vec_select: Vector Operations.
26724 * vector: Containers.
26725 * vector operations: Vector Operations.
26726 * VECTOR_CST: Expression trees.
26727 * VECTOR_MODE_SUPPORTED_P: Storage Layout.
26728 * VIRTUAL_INCOMING_ARGS_REGNUM: Regs and Memory.
26729 * VIRTUAL_OUTGOING_ARGS_REGNUM: Regs and Memory.
26730 * VIRTUAL_STACK_DYNAMIC_REGNUM: Regs and Memory.
26731 * VIRTUAL_STACK_VARS_REGNUM: Regs and Memory.
26732 * VLIW <1>: Automaton pipeline description.
26733 * VLIW: Processor pipeline description.
26735 * VMS_DEBUGGING_INFO: VMS Debug.
26736 * VOID_TYPE: Types.
26737 * VOIDmode: Machine Modes.
26739 * volatil, in insn, call_insn, jump_insn, code_label, barrier, and note: Flags.
26740 * volatil, in label_ref and reg_label: Flags.
26741 * volatil, in mem, asm_operands, and asm_input: Flags.
26742 * volatil, in reg: Flags.
26743 * volatil, in subreg: Flags.
26744 * volatil, in symbol_ref: Flags.
26745 * volatile memory references: Flags.
26746 * voting between constraint alternatives: Class Preferences.
26747 * VTABLE_REF: Expression trees.
26748 * WCHAR_TYPE: Type Layout.
26749 * WCHAR_TYPE_SIZE: Type Layout.
26750 * web construction: Passes.
26751 * which_alternative: Output Statement.
26752 * WHILE_BODY: Function Bodies.
26753 * WHILE_COND: Function Bodies.
26754 * WHILE_STMT: Function Bodies.
26755 * WIDEST_HARDWARE_FP_SIZE: Type Layout.
26756 * WINT_TYPE: Type Layout.
26757 * word_mode: Machine Modes.
26758 * WORD_REGISTER_OPERATIONS: Misc.
26759 * WORD_SWITCH_TAKES_ARG: Driver.
26760 * WORDS_BIG_ENDIAN: Storage Layout.
26761 * WORDS_BIG_ENDIAN, effect on subreg: Regs and Memory.
26762 * X in constraint: Simple Constraints.
26763 * x-HOST: Host Fragment.
26764 * XCmode: Machine Modes.
26765 * XCOFF_DEBUGGING_INFO: DBX Options.
26767 * XFmode: Machine Modes.
26769 * xm-MACHINE.h <1>: Filesystem.
26770 * xm-MACHINE.h: Host Misc.
26772 * xor, canonicalization of: Insn Canonicalizations.
26773 * xorM3 instruction pattern: Standard Names.
26776 * XVECEXP: Accessors.
26777 * XVECLEN: Accessors.
26778 * XWINT: Accessors.
26779 * zero_extend: Conversions.
26780 * zero_extendMN2 instruction pattern: Standard Names.
26781 * zero_extract: Bit-Fields.
26782 * zero_extract, canonicalization of: Insn Canonicalizations.
26788 Node: Contributing
\x7f4646
26789 Node: Portability
\x7f5388
26790 Node: Interface
\x7f7178
26791 Node: Libgcc
\x7f10596
26792 Node: Integer library routines
\x7f12350
26793 Node: Soft float library routines
\x7f18932
26794 Node: Exception handling routines
\x7f28188
26795 Node: Miscellaneous routines
\x7f29278
26796 Node: Languages
\x7f29640
26797 Node: Source Tree
\x7f31190
26798 Node: Configure Terms
\x7f31807
26799 Node: Top Level
\x7f34773
26800 Node: gcc Directory
\x7f36895
26801 Node: Subdirectories
\x7f37859
26802 Node: Configuration
\x7f40159
26803 Node: Config Fragments
\x7f40870
26804 Node: System Config
\x7f42201
26805 Node: Configuration Files
\x7f43132
26806 Node: Build
\x7f45807
26807 Node: Makefile
\x7f46210
26808 Node: Library Files
\x7f50379
26809 Node: Headers
\x7f50932
26810 Node: Documentation
\x7f52910
26811 Node: Texinfo Manuals
\x7f53703
26812 Node: Man Page Generation
\x7f55824
26813 Node: Miscellaneous Docs
\x7f57732
26814 Node: Front End
\x7f59076
26815 Node: Front End Directory
\x7f62836
26816 Node: Front End Config
\x7f68162
26817 Node: Back End
\x7f70895
26818 Node: Testsuites
\x7f74222
26819 Node: Test Idioms
\x7f74951
26820 Node: Ada Tests
\x7f78519
26821 Node: C Tests
\x7f79799
26822 Node: libgcj Tests
\x7f84146
26823 Node: gcov Testing
\x7f85569
26824 Node: profopt Testing
\x7f88557
26825 Node: compat Testing
\x7f89996
26826 Node: Passes
\x7f93338
26827 Node: Trees
\x7f116903
26828 Node: Deficiencies
\x7f119632
26829 Node: Tree overview
\x7f119865
26830 Node: Macros and Functions
\x7f123999
26831 Node: Identifiers
\x7f124136
26832 Node: Containers
\x7f125655
26833 Node: Types
\x7f126802
26834 Node: Scopes
\x7f139417
26835 Node: Namespaces
\x7f140176
26836 Node: Classes
\x7f142982
26837 Node: Declarations
\x7f147582
26838 Node: Functions
\x7f153639
26839 Node: Function Basics
\x7f156044
26840 Node: Function Bodies
\x7f162793
26841 Node: Attributes
\x7f176681
26842 Node: Expression trees
\x7f177917
26843 Node: RTL
\x7f203805
26844 Node: RTL Objects
\x7f205907
26845 Node: RTL Classes
\x7f209795
26846 Node: Accessors
\x7f214416
26847 Node: Special Accessors
\x7f216811
26848 Node: Flags
\x7f220674
26849 Node: Machine Modes
\x7f236988
26850 Node: Constants
\x7f245721
26851 Node: Regs and Memory
\x7f251684
26852 Node: Arithmetic
\x7f264732
26853 Node: Comparisons
\x7f272431
26854 Node: Bit-Fields
\x7f276559
26855 Node: Vector Operations
\x7f277980
26856 Node: Conversions
\x7f279596
26857 Node: RTL Declarations
\x7f282906
26858 Node: Side Effects
\x7f283718
26859 Node: Incdec
\x7f299580
26860 Node: Assembler
\x7f302917
26861 Node: Insns
\x7f304442
26862 Node: Calls
\x7f329674
26863 Node: Sharing
\x7f332271
26864 Node: Reading RTL
\x7f335375
26865 Node: Machine Desc
\x7f336361
26866 Node: Overview
\x7f338640
26867 Node: Patterns
\x7f340682
26868 Node: Example
\x7f344115
26869 Node: RTL Template
\x7f345549
26870 Node: Output Template
\x7f358016
26871 Node: Output Statement
\x7f362001
26872 Node: Constraints
\x7f365975
26873 Node: Simple Constraints
\x7f366909
26874 Node: Multi-Alternative
\x7f379292
26875 Node: Class Preferences
\x7f382130
26876 Node: Modifiers
\x7f383013
26877 Node: Machine Constraints
\x7f386776
26878 Node: Standard Names
\x7f408971
26879 Ref: prologue instruction pattern
\x7f453554
26880 Ref: epilogue instruction pattern
\x7f454047
26881 Node: Pattern Ordering
\x7f456497
26882 Node: Dependent Patterns
\x7f457727
26883 Node: Jump Patterns
\x7f460545
26884 Node: Looping Patterns
\x7f466295
26885 Node: Insn Canonicalizations
\x7f470901
26886 Node: Expander Definitions
\x7f474719
26887 Node: Insn Splitting
\x7f482854
26888 Node: Including Patterns
\x7f492488
26889 Node: Peephole Definitions
\x7f494262
26890 Node: define_peephole
\x7f495512
26891 Node: define_peephole2
\x7f501861
26892 Node: Insn Attributes
\x7f504925
26893 Node: Defining Attributes
\x7f506022
26894 Node: Expressions
\x7f508038
26895 Node: Tagging Insns
\x7f514630
26896 Node: Attr Example
\x7f518995
26897 Node: Insn Lengths
\x7f521374
26898 Node: Constant Attributes
\x7f524433
26899 Node: Delay Slots
\x7f525596
26900 Node: Processor pipeline description
\x7f528826
26901 Node: Old pipeline description
\x7f532770
26902 Node: Automaton pipeline description
\x7f538488
26903 Node: Comparison of the two descriptions
\x7f553427
26904 Node: Conditional Execution
\x7f555408
26905 Node: Constant Definitions
\x7f558267
26906 Node: Target Macros
\x7f559848
26907 Node: Target Structure
\x7f562678
26908 Node: Driver
\x7f563969
26909 Node: Run-time Target
\x7f584747
26910 Node: Per-Function Data
\x7f595329
26911 Node: Storage Layout
\x7f598090
26912 Node: Type Layout
\x7f622408
26913 Node: Escape Sequences
\x7f633418
26914 Node: Registers
\x7f634288
26915 Node: Register Basics
\x7f635211
26916 Node: Allocation Order
\x7f641074
26917 Node: Values in Registers
\x7f642506
26918 Node: Leaf Functions
\x7f647813
26919 Node: Stack Registers
\x7f650618
26920 Node: Register Classes
\x7f651722
26921 Node: Stack and Calling
\x7f677054
26922 Node: Frame Layout
\x7f677550
26923 Node: Exception Handling
\x7f685128
26924 Node: Stack Checking
\x7f691022
26925 Node: Frame Registers
\x7f694635
26926 Node: Elimination
\x7f701214
26927 Node: Stack Arguments
\x7f705227
26928 Node: Register Arguments
\x7f713171
26929 Node: Scalar Return
\x7f725818
26930 Node: Aggregate Return
\x7f730572
26931 Node: Caller Saves
\x7f733895
26932 Node: Function Entry
\x7f735056
26933 Node: Profiling
\x7f747665
26934 Node: Tail Calls
\x7f749304
26935 Node: Varargs
\x7f750119
26936 Node: Trampolines
\x7f758032
26937 Node: Library Calls
\x7f764802
26938 Node: Addressing Modes
\x7f768900
26939 Node: Condition Code
\x7f779875
26940 Node: Costs
\x7f787991
26941 Node: Scheduling
\x7f799710
26942 Node: Sections
\x7f815529
26943 Node: PIC
\x7f826017
26944 Node: Assembler Format
\x7f828850
26945 Node: File Framework
\x7f829920
26946 Node: Data Output
\x7f835964
26947 Node: Uninitialized Data
\x7f843358
26948 Node: Label Output
\x7f848866
26949 Node: Initialization
\x7f867919
26950 Node: Macros for Initialization
\x7f873900
26951 Node: Instruction Output
\x7f880164
26952 Node: Dispatch Tables
\x7f889132
26953 Node: Exception Region Output
\x7f891751
26954 Node: Alignment Output
\x7f896226
26955 Node: Debugging Info
\x7f900343
26956 Node: All Debuggers
\x7f901004
26957 Node: DBX Options
\x7f903842
26958 Node: DBX Hooks
\x7f909124
26959 Node: File Names and DBX
\x7f912720
26960 Node: SDB and DWARF
\x7f914028
26961 Node: VMS Debug
\x7f917720
26962 Node: Floating Point
\x7f918276
26963 Node: Mode Switching
\x7f923079
26964 Node: Target Attributes
\x7f926987
26965 Node: MIPS Coprocessors
\x7f930847
26966 Node: PCH Target
\x7f932424
26967 Node: Misc
\x7f933668
26968 Node: Host Config
\x7f967965
26969 Node: Host Common
\x7f969024
26970 Node: Filesystem
\x7f971190
26971 Node: Host Misc
\x7f974738
26972 Node: Fragments
\x7f977283
26973 Node: Target Fragment
\x7f978478
26974 Node: Host Fragment
\x7f983929
26975 Node: Collect2
\x7f985365
26976 Node: Header Dirs
\x7f987919
26977 Node: Type Information
\x7f989346
26978 Node: GTY Options
\x7f990401
26979 Node: GGC Roots
\x7f998850
26980 Node: Files
\x7f999551
26981 Node: Funding
\x7f1002397
26982 Node: GNU Project
\x7f1004908
26983 Node: Copying
\x7f1005562
26984 Node: GNU Free Documentation License
\x7f1024773
26985 Node: Contributors
\x7f1047185
26986 Node: Option Index
\x7f1074721
26987 Node: Index
\x7f1076294