1 | This is Info file gcc.info, produced by Makeinfo-1.55 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 59 Temple Place - Suite 330 |
---|
7 | Boston, MA 02111-1307 USA |
---|
8 | |
---|
9 | Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995 Free Software |
---|
10 | Foundation, Inc. |
---|
11 | |
---|
12 | Permission is granted to make and distribute verbatim copies of this |
---|
13 | manual provided the copyright notice and this permission notice are |
---|
14 | preserved on all copies. |
---|
15 | |
---|
16 | Permission is granted to copy and distribute modified versions of |
---|
17 | this manual under the conditions for verbatim copying, provided also |
---|
18 | that the sections entitled "GNU General Public License," "Funding for |
---|
19 | Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are |
---|
20 | included exactly as in the original, and provided that the entire |
---|
21 | resulting derived work is distributed under the terms of a permission |
---|
22 | notice identical to this one. |
---|
23 | |
---|
24 | Permission is granted to copy and distribute translations of this |
---|
25 | manual into another language, under the above conditions for modified |
---|
26 | versions, except that the sections entitled "GNU General Public |
---|
27 | License," "Funding for Free Software," and "Protect Your Freedom--Fight |
---|
28 | `Look And Feel'", and this permission notice, may be included in |
---|
29 | translations approved by the Free Software Foundation instead of in the |
---|
30 | original English. |
---|
31 | |
---|
32 | |
---|
33 | File: gcc.info, Node: Cross-compilation, Next: Misc, Prev: Debugging Info, Up: Target Macros |
---|
34 | |
---|
35 | Cross Compilation and Floating Point |
---|
36 | ==================================== |
---|
37 | |
---|
38 | While all modern machines use 2's complement representation for |
---|
39 | integers, there are a variety of representations for floating point |
---|
40 | numbers. This means that in a cross-compiler the representation of |
---|
41 | floating point numbers in the compiled program may be different from |
---|
42 | that used in the machine doing the compilation. |
---|
43 | |
---|
44 | Because different representation systems may offer different amounts |
---|
45 | of range and precision, the cross compiler cannot safely use the host |
---|
46 | machine's floating point arithmetic. Therefore, floating point |
---|
47 | constants must be represented in the target machine's format. This |
---|
48 | means that the cross compiler cannot use `atof' to parse a floating |
---|
49 | point constant; it must have its own special routine to use instead. |
---|
50 | Also, constant folding must emulate the target machine's arithmetic (or |
---|
51 | must not be done at all). |
---|
52 | |
---|
53 | The macros in the following table should be defined only if you are |
---|
54 | cross compiling between different floating point formats. |
---|
55 | |
---|
56 | Otherwise, don't define them. Then default definitions will be set |
---|
57 | up which use `double' as the data type, `==' to test for equality, etc. |
---|
58 | |
---|
59 | You don't need to worry about how many times you use an operand of |
---|
60 | any of these macros. The compiler never uses operands which have side |
---|
61 | effects. |
---|
62 | |
---|
63 | `REAL_VALUE_TYPE' |
---|
64 | A macro for the C data type to be used to hold a floating point |
---|
65 | value in the target machine's format. Typically this would be a |
---|
66 | `struct' containing an array of `int'. |
---|
67 | |
---|
68 | `REAL_VALUES_EQUAL (X, Y)' |
---|
69 | A macro for a C expression which compares for equality the two |
---|
70 | values, X and Y, both of type `REAL_VALUE_TYPE'. |
---|
71 | |
---|
72 | `REAL_VALUES_LESS (X, Y)' |
---|
73 | A macro for a C expression which tests whether X is less than Y, |
---|
74 | both values being of type `REAL_VALUE_TYPE' and interpreted as |
---|
75 | floating point numbers in the target machine's representation. |
---|
76 | |
---|
77 | `REAL_VALUE_LDEXP (X, SCALE)' |
---|
78 | A macro for a C expression which performs the standard library |
---|
79 | function `ldexp', but using the target machine's floating point |
---|
80 | representation. Both X and the value of the expression have type |
---|
81 | `REAL_VALUE_TYPE'. The second argument, SCALE, is an integer. |
---|
82 | |
---|
83 | `REAL_VALUE_FIX (X)' |
---|
84 | A macro whose definition is a C expression to convert the |
---|
85 | target-machine floating point value X to a signed integer. X has |
---|
86 | type `REAL_VALUE_TYPE'. |
---|
87 | |
---|
88 | `REAL_VALUE_UNSIGNED_FIX (X)' |
---|
89 | A macro whose definition is a C expression to convert the |
---|
90 | target-machine floating point value X to an unsigned integer. X |
---|
91 | has type `REAL_VALUE_TYPE'. |
---|
92 | |
---|
93 | `REAL_VALUE_RNDZINT (X)' |
---|
94 | A macro whose definition is a C expression to round the |
---|
95 | target-machine floating point value X towards zero to an integer |
---|
96 | value (but still as a floating point number). X has type |
---|
97 | `REAL_VALUE_TYPE', and so does the value. |
---|
98 | |
---|
99 | `REAL_VALUE_UNSIGNED_RNDZINT (X)' |
---|
100 | A macro whose definition is a C expression to round the |
---|
101 | target-machine floating point value X towards zero to an unsigned |
---|
102 | integer value (but still represented as a floating point number). |
---|
103 | x has type `REAL_VALUE_TYPE', and so does the value. |
---|
104 | |
---|
105 | `REAL_VALUE_ATOF (STRING, MODE)' |
---|
106 | A macro for a C expression which converts STRING, an expression of |
---|
107 | type `char *', into a floating point number in the target machine's |
---|
108 | representation for mode MODE. The value has type |
---|
109 | `REAL_VALUE_TYPE'. |
---|
110 | |
---|
111 | `REAL_INFINITY' |
---|
112 | Define this macro if infinity is a possible floating point value, |
---|
113 | and therefore division by 0 is legitimate. |
---|
114 | |
---|
115 | `REAL_VALUE_ISINF (X)' |
---|
116 | A macro for a C expression which determines whether X, a floating |
---|
117 | point value, is infinity. The value has type `int'. By default, |
---|
118 | this is defined to call `isinf'. |
---|
119 | |
---|
120 | `REAL_VALUE_ISNAN (X)' |
---|
121 | A macro for a C expression which determines whether X, a floating |
---|
122 | point value, is a "nan" (not-a-number). The value has type `int'. |
---|
123 | By default, this is defined to call `isnan'. |
---|
124 | |
---|
125 | Define the following additional macros if you want to make floating |
---|
126 | point constant folding work while cross compiling. If you don't define |
---|
127 | them, cross compilation is still possible, but constant folding will |
---|
128 | not happen for floating point values. |
---|
129 | |
---|
130 | `REAL_ARITHMETIC (OUTPUT, CODE, X, Y)' |
---|
131 | A macro for a C statement which calculates an arithmetic operation |
---|
132 | of the two floating point values X and Y, both of type |
---|
133 | `REAL_VALUE_TYPE' in the target machine's representation, to |
---|
134 | produce a result of the same type and representation which is |
---|
135 | stored in OUTPUT (which will be a variable). |
---|
136 | |
---|
137 | The operation to be performed is specified by CODE, a tree code |
---|
138 | which will always be one of the following: `PLUS_EXPR', |
---|
139 | `MINUS_EXPR', `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'. |
---|
140 | |
---|
141 | The expansion of this macro is responsible for checking for |
---|
142 | overflow. If overflow happens, the macro expansion should execute |
---|
143 | the statement `return 0;', which indicates the inability to |
---|
144 | perform the arithmetic operation requested. |
---|
145 | |
---|
146 | `REAL_VALUE_NEGATE (X)' |
---|
147 | A macro for a C expression which returns the negative of the |
---|
148 | floating point value X. Both X and the value of the expression |
---|
149 | have type `REAL_VALUE_TYPE' and are in the target machine's |
---|
150 | floating point representation. |
---|
151 | |
---|
152 | There is no way for this macro to report overflow, since overflow |
---|
153 | can't happen in the negation operation. |
---|
154 | |
---|
155 | `REAL_VALUE_TRUNCATE (MODE, X)' |
---|
156 | A macro for a C expression which converts the floating point value |
---|
157 | X to mode MODE. |
---|
158 | |
---|
159 | Both X and the value of the expression are in the target machine's |
---|
160 | floating point representation and have type `REAL_VALUE_TYPE'. |
---|
161 | However, the value should have an appropriate bit pattern to be |
---|
162 | output properly as a floating constant whose precision accords |
---|
163 | with mode MODE. |
---|
164 | |
---|
165 | There is no way for this macro to report overflow. |
---|
166 | |
---|
167 | `REAL_VALUE_TO_INT (LOW, HIGH, X)' |
---|
168 | A macro for a C expression which converts a floating point value X |
---|
169 | into a double-precision integer which is then stored into LOW and |
---|
170 | HIGH, two variables of type INT. |
---|
171 | |
---|
172 | `REAL_VALUE_FROM_INT (X, LOW, HIGH)' |
---|
173 | A macro for a C expression which converts a double-precision |
---|
174 | integer found in LOW and HIGH, two variables of type INT, into a |
---|
175 | floating point value which is then stored into X. |
---|
176 | |
---|
177 | |
---|
178 | File: gcc.info, Node: Misc, Prev: Cross-compilation, Up: Target Macros |
---|
179 | |
---|
180 | Miscellaneous Parameters |
---|
181 | ======================== |
---|
182 | |
---|
183 | Here are several miscellaneous parameters. |
---|
184 | |
---|
185 | `PREDICATE_CODES' |
---|
186 | Define this if you have defined special-purpose predicates in the |
---|
187 | file `MACHINE.c'. This macro is called within an initializer of an |
---|
188 | array of structures. The first field in the structure is the name |
---|
189 | of a predicate and the second field is an array of rtl codes. For |
---|
190 | each predicate, list all rtl codes that can be in expressions |
---|
191 | matched by the predicate. The list should have a trailing comma. |
---|
192 | Here is an example of two entries in the list for a typical RISC |
---|
193 | machine: |
---|
194 | |
---|
195 | #define PREDICATE_CODES \ |
---|
196 | {"gen_reg_rtx_operand", {SUBREG, REG}}, \ |
---|
197 | {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}}, |
---|
198 | |
---|
199 | Defining this macro does not affect the generated code (however, |
---|
200 | incorrect definitions that omit an rtl code that may be matched by |
---|
201 | the predicate can cause the compiler to malfunction). Instead, it |
---|
202 | allows the table built by `genrecog' to be more compact and |
---|
203 | efficient, thus speeding up the compiler. The most important |
---|
204 | predicates to include in the list specified by this macro are |
---|
205 | thoses used in the most insn patterns. |
---|
206 | |
---|
207 | `CASE_VECTOR_MODE' |
---|
208 | An alias for a machine mode name. This is the machine mode that |
---|
209 | elements of a jump-table should have. |
---|
210 | |
---|
211 | `CASE_VECTOR_PC_RELATIVE' |
---|
212 | Define this macro if jump-tables should contain relative addresses. |
---|
213 | |
---|
214 | `CASE_DROPS_THROUGH' |
---|
215 | Define this if control falls through a `case' insn when the index |
---|
216 | value is out of range. This means the specified default-label is |
---|
217 | actually ignored by the `case' insn proper. |
---|
218 | |
---|
219 | `CASE_VALUES_THRESHOLD' |
---|
220 | Define this to be the smallest number of different values for |
---|
221 | which it is best to use a jump-table instead of a tree of |
---|
222 | conditional branches. The default is four for machines with a |
---|
223 | `casesi' instruction and five otherwise. This is best for most |
---|
224 | machines. |
---|
225 | |
---|
226 | `WORD_REGISTER_OPERATIONS' |
---|
227 | Define this macro if operations between registers with integral |
---|
228 | mode smaller than a word are always performed on the entire |
---|
229 | register. Most RISC machines have this property and most CISC |
---|
230 | machines do not. |
---|
231 | |
---|
232 | `LOAD_EXTEND_OP (MODE)' |
---|
233 | Define this macro to be a C expression indicating when insns that |
---|
234 | read memory in MODE, an integral mode narrower than a word, set the |
---|
235 | bits outside of MODE to be either the sign-extension or the |
---|
236 | zero-extension of the data read. Return `SIGN_EXTEND' for values |
---|
237 | of MODE for which the insn sign-extends, `ZERO_EXTEND' for which |
---|
238 | it zero-extends, and `NIL' for other modes. |
---|
239 | |
---|
240 | This macro is not called with MODE non-integral or with a width |
---|
241 | greater than or equal to `BITS_PER_WORD', so you may return any |
---|
242 | value in this case. Do not define this macro if it would always |
---|
243 | return `NIL'. On machines where this macro is defined, you will |
---|
244 | normally define it as the constant `SIGN_EXTEND' or `ZERO_EXTEND'. |
---|
245 | |
---|
246 | `IMPLICIT_FIX_EXPR' |
---|
247 | An alias for a tree code that should be used by default for |
---|
248 | conversion of floating point values to fixed point. Normally, |
---|
249 | `FIX_ROUND_EXPR' is used. |
---|
250 | |
---|
251 | `FIXUNS_TRUNC_LIKE_FIX_TRUNC' |
---|
252 | Define this macro if the same instructions that convert a floating |
---|
253 | point number to a signed fixed point number also convert validly |
---|
254 | to an unsigned one. |
---|
255 | |
---|
256 | `EASY_DIV_EXPR' |
---|
257 | An alias for a tree code that is the easiest kind of division to |
---|
258 | compile code for in the general case. It may be `TRUNC_DIV_EXPR', |
---|
259 | `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'. These four |
---|
260 | division operators differ in how they round the result to an |
---|
261 | integer. `EASY_DIV_EXPR' is used when it is permissible to use |
---|
262 | any of those kinds of division and the choice should be made on |
---|
263 | the basis of efficiency. |
---|
264 | |
---|
265 | `MOVE_MAX' |
---|
266 | The maximum number of bytes that a single instruction can move |
---|
267 | quickly from memory to memory. |
---|
268 | |
---|
269 | `MAX_MOVE_MAX' |
---|
270 | The maximum number of bytes that a single instruction can move |
---|
271 | quickly from memory to memory. If this is undefined, the default |
---|
272 | is `MOVE_MAX'. Otherwise, it is the constant value that is the |
---|
273 | largest value that `MOVE_MAX' can have at run-time. |
---|
274 | |
---|
275 | `SHIFT_COUNT_TRUNCATED' |
---|
276 | A C expression that is nonzero if on this machine the number of |
---|
277 | bits actually used for the count of a shift operation is equal to |
---|
278 | the number of bits needed to represent the size of the object |
---|
279 | being shifted. When this macro is non-zero, the compiler will |
---|
280 | assume that it is safe to omit a sign-extend, zero-extend, and |
---|
281 | certain bitwise `and' instructions that truncates the count of a |
---|
282 | shift operation. On machines that have instructions that act on |
---|
283 | bitfields at variable positions, which may include `bit test' |
---|
284 | instructions, a nonzero `SHIFT_COUNT_TRUNCATED' also enables |
---|
285 | deletion of truncations of the values that serve as arguments to |
---|
286 | bitfield instructions. |
---|
287 | |
---|
288 | If both types of instructions truncate the count (for shifts) and |
---|
289 | position (for bitfield operations), or if no variable-position |
---|
290 | bitfield instructions exist, you should define this macro. |
---|
291 | |
---|
292 | However, on some machines, such as the 80386 and the 680x0, |
---|
293 | truncation only applies to shift operations and not the (real or |
---|
294 | pretended) bitfield operations. Define `SHIFT_COUNT_TRUNCATED' to |
---|
295 | be zero on such machines. Instead, add patterns to the `md' file |
---|
296 | that include the implied truncation of the shift instructions. |
---|
297 | |
---|
298 | You need not define this macro if it would always have the value |
---|
299 | of zero. |
---|
300 | |
---|
301 | `TRULY_NOOP_TRUNCATION (OUTPREC, INPREC)' |
---|
302 | A C expression which is nonzero if on this machine it is safe to |
---|
303 | "convert" an integer of INPREC bits to one of OUTPREC bits (where |
---|
304 | OUTPREC is smaller than INPREC) by merely operating on it as if it |
---|
305 | had only OUTPREC bits. |
---|
306 | |
---|
307 | On many machines, this expression can be 1. |
---|
308 | |
---|
309 | When `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for |
---|
310 | modes for which `MODES_TIEABLE_P' is 0, suboptimal code can result. |
---|
311 | If this is the case, making `TRULY_NOOP_TRUNCATION' return 0 in |
---|
312 | such cases may improve things. |
---|
313 | |
---|
314 | `STORE_FLAG_VALUE' |
---|
315 | A C expression describing the value returned by a comparison |
---|
316 | operator with an integral mode and stored by a store-flag |
---|
317 | instruction (`sCOND') when the condition is true. This |
---|
318 | description must apply to *all* the `sCOND' patterns and all the |
---|
319 | comparison operators whose results have a `MODE_INT' mode. |
---|
320 | |
---|
321 | A value of 1 or -1 means that the instruction implementing the |
---|
322 | comparison operator returns exactly 1 or -1 when the comparison is |
---|
323 | true and 0 when the comparison is false. Otherwise, the value |
---|
324 | indicates which bits of the result are guaranteed to be 1 when the |
---|
325 | comparison is true. This value is interpreted in the mode of the |
---|
326 | comparison operation, which is given by the mode of the first |
---|
327 | operand in the `sCOND' pattern. Either the low bit or the sign |
---|
328 | bit of `STORE_FLAG_VALUE' be on. Presently, only those bits are |
---|
329 | used by the compiler. |
---|
330 | |
---|
331 | If `STORE_FLAG_VALUE' is neither 1 or -1, the compiler will |
---|
332 | generate code that depends only on the specified bits. It can also |
---|
333 | replace comparison operators with equivalent operations if they |
---|
334 | cause the required bits to be set, even if the remaining bits are |
---|
335 | undefined. For example, on a machine whose comparison operators |
---|
336 | return an `SImode' value and where `STORE_FLAG_VALUE' is defined as |
---|
337 | `0x80000000', saying that just the sign bit is relevant, the |
---|
338 | expression |
---|
339 | |
---|
340 | (ne:SI (and:SI X (const_int POWER-OF-2)) (const_int 0)) |
---|
341 | |
---|
342 | can be converted to |
---|
343 | |
---|
344 | (ashift:SI X (const_int N)) |
---|
345 | |
---|
346 | where N is the appropriate shift count to move the bit being |
---|
347 | tested into the sign bit. |
---|
348 | |
---|
349 | There is no way to describe a machine that always sets the |
---|
350 | low-order bit for a true value, but does not guarantee the value |
---|
351 | of any other bits, but we do not know of any machine that has such |
---|
352 | an instruction. If you are trying to port GNU CC to such a |
---|
353 | machine, include an instruction to perform a logical-and of the |
---|
354 | result with 1 in the pattern for the comparison operators and let |
---|
355 | us know (*note How to Report Bugs: Bug Reporting.). |
---|
356 | |
---|
357 | Often, a machine will have multiple instructions that obtain a |
---|
358 | value from a comparison (or the condition codes). Here are rules |
---|
359 | to guide the choice of value for `STORE_FLAG_VALUE', and hence the |
---|
360 | instructions to be used: |
---|
361 | |
---|
362 | * Use the shortest sequence that yields a valid definition for |
---|
363 | `STORE_FLAG_VALUE'. It is more efficient for the compiler to |
---|
364 | "normalize" the value (convert it to, e.g., 1 or 0) than for |
---|
365 | the comparison operators to do so because there may be |
---|
366 | opportunities to combine the normalization with other |
---|
367 | operations. |
---|
368 | |
---|
369 | * For equal-length sequences, use a value of 1 or -1, with -1 |
---|
370 | being slightly preferred on machines with expensive jumps and |
---|
371 | 1 preferred on other machines. |
---|
372 | |
---|
373 | * As a second choice, choose a value of `0x80000001' if |
---|
374 | instructions exist that set both the sign and low-order bits |
---|
375 | but do not define the others. |
---|
376 | |
---|
377 | * Otherwise, use a value of `0x80000000'. |
---|
378 | |
---|
379 | Many machines can produce both the value chosen for |
---|
380 | `STORE_FLAG_VALUE' and its negation in the same number of |
---|
381 | instructions. On those machines, you should also define a pattern |
---|
382 | for those cases, e.g., one matching |
---|
383 | |
---|
384 | (set A (neg:M (ne:M B C))) |
---|
385 | |
---|
386 | Some machines can also perform `and' or `plus' operations on |
---|
387 | condition code values with less instructions than the corresponding |
---|
388 | `sCOND' insn followed by `and' or `plus'. On those machines, |
---|
389 | define the appropriate patterns. Use the names `incscc' and |
---|
390 | `decscc', respectively, for the the patterns which perform `plus' |
---|
391 | or `minus' operations on condition code values. See `rs6000.md' |
---|
392 | for some examples. The GNU Superoptizer can be used to find such |
---|
393 | instruction sequences on other machines. |
---|
394 | |
---|
395 | You need not define `STORE_FLAG_VALUE' if the machine has no |
---|
396 | store-flag instructions. |
---|
397 | |
---|
398 | `FLOAT_STORE_FLAG_VALUE' |
---|
399 | A C expression that gives a non-zero floating point value that is |
---|
400 | returned when comparison operators with floating-point results are |
---|
401 | true. Define this macro on machine that have comparison |
---|
402 | operations that return floating-point values. If there are no |
---|
403 | such operations, do not define this macro. |
---|
404 | |
---|
405 | `Pmode' |
---|
406 | An alias for the machine mode for pointers. On most machines, |
---|
407 | define this to be the integer mode corresponding to the width of a |
---|
408 | hardware pointer; `SImode' on 32-bit machine or `DImode' on 64-bit |
---|
409 | machines. On some machines you must define this to be one of the |
---|
410 | partial integer modes, such as `PSImode'. |
---|
411 | |
---|
412 | The width of `Pmode' must be at least as large as the value of |
---|
413 | `POINTER_SIZE'. If it is not equal, you must define the macro |
---|
414 | `POINTERS_EXTEND_UNSIGNED' to specify how pointers are extended to |
---|
415 | `Pmode'. |
---|
416 | |
---|
417 | `FUNCTION_MODE' |
---|
418 | An alias for the machine mode used for memory references to |
---|
419 | functions being called, in `call' RTL expressions. On most |
---|
420 | machines this should be `QImode'. |
---|
421 | |
---|
422 | `INTEGRATE_THRESHOLD (DECL)' |
---|
423 | A C expression for the maximum number of instructions above which |
---|
424 | the function DECL should not be inlined. DECL is a |
---|
425 | `FUNCTION_DECL' node. |
---|
426 | |
---|
427 | The default definition of this macro is 64 plus 8 times the number |
---|
428 | of arguments that the function accepts. Some people think a larger |
---|
429 | threshold should be used on RISC machines. |
---|
430 | |
---|
431 | `SCCS_DIRECTIVE' |
---|
432 | Define this if the preprocessor should ignore `#sccs' directives |
---|
433 | and print no error message. |
---|
434 | |
---|
435 | `NO_IMPLICIT_EXTERN_C' |
---|
436 | Define this macro if the system header files support C++ as well |
---|
437 | as C. This macro inhibits the usual method of using system header |
---|
438 | files in C++, which is to pretend that the file's contents are |
---|
439 | enclosed in `extern "C" {...}'. |
---|
440 | |
---|
441 | `HANDLE_PRAGMA (STREAM)' |
---|
442 | Define this macro if you want to implement any pragmas. If |
---|
443 | defined, it should be a C statement to be executed when `#pragma' |
---|
444 | is seen. The argument STREAM is the stdio input stream from which |
---|
445 | the source text can be read. |
---|
446 | |
---|
447 | It is generally a bad idea to implement new uses of `#pragma'. The |
---|
448 | only reason to define this macro is for compatibility with other |
---|
449 | compilers that do support `#pragma' for the sake of any user |
---|
450 | programs which already use it. |
---|
451 | |
---|
452 | `VALID_MACHINE_DECL_ATTRIBUTE (DECL, ATTRIBUTES, IDENTIFIER, ARGS)' |
---|
453 | If defined, a C expression whose value is nonzero if IDENTIFIER |
---|
454 | with arguments ARGS is a valid machine specific attribute for DECL. |
---|
455 | The attributes in ATTRIBUTES have previously been assigned to DECL. |
---|
456 | |
---|
457 | `VALID_MACHINE_TYPE_ATTRIBUTE (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)' |
---|
458 | If defined, a C expression whose value is nonzero if IDENTIFIER |
---|
459 | with arguments ARGS is a valid machine specific attribute for TYPE. |
---|
460 | The attributes in ATTRIBUTES have previously been assigned to TYPE. |
---|
461 | |
---|
462 | `COMP_TYPE_ATTRIBUTES (TYPE1, TYPE2)' |
---|
463 | If defined, a C expression whose value is zero if the attributes on |
---|
464 | TYPE1 and TYPE2 are incompatible, one if they are compatible, and |
---|
465 | two if they are nearly compatible (which causes a warning to be |
---|
466 | generated). |
---|
467 | |
---|
468 | `SET_DEFAULT_TYPE_ATTRIBUTES (TYPE)' |
---|
469 | If defined, a C statement that assigns default attributes to newly |
---|
470 | defined TYPE. |
---|
471 | |
---|
472 | `DOLLARS_IN_IDENTIFIERS' |
---|
473 | Define this macro to control use of the character `$' in identifier |
---|
474 | names. The value should be 0, 1, or 2. 0 means `$' is not allowed |
---|
475 | by default; 1 means it is allowed by default if `-traditional' is |
---|
476 | used; 2 means it is allowed by default provided `-ansi' is not |
---|
477 | used. 1 is the default; there is no need to define this macro in |
---|
478 | that case. |
---|
479 | |
---|
480 | `NO_DOLLAR_IN_LABEL' |
---|
481 | Define this macro if the assembler does not accept the character |
---|
482 | `$' in label names. By default constructors and destructors in |
---|
483 | G++ have `$' in the identifiers. If this macro is defined, `.' is |
---|
484 | used instead. |
---|
485 | |
---|
486 | `NO_DOT_IN_LABEL' |
---|
487 | Define this macro if the assembler does not accept the character |
---|
488 | `.' in label names. By default constructors and destructors in G++ |
---|
489 | have names that use `.'. If this macro is defined, these names |
---|
490 | are rewritten to avoid `.'. |
---|
491 | |
---|
492 | `DEFAULT_MAIN_RETURN' |
---|
493 | Define this macro if the target system expects every program's |
---|
494 | `main' function to return a standard "success" value by default |
---|
495 | (if no other value is explicitly returned). |
---|
496 | |
---|
497 | The definition should be a C statement (sans semicolon) to |
---|
498 | generate the appropriate rtl instructions. It is used only when |
---|
499 | compiling the end of `main'. |
---|
500 | |
---|
501 | `HAVE_ATEXIT' |
---|
502 | Define this if the target system supports the function `atexit' |
---|
503 | from the ANSI C standard. If this is not defined, and |
---|
504 | `INIT_SECTION_ASM_OP' is not defined, a default `exit' function |
---|
505 | will be provided to support C++. |
---|
506 | |
---|
507 | `EXIT_BODY' |
---|
508 | Define this if your `exit' function needs to do something besides |
---|
509 | calling an external function `_cleanup' before terminating with |
---|
510 | `_exit'. The `EXIT_BODY' macro is only needed if netiher |
---|
511 | `HAVE_ATEXIT' nor `INIT_SECTION_ASM_OP' are defined. |
---|
512 | |
---|
513 | `INSN_SETS_ARE_DELAYED (INSN)' |
---|
514 | Define this macro as a C expression that is nonzero if it is safe |
---|
515 | for the delay slot scheduler to place instructions in the delay |
---|
516 | slot of INSN, even if they appear to use a resource set or |
---|
517 | clobbered in INSN. INSN is always a `jump_insn' or an `insn'; GNU |
---|
518 | CC knows that every `call_insn' has this behavior. On machines |
---|
519 | where some `insn' or `jump_insn' is really a function call and |
---|
520 | hence has this behavior, you should define this macro. |
---|
521 | |
---|
522 | You need not define this macro if it would always return zero. |
---|
523 | |
---|
524 | `INSN_REFERENCES_ARE_DELAYED (INSN)' |
---|
525 | Define this macro as a C expression that is nonzero if it is safe |
---|
526 | for the delay slot scheduler to place instructions in the delay |
---|
527 | slot of INSN, even if they appear to set or clobber a resource |
---|
528 | referenced in INSN. INSN is always a `jump_insn' or an `insn'. |
---|
529 | On machines where some `insn' or `jump_insn' is really a function |
---|
530 | call and its operands are registers whose use is actually in the |
---|
531 | subroutine it calls, you should define this macro. Doing so |
---|
532 | allows the delay slot scheduler to move instructions which copy |
---|
533 | arguments into the argument registers into the delay slot of INSN. |
---|
534 | |
---|
535 | You need not define this macro if it would always return zero. |
---|
536 | |
---|
537 | `MACHINE_DEPENDENT_REORG (INSN)' |
---|
538 | In rare cases, correct code generation requires extra machine |
---|
539 | dependent processing between the second jump optimization pass and |
---|
540 | delayed branch scheduling. On those machines, define this macro |
---|
541 | as a C statement to act on the code starting at INSN. |
---|
542 | |
---|
543 | |
---|
544 | File: gcc.info, Node: Config, Next: Fragments, Prev: Target Macros, Up: Top |
---|
545 | |
---|
546 | The Configuration File |
---|
547 | ********************** |
---|
548 | |
---|
549 | The configuration file `xm-MACHINE.h' contains macro definitions |
---|
550 | that describe the machine and system on which the compiler is running, |
---|
551 | unlike the definitions in `MACHINE.h', which describe the machine for |
---|
552 | which the compiler is producing output. Most of the values in |
---|
553 | `xm-MACHINE.h' are actually the same on all machines that GNU CC runs |
---|
554 | on, so large parts of all configuration files are identical. But there |
---|
555 | are some macros that vary: |
---|
556 | |
---|
557 | `USG' |
---|
558 | Define this macro if the host system is System V. |
---|
559 | |
---|
560 | `VMS' |
---|
561 | Define this macro if the host system is VMS. |
---|
562 | |
---|
563 | `FATAL_EXIT_CODE' |
---|
564 | A C expression for the status code to be returned when the compiler |
---|
565 | exits after serious errors. |
---|
566 | |
---|
567 | `SUCCESS_EXIT_CODE' |
---|
568 | A C expression for the status code to be returned when the compiler |
---|
569 | exits without serious errors. |
---|
570 | |
---|
571 | `HOST_WORDS_BIG_ENDIAN' |
---|
572 | Defined if the host machine stores words of multi-word values in |
---|
573 | big-endian order. (GNU CC does not depend on the host byte |
---|
574 | ordering within a word.) |
---|
575 | |
---|
576 | `HOST_FLOAT_WORDS_BIG_ENDIAN' |
---|
577 | Define this macro to be 1 if the host machine stores `DFmode', |
---|
578 | `XFmode' or `TFmode' floating point numbers in memory with the |
---|
579 | word containing the sign bit at the lowest address; otherwise, |
---|
580 | define it to be zero. |
---|
581 | |
---|
582 | This macro need not be defined if the ordering is the same as for |
---|
583 | multi-word integers. |
---|
584 | |
---|
585 | `HOST_FLOAT_FORMAT' |
---|
586 | A numeric code distinguishing the floating point format for the |
---|
587 | host machine. See `TARGET_FLOAT_FORMAT' in *Note Storage Layout:: |
---|
588 | for the alternatives and default. |
---|
589 | |
---|
590 | `HOST_BITS_PER_CHAR' |
---|
591 | A C expression for the number of bits in `char' on the host |
---|
592 | machine. |
---|
593 | |
---|
594 | `HOST_BITS_PER_SHORT' |
---|
595 | A C expression for the number of bits in `short' on the host |
---|
596 | machine. |
---|
597 | |
---|
598 | `HOST_BITS_PER_INT' |
---|
599 | A C expression for the number of bits in `int' on the host machine. |
---|
600 | |
---|
601 | `HOST_BITS_PER_LONG' |
---|
602 | A C expression for the number of bits in `long' on the host |
---|
603 | machine. |
---|
604 | |
---|
605 | `ONLY_INT_FIELDS' |
---|
606 | Define this macro to indicate that the host compiler only supports |
---|
607 | `int' bit fields, rather than other integral types, including |
---|
608 | `enum', as do most C compilers. |
---|
609 | |
---|
610 | `OBSTACK_CHUNK_SIZE' |
---|
611 | A C expression for the size of ordinary obstack chunks. If you |
---|
612 | don't define this, a usually-reasonable default is used. |
---|
613 | |
---|
614 | `OBSTACK_CHUNK_ALLOC' |
---|
615 | The function used to allocate obstack chunks. If you don't define |
---|
616 | this, `xmalloc' is used. |
---|
617 | |
---|
618 | `OBSTACK_CHUNK_FREE' |
---|
619 | The function used to free obstack chunks. If you don't define |
---|
620 | this, `free' is used. |
---|
621 | |
---|
622 | `USE_C_ALLOCA' |
---|
623 | Define this macro to indicate that the compiler is running with the |
---|
624 | `alloca' implemented in C. This version of `alloca' can be found |
---|
625 | in the file `alloca.c'; to use it, you must also alter the |
---|
626 | `Makefile' variable `ALLOCA'. (This is done automatically for the |
---|
627 | systems on which we know it is needed.) |
---|
628 | |
---|
629 | If you do define this macro, you should probably do it as follows: |
---|
630 | |
---|
631 | #ifndef __GNUC__ |
---|
632 | #define USE_C_ALLOCA |
---|
633 | #else |
---|
634 | #define alloca __builtin_alloca |
---|
635 | #endif |
---|
636 | |
---|
637 | so that when the compiler is compiled with GNU CC it uses the more |
---|
638 | efficient built-in `alloca' function. |
---|
639 | |
---|
640 | `FUNCTION_CONVERSION_BUG' |
---|
641 | Define this macro to indicate that the host compiler does not |
---|
642 | properly handle converting a function value to a |
---|
643 | pointer-to-function when it is used in an expression. |
---|
644 | |
---|
645 | `HAVE_VPRINTF' |
---|
646 | Define this if the library function `vprintf' is available on your |
---|
647 | system. |
---|
648 | |
---|
649 | `MULTIBYTE_CHARS' |
---|
650 | Define this macro to enable support for multibyte characters in the |
---|
651 | input to GNU CC. This requires that the host system support the |
---|
652 | ANSI C library functions for converting multibyte characters to |
---|
653 | wide characters. |
---|
654 | |
---|
655 | `HAVE_PUTENV' |
---|
656 | Define this if the library function `putenv' is available on your |
---|
657 | system. |
---|
658 | |
---|
659 | `POSIX' |
---|
660 | Define this if your system is POSIX.1 compliant. |
---|
661 | |
---|
662 | `NO_SYS_SIGLIST' |
---|
663 | Define this if your system *does not* provide the variable |
---|
664 | `sys_siglist'. |
---|
665 | |
---|
666 | `DONT_DECLARE_SYS_SIGLIST' |
---|
667 | Define this if your system has the variable `sys_siglist', and |
---|
668 | there is already a declaration of it in the system header files. |
---|
669 | |
---|
670 | `USE_PROTOTYPES' |
---|
671 | Define this to be 1 if you know that the host compiler supports |
---|
672 | prototypes, even if it doesn't define __STDC__, or define it to be |
---|
673 | 0 if you do not want any prototypes used in compiling GNU CC. If |
---|
674 | `USE_PROTOTYPES' is not defined, it will be determined |
---|
675 | automatically whether your compiler supports prototypes by |
---|
676 | checking if `__STDC__' is defined. |
---|
677 | |
---|
678 | `NO_MD_PROTOTYPES' |
---|
679 | Define this if you wish suppression of prototypes generated from |
---|
680 | the machine description file, but to use other prototypes within |
---|
681 | GNU CC. If `USE_PROTOTYPES' is defined to be 0, or the host |
---|
682 | compiler does not support prototypes, this macro has no effect. |
---|
683 | |
---|
684 | `MD_CALL_PROTOTYPES' |
---|
685 | Define this if you wish to generate prototypes for the `gen_call' |
---|
686 | or `gen_call_value' functions generated from the machine |
---|
687 | description file. If `USE_PROTOTYPES' is defined to be 0, or the |
---|
688 | host compiler does not support prototypes, or `NO_MD_PROTOTYPES' |
---|
689 | is defined, this macro has no effect. As soon as all of the |
---|
690 | machine descriptions are modified to have the appropriate number |
---|
691 | of arguments, this macro will be removed. |
---|
692 | |
---|
693 | Some systems do provide this variable, but with a different name |
---|
694 | such as `_sys_siglist'. On these systems, you can define |
---|
695 | `sys_siglist' as a macro which expands into the name actually |
---|
696 | provided. |
---|
697 | |
---|
698 | `NO_STAB_H' |
---|
699 | Define this if your system does not have the include file |
---|
700 | `stab.h'. If `USG' is defined, `NO_STAB_H' is assumed. |
---|
701 | |
---|
702 | `PATH_SEPARATOR' |
---|
703 | Define this macro to be a C character constant representing the |
---|
704 | character used to separate components in paths. The default value |
---|
705 | is. the colon character |
---|
706 | |
---|
707 | `DIR_SEPARATOR' |
---|
708 | If your system uses some character other than slash to separate |
---|
709 | directory names within a file specification, define this macro to |
---|
710 | be a C character constant specifying that character. When GNU CC |
---|
711 | displays file names, the character you specify will be used. GNU |
---|
712 | CC will test for both slash and the character you specify when |
---|
713 | parsing filenames. |
---|
714 | |
---|
715 | `OBJECT_SUFFIX' |
---|
716 | Define this macro to be a C string representing the suffix for |
---|
717 | object files on your machine. If you do not define this macro, |
---|
718 | GNU CC will use `.o' as the suffix for object files. |
---|
719 | |
---|
720 | `EXECUTABLE_SUFFIX' |
---|
721 | Define this macro to be a C string representing the suffix for |
---|
722 | executable files on your machine. If you do not define this |
---|
723 | macro, GNU CC will use the null string as the suffix for object |
---|
724 | files. |
---|
725 | |
---|
726 | `COLLECT_EXPORT_LIST' |
---|
727 | If defined, `collect2' will scan the individual object files |
---|
728 | specified on its command line and create an export list for the |
---|
729 | linker. Define this macro for systems like AIX, where the linker |
---|
730 | discards object files that are not referenced from `main' and uses |
---|
731 | export lists. |
---|
732 | |
---|
733 | In addition, configuration files for system V define `bcopy', |
---|
734 | `bzero' and `bcmp' as aliases. Some files define `alloca' as a macro |
---|
735 | when compiled with GNU CC, in order to take advantage of the benefit of |
---|
736 | GNU CC's built-in `alloca'. |
---|
737 | |
---|
738 | |
---|
739 | File: gcc.info, Node: Fragments, Next: Index, Prev: Config, Up: Top |
---|
740 | |
---|
741 | Makefile Fragments |
---|
742 | ****************** |
---|
743 | |
---|
744 | When you configure GNU CC using the `configure' script (*note |
---|
745 | Installation::.), it will construct the file `Makefile' from the |
---|
746 | template file `Makefile.in'. When it does this, it will incorporate |
---|
747 | makefile fragment files from the `config' directory, named `t-TARGET' |
---|
748 | and `x-HOST'. If these files do not exist, it means nothing needs to |
---|
749 | be added for a given target or host. |
---|
750 | |
---|
751 | * Menu: |
---|
752 | |
---|
753 | * Target Fragment:: Writing the `t-TARGET' file. |
---|
754 | * Host Fragment:: Writing the `x-HOST' file. |
---|
755 | |
---|
756 | |
---|
757 | File: gcc.info, Node: Target Fragment, Next: Host Fragment, Up: Fragments |
---|
758 | |
---|
759 | The Target Makefile Fragment |
---|
760 | ============================ |
---|
761 | |
---|
762 | The target makefile fragment, `t-TARGET', defines special target |
---|
763 | dependent variables and targets used in the `Makefile': |
---|
764 | |
---|
765 | `LIBGCC1' |
---|
766 | The rule to use to build `libgcc1.a'. If your target does not |
---|
767 | need to use the functions in `libgcc1.a', set this to empty. |
---|
768 | *Note Interface::. |
---|
769 | |
---|
770 | `CROSS_LIBGCC1' |
---|
771 | The rule to use to build `libgcc1.a' when building a cross |
---|
772 | compiler. If your target does not need to use the functions in |
---|
773 | `libgcc1.a', set this to empty. *Note Cross Runtime::. |
---|
774 | |
---|
775 | `LIBGCC2_CFLAGS' |
---|
776 | Compiler flags to use when compiling `libgcc2.c'. |
---|
777 | |
---|
778 | `LIB2FUNCS_EXTRA' |
---|
779 | A list of source file names to be compiled or assembled and |
---|
780 | inserted into `libgcc.a'. |
---|
781 | |
---|
782 | `CRTSTUFF_T_CFLAGS' |
---|
783 | Special flags used when compiling `crtstuff.c'. *Note |
---|
784 | Initialization::. |
---|
785 | |
---|
786 | `MULTILIB_OPTIONS' |
---|
787 | For some targets, invoking GNU CC in different ways produces |
---|
788 | objects that can not be linked together. For example, for some |
---|
789 | targets GNU CC produces both big and little endian code. For |
---|
790 | these targets, you must arrange for multiple versions of |
---|
791 | `libgcc.a' to be compiled, one for each set of incompatible |
---|
792 | options. When GNU CC invokes the linker, it arranges to link in |
---|
793 | the right version of `libgcc.a', based on the command line options |
---|
794 | used. |
---|
795 | |
---|
796 | The `MULTILIB_OPTIONS' macro lists the set of options for which |
---|
797 | special versions of `libgcc.a' must be built. Write options that |
---|
798 | are mutually incompatible side by side, separated by a slash. |
---|
799 | Write options that may be used together separated by a space. The |
---|
800 | build procedure will build all combinations of compatible options. |
---|
801 | |
---|
802 | For example, if you set `MULTILIB_OPTIONS' to `m68000/m68020 |
---|
803 | msoft-float', `Makefile' will build special versions of `libgcc.a' |
---|
804 | using the options `-m68000', `-m68020', `-msoft-float', `-m68000 |
---|
805 | -msoft-float', and `-m68020 -msoft-float'. |
---|
806 | |
---|
807 | `MULTILIB_DIRNAMES' |
---|
808 | If `MULTILIB_OPTIONS' is used, this variable specifies the |
---|
809 | directory names that should be used to hold the various libraries. |
---|
810 | Write one element in `MULTILIB_DIRNAMES' for each element in |
---|
811 | `MULTILIB_OPTIONS'. If `MULTILIB_DIRNAMES' is not used, the |
---|
812 | default value will be `MULTILIB_OPTIONS', with all slashes treated |
---|
813 | as spaces. |
---|
814 | |
---|
815 | For example, if `MULTILIB_OPTIONS' is `m68000/m68020 msoft-float', |
---|
816 | then the default value of `MULTILIB_DIRNAMES' is `m68000 m68020 |
---|
817 | msoft-float'. You may specify a different value if you desire a |
---|
818 | different set of directory names. |
---|
819 | |
---|
820 | `MULTILIB_MATCHES' |
---|
821 | Sometimes the same option may be written in two different ways. |
---|
822 | If an option is listed in `MULTILIB_OPTIONS', GNU CC needs to know |
---|
823 | about any synonyms. In that case, set `MULTILIB_MATCHES' to a |
---|
824 | list of items of the form `option=option' to describe all relevant |
---|
825 | synonyms. For example, `m68000=mc68000 m68020=mc68020'. |
---|
826 | |
---|
827 | |
---|
828 | File: gcc.info, Node: Host Fragment, Prev: Target Fragment, Up: Fragments |
---|
829 | |
---|
830 | The Host Makefile Fragment |
---|
831 | ========================== |
---|
832 | |
---|
833 | The host makefile fragment, `x-HOST', defines special host dependent |
---|
834 | variables and targets used in the `Makefile': |
---|
835 | |
---|
836 | `CC' |
---|
837 | The compiler to use when building the first stage. |
---|
838 | |
---|
839 | `CLIB' |
---|
840 | Additional host libraries to link with. |
---|
841 | |
---|
842 | `OLDCC' |
---|
843 | The compiler to use when building `libgcc1.a' for a native |
---|
844 | compilation. |
---|
845 | |
---|
846 | `OLDAR' |
---|
847 | The version of `ar' to use when building `libgcc1.a' for a native |
---|
848 | compilation. |
---|
849 | |
---|
850 | `INSTALL' |
---|
851 | The install program to use. |
---|
852 | |
---|