|
|
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:
31: File: gcc.info, Node: Misc, Prev: Cross-compilation, Up: Target Macros
32:
33: Miscellaneous Parameters
34: ========================
35:
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:
45:
46: #define PREDICATE_CODES \
47: {"gen_reg_rtx_operand", {SUBREG, REG}}, \
48: {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
49:
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: `HANDLE_PRAGMA (STREAM)'
281: Define this macro if you want to implement any pragmas. If
282: defined, it should be a C statement to be executed when `#pragma'
283: is seen. The argument STREAM is the stdio input stream from which
284: the source text can be read.
285:
286: It is generally a bad idea to implement new uses of `#pragma'. The
287: only reason to define this macro is for compatibility with other
288: compilers that do support `#pragma' for the sake of any user
289: programs which already use it.
290:
291: `DOLLARS_IN_IDENTIFIERS'
292: Define this macro to control use of the character `$' in identifier
293: names. The value should be 0, 1, or 2. 0 means `$' is not allowed
294: by default; 1 means it is allowed by default if `-traditional' is
295: used; 2 means it is allowed by default provided `-ansi' is not
296: used. 1 is the default; there is no need to define this macro in
297: that case.
298:
299: `NO_DOLLAR_IN_LABEL'
300: Define this macro if the assembler does not accept the character
301: `$' in label names. By default constructors and destructors in
302: G++ have `$' in the identifiers. If this macro is defined, `.' is
303: used instead.
304:
305: `DEFAULT_MAIN_RETURN'
306: Define this macro if the target system expects every program's
307: `main' function to return a standard "success" value by default
308: (if no other value is explicitly returned).
309:
310: The definition should be a C statement (sans semicolon) to
311: generate the appropriate rtl instructions. It is used only when
312: compiling the end of `main'.
313:
314: `HAVE_ATEXIT'
315: Define this if the target system supports the function `atexit'
316: from the ANSI C standard. If this is not defined, and
317: `INIT_SECTION_ASM_OP' is not defined, a default `exit' function
318: will be provided to support C++.
319:
320: `EXIT_BODY'
321: Define this if your `exit' function needs to do something besides
322: calling an external function `_cleanup' before terminating with
323: `_exit'. The `EXIT_BODY' macro is only needed if netiher
324: `HAVE_ATEXIT' nor `INIT_SECTION_ASM_OP' are defined.
325:
326: `INSN_SETS_ARE_DELAYED (INSN)'
327: Define this macro as a C expression that is nonzero if it is safe
328: for the delay slot scheduler to place instructions in the delay
329: slot of INSN, even if they appear to use a resource set or
330: clobbered in INSN. INSN is always a `jump_insn' or an `insn'; GNU
331: CC knows that every `call_insn' has this behavior. On machines
332: where some `insn' or `jump_insn' is really a function call and
333: hence has this behavior, you should define this macro.
334:
335: You need not define this macro if it would always return zero.
336:
337: `INSN_REFERENCES_ARE_DELAYED (INSN)'
338: Define this macro as a C expression that is nonzero if it is safe
339: for the delay slot scheduler to place instructions in the delay
340: slot of INSN, even if they appear to set or clobber a resource
341: referenced in INSN. INSN is always a `jump_insn' or an `insn'.
342: On machines where some `insn' or `jump_insn' is really a function
343: call and its operands are registers whose use is actually in the
344: subroutine it calls, you should define this macro. Doing so
345: allows the delay slot scheduler to move instructions which copy
346: arguments into the argument registers into the delay slot of INSN.
347:
348: You need not define this macro if it would always return zero.
349:
350:
351: File: gcc.info, Node: Config, Next: Index, Prev: Target Macros, Up: Top
352:
353: The Configuration File
354: **********************
355:
356: The configuration file `xm-MACHINE.h' contains macro definitions
357: that describe the machine and system on which the compiler is running,
358: unlike the definitions in `MACHINE.h', which describe the machine for
359: which the compiler is producing output. Most of the values in
360: `xm-MACHINE.h' are actually the same on all machines that GNU CC runs
361: on, so large parts of all configuration files are identical. But there
362: are some macros that vary:
363:
364: `USG'
365: Define this macro if the host system is System V.
366:
367: `VMS'
368: Define this macro if the host system is VMS.
369:
370: `FAILURE_EXIT_CODE'
371: A C expression for the status code to be returned when the compiler
372: exits after serious errors.
373:
374: `SUCCESS_EXIT_CODE'
375: A C expression for the status code to be returned when the compiler
376: exits without serious errors.
377:
378: `HOST_WORDS_BIG_ENDIAN'
379: Defined if the host machine stores words of multi-word values in
380: big-endian order. (GNU CC does not depend on the host byte
381: ordering within a word.)
382:
383: `HOST_FLOAT_WORDS_BIG_ENDIAN'
384: Define this macro to be 1 if the host machine stores `DFmode',
385: `XFmode' or `TFmode' floating point numbers in memory with the
386: word containing the sign bit at the lowest address; otherwise,
387: define it to be zero.
388:
389: This macro need not be defined if the ordering is the same as for
390: multi-word integers.
391:
392: `HOST_FLOAT_FORMAT'
393: A numeric code distinguishing the floating point format for the
394: host machine. See `TARGET_FLOAT_FORMAT' in *Note Storage Layout::
395: for the alternatives and default.
396:
397: `HOST_BITS_PER_CHAR'
398: A C expression for the number of bits in `char' on the host
399: machine.
400:
401: `HOST_BITS_PER_SHORT'
402: A C expression for the number of bits in `short' on the host
403: machine.
404:
405: `HOST_BITS_PER_INT'
406: A C expression for the number of bits in `int' on the host machine.
407:
408: `HOST_BITS_PER_LONG'
409: A C expression for the number of bits in `long' on the host
410: machine.
411:
412: `ONLY_INT_FIELDS'
413: Define this macro to indicate that the host compiler only supports
414: `int' bit fields, rather than other integral types, including
415: `enum', as do most C compilers.
416:
417: `EXECUTABLE_SUFFIX'
418: Define this macro if the host system uses a naming convention for
419: executable files that involves a common suffix (such as, in some
420: systems, `.exe') that must be mentioned explicitly when you run
421: the program.
422:
423: `OBSTACK_CHUNK_SIZE'
424: A C expression for the size of ordinary obstack chunks. If you
425: don't define this, a usually-reasonable default is used.
426:
427: `OBSTACK_CHUNK_ALLOC'
428: The function used to allocate obstack chunks. If you don't define
429: this, `xmalloc' is used.
430:
431: `OBSTACK_CHUNK_FREE'
432: The function used to free obstack chunks. If you don't define
433: this, `free' is used.
434:
435: `USE_C_ALLOCA'
436: Define this macro to indicate that the compiler is running with the
437: `alloca' implemented in C. This version of `alloca' can be found
438: in the file `alloca.c'; to use it, you must also alter the
439: `Makefile' variable `ALLOCA'. (This is done automatically for the
440: systems on which we know it is needed.)
441:
442: If you do define this macro, you should probably do it as follows:
443:
444: #ifndef __GNUC__
445: #define USE_C_ALLOCA
446: #else
447: #define alloca __builtin_alloca
448: #endif
449:
450: so that when the compiler is compiled with GNU CC it uses the more
451: efficient built-in `alloca' function.
452:
453: `FUNCTION_CONVERSION_BUG'
454: Define this macro to indicate that the host compiler does not
455: properly handle converting a function value to a
456: pointer-to-function when it is used in an expression.
457:
458: `HAVE_VPRINTF'
459: Define this if the library function `vprintf' is available on your
460: system.
461:
462: `MULTIBYTE_CHARS'
463: Define this macro to enable support for multibyte characters in the
464: input to GNU CC. This requires that the host system support the
465: ANSI C library functions for converting multibyte characters to
466: wide characters.
467:
468: `HAVE_PUTENV'
469: Define this if the library function `putenv' is available on your
470: system.
471:
472: `NO_SYS_SIGLIST'
473: Define this if your system *does not* provide the variable
474: `sys_siglist'.
475:
476: `USE_PROTOTYPES'
477: Define this to be 1 if you know that the host compiler supports
478: prototypes, even if it doesn't define __STDC__, or define it to be
479: 0 if you do not want any prototypes used in compiling GNU CC. If
480: `USE_PROTOTYPES' is not defined, it will be determined
481: automatically whether your compiler supports prototypes by
482: checking if `__STDC__' is defined.
483:
484: `NO_MD_PROTOTYPES'
485: Define this if you wish suppression of prototypes generated from
486: the machine description file, but to use other prototypes within
487: GNU CC. If `USE_PROTOTYPES' is defined to be 0, or the host
488: compiler does not support prototypes, this macro has no effect.
489:
490: `MD_CALL_PROTOTYPES'
491: Define this if you wish to generate prototypes for the `gen_call'
492: or `gen_call_value' functions generated from the machine
493: description file. If `USE_PROTOTYPES' is defined to be 0, or the
494: host compiler does not support prototypes, or `NO_MD_PROTOTYPES'
495: is defined, this macro has no effect. As soon as all of the
496: machine descriptions are modified to have the appropriate number
497: of arguments, this macro will be removed.
498:
499: Some systems do provide this variable, but with a different name
500: such as `_sys_siglist'. On these systems, you can define
501: `sys_siglist' as a macro which expands into the name actually
502: provided.
503:
504: `NO_STAB_H'
505: Define this if your system does not have the include file
506: `stab.h'. If `USG' is defined, `NO_STAB_H' is assumed.
507:
508: In addition, configuration files for system V define `bcopy',
509: `bzero' and `bcmp' as aliases. Some files define `alloca' as a macro
510: when compiled with GNU CC, in order to take advantage of the benefit of
511: GNU CC's built-in `alloca'.
512:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.