|
|
1.1 root 1: This is Info file gcc.info, produced by Makeinfo-1.54 from the input
2: file gcc.texi.
3:
4: This file documents the use and the internals of the GNU compiler.
5:
6: Published by the Free Software Foundation 675 Massachusetts Avenue
7: Cambridge, MA 02139 USA
8:
9: Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
10:
11: Permission is granted to make and distribute verbatim copies of this
12: manual provided the copyright notice and this permission notice are
13: preserved on all copies.
14:
15: Permission is granted to copy and distribute modified versions of
16: this manual under the conditions for verbatim copying, provided also
17: that the sections entitled "GNU General Public License" and "Protect
18: Your Freedom--Fight `Look And Feel'" are included exactly as in the
19: original, and provided that the entire resulting derived work is
20: distributed under the terms of a permission notice identical to this
21: one.
22:
23: Permission is granted to copy and distribute translations of this
24: manual into another language, under the above conditions for modified
25: versions, except that the sections entitled "GNU General Public
26: License" and "Protect Your Freedom--Fight `Look And Feel'", and this
27: permission notice, may be included in translations approved by the Free
28: Software Foundation instead of in the original English.
29:
30:
1.1.1.2 ! root 31: File: gcc.info, Node: Misc, Prev: Cross-compilation, Up: Target Macros
1.1 root 32:
1.1.1.2 ! root 33: Miscellaneous Parameters
! 34: ========================
1.1 root 35:
1.1.1.2 ! root 36: `PREDICATE_CODES'
! 37: Define this if you have defined special-purpose predicates in the
! 38: file `MACHINE.c'. This macro is called within an initializer of an
! 39: array of structures. The first field in the structure is the name
! 40: of a predicate and the second field is an array of rtl codes. For
! 41: each predicate, list all rtl codes that can be in expressions
! 42: matched by the predicate. The list should have a trailing comma.
! 43: Here is an example of two entries in the list for a typical RISC
! 44: machine:
1.1 root 45:
1.1.1.2 ! root 46: #define PREDICATE_CODES \
! 47: {"gen_reg_rtx_operand", {SUBREG, REG}}, \
! 48: {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
1.1 root 49:
1.1.1.2 ! root 50: Defining this macro does not affect the generated code (however,
! 51: incorrect definitions that omit an rtl code that may be matched by
! 52: the predicate can cause the compiler to malfunction). Instead, it
! 53: allows the table built by `genrecog' to be more compact and
! 54: efficient, thus speeding up the compiler. The most important
! 55: predicates to include in the list specified by this macro are
! 56: thoses used in the most insn patterns.
! 57:
! 58: `CASE_VECTOR_MODE'
! 59: An alias for a machine mode name. This is the machine mode that
! 60: elements of a jump-table should have.
! 61:
! 62: `CASE_VECTOR_PC_RELATIVE'
! 63: Define this macro if jump-tables should contain relative addresses.
! 64:
! 65: `CASE_DROPS_THROUGH'
! 66: Define this if control falls through a `case' insn when the index
! 67: value is out of range. This means the specified default-label is
! 68: actually ignored by the `case' insn proper.
! 69:
! 70: `CASE_VALUES_THRESHOLD'
! 71: Define this to be the smallest number of different values for
! 72: which it is best to use a jump-table instead of a tree of
! 73: conditional branches. The default is four for machines with a
! 74: `casesi' instruction and five otherwise. This is best for most
! 75: machines.
! 76:
! 77: `WORD_REGISTER_OPERATIONS'
! 78: Define this macro if operations between registers with integral
! 79: mode smaller than a word are always performed on the entire
! 80: register. Most RISC machines have this property and most CISC
! 81: machines do not.
! 82:
! 83: `LOAD_EXTEND_OP (MODE)'
! 84: Define this macro to be a C expression indicating when insns that
! 85: read memory in MODE, an integral mode narrower than a word, set the
! 86: bits outside of MODE to be either the sign-extension or the
! 87: zero-extension of the data read. Return `SIGN_EXTEND' for values
! 88: of MODE for which the insn sign-extends, `ZERO_EXTEND' for which
! 89: it zero-extends, and `NIL' for other modes.
! 90:
! 91: This macro is not called with MODE non-integral or with a width
! 92: greater than or equal to `BITS_PER_WORD', so you may return any
! 93: value in this case. Do not define this macro if it would always
! 94: return `NIL'. On machines where this macro is defined, you will
! 95: normally define it as the constant `SIGN_EXTEND' or `ZERO_EXTEND'.
! 96:
! 97: `IMPLICIT_FIX_EXPR'
! 98: An alias for a tree code that should be used by default for
! 99: conversion of floating point values to fixed point. Normally,
! 100: `FIX_ROUND_EXPR' is used.
! 101:
! 102: `FIXUNS_TRUNC_LIKE_FIX_TRUNC'
! 103: Define this macro if the same instructions that convert a floating
! 104: point number to a signed fixed point number also convert validly
! 105: to an unsigned one.
! 106:
! 107: `EASY_DIV_EXPR'
! 108: An alias for a tree code that is the easiest kind of division to
! 109: compile code for in the general case. It may be `TRUNC_DIV_EXPR',
! 110: `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'. These four
! 111: division operators differ in how they round the result to an
! 112: integer. `EASY_DIV_EXPR' is used when it is permissible to use
! 113: any of those kinds of division and the choice should be made on
! 114: the basis of efficiency.
! 115:
! 116: `MOVE_MAX'
! 117: The maximum number of bytes that a single instruction can move
! 118: quickly from memory to memory.
! 119:
! 120: `MAX_MOVE_MAX'
! 121: The maximum number of bytes that a single instruction can move
! 122: quickly from memory to memory. If this is undefined, the default
! 123: is `MOVE_MAX'. Otherwise, it is the constant value that is the
! 124: largest value that `MOVE_MAX' can have at run-time.
! 125:
! 126: `SHIFT_COUNT_TRUNCATED'
! 127: A C expression that is nonzero if on this machine the number of
! 128: bits actually used for the count of a shift operation is equal to
! 129: the number of bits needed to represent the size of the object
! 130: being shifted. When this macro is non-zero, the compiler will
! 131: assume that it is safe to omit a sign-extend, zero-extend, and
! 132: certain bitwise `and' instructions that truncates the count of a
! 133: shift operation. On machines that have instructions that act on
! 134: bitfields at variable positions, which may include `bit test'
! 135: instructions, a nonzero `SHIFT_COUNT_TRUNCATED' also enables
! 136: deletion of truncations of the values that serve as arguments to
! 137: bitfield instructions.
! 138:
! 139: If both types of instructions truncate the count (for shifts) and
! 140: position (for bitfield operations), or if no variable-position
! 141: bitfield instructions exist, you should define this macro.
! 142:
! 143: However, on some machines, such as the 80386 and the 680x0,
! 144: truncation only applies to shift operations and not the (real or
! 145: pretended) bitfield operations. Define `SHIFT_COUNT_TRUNCATED' to
! 146: be zero on such machines. Instead, add patterns to the `md' file
! 147: that include the implied truncation of the shift instructions.
! 148:
! 149: You need not define this macro if it would always have the value
! 150: of zero.
! 151:
! 152: `TRULY_NOOP_TRUNCATION (OUTPREC, INPREC)'
! 153: A C expression which is nonzero if on this machine it is safe to
! 154: "convert" an integer of INPREC bits to one of OUTPREC bits (where
! 155: OUTPREC is smaller than INPREC) by merely operating on it as if it
! 156: had only OUTPREC bits.
! 157:
! 158: On many machines, this expression can be 1.
! 159:
! 160: When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for
! 161: modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result.
! 162: If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in
! 163: such cases may improve things.
! 164:
! 165: `STORE_FLAG_VALUE'
! 166: A C expression describing the value returned by a comparison
! 167: operator with an integral mode and stored by a store-flag
! 168: instruction (`sCOND') when the condition is true. This
! 169: description must apply to *all* the `sCOND' patterns and all the
! 170: comparison operators whose results have a `MODE_INT' mode.
! 171:
! 172: A value of 1 or -1 means that the instruction implementing the
! 173: comparison operator returns exactly 1 or -1 when the comparison is
! 174: true and 0 when the comparison is false. Otherwise, the value
! 175: indicates which bits of the result are guaranteed to be 1 when the
! 176: comparison is true. This value is interpreted in the mode of the
! 177: comparison operation, which is given by the mode of the first
! 178: operand in the `sCOND' pattern. Either the low bit or the sign
! 179: bit of `STORE_FLAG_VALUE' be on. Presently, only those bits are
! 180: used by the compiler.
! 181:
! 182: If `STORE_FLAG_VALUE' is neither 1 or -1, the compiler will
! 183: generate code that depends only on the specified bits. It can also
! 184: replace comparison operators with equivalent operations if they
! 185: cause the required bits to be set, even if the remaining bits are
! 186: undefined. For example, on a machine whose comparison operators
! 187: return an `SImode' value and where `STORE_FLAG_VALUE' is defined as
! 188: `0x80000000', saying that just the sign bit is relevant, the
! 189: expression
! 190:
! 191: (ne:SI (and:SI X (const_int POWER-OF-2)) (const_int 0))
! 192:
! 193: can be converted to
! 194:
! 195: (ashift:SI X (const_int N))
! 196:
! 197: where N is the appropriate shift count to move the bit being
! 198: tested into the sign bit.
! 199:
! 200: There is no way to describe a machine that always sets the
! 201: low-order bit for a true value, but does not guarantee the value
! 202: of any other bits, but we do not know of any machine that has such
! 203: an instruction. If you are trying to port GNU CC to such a
! 204: machine, include an instruction to perform a logical-and of the
! 205: result with 1 in the pattern for the comparison operators and let
! 206: us know (*note How to Report Bugs: Bug Reporting.).
! 207:
! 208: Often, a machine will have multiple instructions that obtain a
! 209: value from a comparison (or the condition codes). Here are rules
! 210: to guide the choice of value for `STORE_FLAG_VALUE', and hence the
! 211: instructions to be used:
! 212:
! 213: * Use the shortest sequence that yields a valid definition for
! 214: `STORE_FLAG_VALUE'. It is more efficient for the compiler to
! 215: "normalize" the value (convert it to, e.g., 1 or 0) than for
! 216: the comparison operators to do so because there may be
! 217: opportunities to combine the normalization with other
! 218: operations.
! 219:
! 220: * For equal-length sequences, use a value of 1 or -1, with -1
! 221: being slightly preferred on machines with expensive jumps and
! 222: 1 preferred on other machines.
! 223:
! 224: * As a second choice, choose a value of `0x80000001' if
! 225: instructions exist that set both the sign and low-order bits
! 226: but do not define the others.
! 227:
! 228: * Otherwise, use a value of `0x80000000'.
! 229:
! 230: Many machines can produce both the value chosen for
! 231: `STORE_FLAG_VALUE' and its negation in the same number of
! 232: instructions. On those machines, you should also define a pattern
! 233: for those cases, e.g., one matching
! 234:
! 235: (set A (neg:M (ne:M B C)))
! 236:
! 237: Some machines can also perform `and' or `plus' operations on
! 238: condition code values with less instructions than the corresponding
! 239: `sCOND' insn followed by `and' or `plus'. On those machines,
! 240: define the appropriate patterns. Use the names `incscc' and
! 241: `decscc', respectively, for the the patterns which perform `plus'
! 242: or `minus' operations on condition code values. See `rs6000.md'
! 243: for some examples. The GNU Superoptizer can be used to find such
! 244: instruction sequences on other machines.
! 245:
! 246: You need not define `STORE_FLAG_VALUE' if the machine has no
! 247: store-flag instructions.
! 248:
! 249: `FLOAT_STORE_FLAG_VALUE'
! 250: A C expression that gives a non-zero floating point value that is
! 251: returned when comparison operators with floating-point results are
! 252: true. Define this macro on machine that have comparison
! 253: operations that return floating-point values. If there are no
! 254: such operations, do not define this macro.
! 255:
! 256: `Pmode'
! 257: An alias for the machine mode for pointers. Normally the
! 258: definition can be
! 259:
! 260: #define Pmode SImode
! 261:
! 262: `FUNCTION_MODE'
! 263: An alias for the machine mode used for memory references to
! 264: functions being called, in `call' RTL expressions. On most
! 265: machines this should be `QImode'.
! 266:
! 267: `INTEGRATE_THRESHOLD (DECL)'
! 268: A C expression for the maximum number of instructions above which
! 269: the function DECL should not be inlined. DECL is a
! 270: `FUNCTION_DECL' node.
! 271:
! 272: The default definition of this macro is 64 plus 8 times the number
! 273: of arguments that the function accepts. Some people think a larger
! 274: threshold should be used on RISC machines.
! 275:
! 276: `SCCS_DIRECTIVE'
! 277: Define this if the preprocessor should ignore `#sccs' directives
! 278: and print no error message.
! 279:
! 280: `NO_IMPLICIT_EXTERN_C'
! 281: Define this macro if the system header files support C++ as well
! 282: as C. This macro inhibits the usual method of using system header
! 283: files in C++, which is to pretend that the file's contents are
! 284: enclosed in `extern "C" {...}'.
! 285:
! 286: `HANDLE_PRAGMA (STREAM)'
! 287: Define this macro if you want to implement any pragmas. If
! 288: defined, it should be a C statement to be executed when `#pragma'
! 289: is seen. The argument STREAM is the stdio input stream from which
! 290: the source text can be read.
! 291:
! 292: It is generally a bad idea to implement new uses of `#pragma'. The
! 293: only reason to define this macro is for compatibility with other
! 294: compilers that do support `#pragma' for the sake of any user
! 295: programs which already use it.
! 296:
! 297: `DOLLARS_IN_IDENTIFIERS'
! 298: Define this macro to control use of the character `$' in identifier
! 299: names. The value should be 0, 1, or 2. 0 means `$' is not allowed
! 300: by default; 1 means it is allowed by default if `-traditional' is
! 301: used; 2 means it is allowed by default provided `-ansi' is not
! 302: used. 1 is the default; there is no need to define this macro in
! 303: that case.
! 304:
! 305: `NO_DOLLAR_IN_LABEL'
! 306: Define this macro if the assembler does not accept the character
! 307: `$' in label names. By default constructors and destructors in
! 308: G++ have `$' in the identifiers. If this macro is defined, `.' is
! 309: used instead.
! 310:
! 311: `NO_DOT_IN_LABEL'
! 312: Define this macro if the assembler does not accept the character
! 313: `.' in label names. By default constructors and destructors in G++
! 314: have names that use `.'. If this macro is defined, these names
! 315: are rewritten to avoid `.'.
! 316:
! 317: `DEFAULT_MAIN_RETURN'
! 318: Define this macro if the target system expects every program's
! 319: `main' function to return a standard "success" value by default
! 320: (if no other value is explicitly returned).
! 321:
! 322: The definition should be a C statement (sans semicolon) to
! 323: generate the appropriate rtl instructions. It is used only when
! 324: compiling the end of `main'.
! 325:
! 326: `HAVE_ATEXIT'
! 327: Define this if the target system supports the function `atexit'
! 328: from the ANSI C standard. If this is not defined, and
! 329: `INIT_SECTION_ASM_OP' is not defined, a default `exit' function
! 330: will be provided to support C++.
! 331:
! 332: `EXIT_BODY'
! 333: Define this if your `exit' function needs to do something besides
! 334: calling an external function `_cleanup' before terminating with
! 335: `_exit'. The `EXIT_BODY' macro is only needed if netiher
! 336: `HAVE_ATEXIT' nor `INIT_SECTION_ASM_OP' are defined.
! 337:
! 338: `INSN_SETS_ARE_DELAYED (INSN)'
! 339: Define this macro as a C expression that is nonzero if it is safe
! 340: for the delay slot scheduler to place instructions in the delay
! 341: slot of INSN, even if they appear to use a resource set or
! 342: clobbered in INSN. INSN is always a `jump_insn' or an `insn'; GNU
! 343: CC knows that every `call_insn' has this behavior. On machines
! 344: where some `insn' or `jump_insn' is really a function call and
! 345: hence has this behavior, you should define this macro.
! 346:
! 347: You need not define this macro if it would always return zero.
! 348:
! 349: `INSN_REFERENCES_ARE_DELAYED (INSN)'
! 350: Define this macro as a C expression that is nonzero if it is safe
! 351: for the delay slot scheduler to place instructions in the delay
! 352: slot of INSN, even if they appear to set or clobber a resource
! 353: referenced in INSN. INSN is always a `jump_insn' or an `insn'.
! 354: On machines where some `insn' or `jump_insn' is really a function
! 355: call and its operands are registers whose use is actually in the
! 356: subroutine it calls, you should define this macro. Doing so
! 357: allows the delay slot scheduler to move instructions which copy
! 358: arguments into the argument registers into the delay slot of INSN.
! 359:
! 360: You need not define this macro if it would always return zero.
! 361:
! 362:
! 363: File: gcc.info, Node: Config, Next: Index, Prev: Target Macros, Up: Top
! 364:
! 365: The Configuration File
! 366: **********************
! 367:
! 368: The configuration file `xm-MACHINE.h' contains macro definitions
! 369: that describe the machine and system on which the compiler is running,
! 370: unlike the definitions in `MACHINE.h', which describe the machine for
! 371: which the compiler is producing output. Most of the values in
! 372: `xm-MACHINE.h' are actually the same on all machines that GNU CC runs
! 373: on, so large parts of all configuration files are identical. But there
! 374: are some macros that vary:
! 375:
! 376: `USG'
! 377: Define this macro if the host system is System V.
! 378:
! 379: `VMS'
! 380: Define this macro if the host system is VMS.
! 381:
! 382: `FAILURE_EXIT_CODE'
! 383: A C expression for the status code to be returned when the compiler
! 384: exits after serious errors.
! 385:
! 386: `SUCCESS_EXIT_CODE'
! 387: A C expression for the status code to be returned when the compiler
! 388: exits without serious errors.
! 389:
! 390: `HOST_WORDS_BIG_ENDIAN'
! 391: Defined if the host machine stores words of multi-word values in
! 392: big-endian order. (GNU CC does not depend on the host byte
! 393: ordering within a word.)
! 394:
! 395: `HOST_FLOAT_WORDS_BIG_ENDIAN'
! 396: Define this macro to be 1 if the host machine stores `DFmode',
! 397: `XFmode' or `TFmode' floating point numbers in memory with the
! 398: word containing the sign bit at the lowest address; otherwise,
! 399: define it to be zero.
! 400:
! 401: This macro need not be defined if the ordering is the same as for
! 402: multi-word integers.
! 403:
! 404: `HOST_FLOAT_FORMAT'
! 405: A numeric code distinguishing the floating point format for the
! 406: host machine. See `TARGET_FLOAT_FORMAT' in *Note Storage Layout::
! 407: for the alternatives and default.
! 408:
! 409: `HOST_BITS_PER_CHAR'
! 410: A C expression for the number of bits in `char' on the host
! 411: machine.
! 412:
! 413: `HOST_BITS_PER_SHORT'
! 414: A C expression for the number of bits in `short' on the host
! 415: machine.
! 416:
! 417: `HOST_BITS_PER_INT'
! 418: A C expression for the number of bits in `int' on the host machine.
! 419:
! 420: `HOST_BITS_PER_LONG'
! 421: A C expression for the number of bits in `long' on the host
! 422: machine.
! 423:
! 424: `ONLY_INT_FIELDS'
! 425: Define this macro to indicate that the host compiler only supports
! 426: `int' bit fields, rather than other integral types, including
! 427: `enum', as do most C compilers.
! 428:
! 429: `EXECUTABLE_SUFFIX'
! 430: Define this macro if the host system uses a naming convention for
! 431: executable files that involves a common suffix (such as, in some
! 432: systems, `.exe') that must be mentioned explicitly when you run
! 433: the program.
! 434:
! 435: `OBSTACK_CHUNK_SIZE'
! 436: A C expression for the size of ordinary obstack chunks. If you
! 437: don't define this, a usually-reasonable default is used.
! 438:
! 439: `OBSTACK_CHUNK_ALLOC'
! 440: The function used to allocate obstack chunks. If you don't define
! 441: this, `xmalloc' is used.
! 442:
! 443: `OBSTACK_CHUNK_FREE'
! 444: The function used to free obstack chunks. If you don't define
! 445: this, `free' is used.
! 446:
! 447: `USE_C_ALLOCA'
! 448: Define this macro to indicate that the compiler is running with the
! 449: `alloca' implemented in C. This version of `alloca' can be found
! 450: in the file `alloca.c'; to use it, you must also alter the
! 451: `Makefile' variable `ALLOCA'. (This is done automatically for the
! 452: systems on which we know it is needed.)
! 453:
! 454: If you do define this macro, you should probably do it as follows:
! 455:
! 456: #ifndef __GNUC__
! 457: #define USE_C_ALLOCA
! 458: #else
! 459: #define alloca __builtin_alloca
! 460: #endif
! 461:
! 462: so that when the compiler is compiled with GNU CC it uses the more
! 463: efficient built-in `alloca' function.
! 464:
! 465: `FUNCTION_CONVERSION_BUG'
! 466: Define this macro to indicate that the host compiler does not
! 467: properly handle converting a function value to a
! 468: pointer-to-function when it is used in an expression.
! 469:
! 470: `HAVE_VPRINTF'
! 471: Define this if the library function `vprintf' is available on your
! 472: system.
! 473:
! 474: `MULTIBYTE_CHARS'
! 475: Define this macro to enable support for multibyte characters in the
! 476: input to GNU CC. This requires that the host system support the
! 477: ANSI C library functions for converting multibyte characters to
! 478: wide characters.
! 479:
! 480: `HAVE_PUTENV'
! 481: Define this if the library function `putenv' is available on your
! 482: system.
! 483:
! 484: `NO_SYS_SIGLIST'
! 485: Define this if your system *does not* provide the variable
! 486: `sys_siglist'.
! 487:
! 488: `USE_PROTOTYPES'
! 489: Define this to be 1 if you know that the host compiler supports
! 490: prototypes, even if it doesn't define __STDC__, or define it to be
! 491: 0 if you do not want any prototypes used in compiling GNU CC. If
! 492: `USE_PROTOTYPES' is not defined, it will be determined
! 493: automatically whether your compiler supports prototypes by
! 494: checking if `__STDC__' is defined.
! 495:
! 496: `NO_MD_PROTOTYPES'
! 497: Define this if you wish suppression of prototypes generated from
! 498: the machine description file, but to use other prototypes within
! 499: GNU CC. If `USE_PROTOTYPES' is defined to be 0, or the host
! 500: compiler does not support prototypes, this macro has no effect.
! 501:
! 502: `MD_CALL_PROTOTYPES'
! 503: Define this if you wish to generate prototypes for the `gen_call'
! 504: or `gen_call_value' functions generated from the machine
! 505: description file. If `USE_PROTOTYPES' is defined to be 0, or the
! 506: host compiler does not support prototypes, or `NO_MD_PROTOTYPES'
! 507: is defined, this macro has no effect. As soon as all of the
! 508: machine descriptions are modified to have the appropriate number
! 509: of arguments, this macro will be removed.
! 510:
! 511: Some systems do provide this variable, but with a different name
! 512: such as `_sys_siglist'. On these systems, you can define
! 513: `sys_siglist' as a macro which expands into the name actually
! 514: provided.
! 515:
! 516: `NO_STAB_H'
! 517: Define this if your system does not have the include file
! 518: `stab.h'. If `USG' is defined, `NO_STAB_H' is assumed.
! 519:
! 520: In addition, configuration files for system V define `bcopy',
! 521: `bzero' and `bcmp' as aliases. Some files define `alloca' as a macro
! 522: when compiled with GNU CC, in order to take advantage of the benefit of
! 523: GNU CC's built-in `alloca'.
1.1 root 524:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.