OSDN Git Service

PR preprocessor/30805:
[pf3gnuchains/gcc-fork.git] / gcc / defaults.h
1 /* Definitions of various defaults for tm.h macros.
2    Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3    2005, 2007
4    Free Software Foundation, Inc.
5    Contributed by Ron Guilmette (rfg@monkeys.com)
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 3, or (at your option) any later
12 version.
13
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3.  If not see
21 <http://www.gnu.org/licenses/>.  */
22
23 #ifndef GCC_DEFAULTS_H
24 #define GCC_DEFAULTS_H
25
26 #ifndef GET_ENVIRONMENT
27 #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
28 #endif
29
30 #define obstack_chunk_alloc     ((void *(*) (long)) xmalloc)
31 #define obstack_chunk_free      ((void (*) (void *)) free)
32 #define OBSTACK_CHUNK_SIZE      0
33 #define gcc_obstack_init(OBSTACK)                       \
34   _obstack_begin ((OBSTACK), OBSTACK_CHUNK_SIZE, 0,     \
35                   obstack_chunk_alloc,                  \
36                   obstack_chunk_free)
37
38 /* Store in OUTPUT a string (made with alloca) containing an
39    assembler-name for a local static variable or function named NAME.
40    LABELNO is an integer which is different for each call.  */
41
42 #ifndef ASM_PN_FORMAT
43 # ifndef NO_DOT_IN_LABEL
44 #  define ASM_PN_FORMAT "%s.%lu"
45 # else
46 #  ifndef NO_DOLLAR_IN_LABEL
47 #   define ASM_PN_FORMAT "%s$%lu"
48 #  else
49 #   define ASM_PN_FORMAT "__%s_%lu"
50 #  endif
51 # endif
52 #endif /* ! ASM_PN_FORMAT */
53
54 #ifndef ASM_FORMAT_PRIVATE_NAME
55 # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
56   do { const char *const name_ = (NAME); \
57        char *const output_ = (OUTPUT) = \
58          (char *) alloca (strlen (name_) + 32); \
59        sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
60   } while (0)
61 #endif
62
63 /* Choose a reasonable default for ASM_OUTPUT_ASCII.  */
64
65 #ifndef ASM_OUTPUT_ASCII
66 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
67   do {                                                                        \
68     FILE *_hide_asm_out_file = (MYFILE);                                      \
69     const unsigned char *_hide_p = (const unsigned char *) (MYSTRING);        \
70     int _hide_thissize = (MYLENGTH);                                          \
71     {                                                                         \
72       FILE *asm_out_file = _hide_asm_out_file;                                \
73       const unsigned char *p = _hide_p;                                       \
74       int thissize = _hide_thissize;                                          \
75       int i;                                                                  \
76       fprintf (asm_out_file, "\t.ascii \"");                                  \
77                                                                               \
78       for (i = 0; i < thissize; i++)                                          \
79         {                                                                     \
80           int c = p[i];                                                       \
81           if (c == '\"' || c == '\\')                                         \
82             putc ('\\', asm_out_file);                                        \
83           if (ISPRINT(c))                                                     \
84             putc (c, asm_out_file);                                           \
85           else                                                                \
86             {                                                                 \
87               fprintf (asm_out_file, "\\%o", c);                              \
88               /* After an octal-escape, if a digit follows,                   \
89                  terminate one string constant and start another.             \
90                  The VAX assembler fails to stop reading the escape           \
91                  after three digits, so this is the only way we               \
92                  can get it to parse the data properly.  */                   \
93               if (i < thissize - 1 && ISDIGIT(p[i + 1]))                      \
94                 fprintf (asm_out_file, "\"\n\t.ascii \"");                    \
95           }                                                                   \
96         }                                                                     \
97       fprintf (asm_out_file, "\"\n");                                         \
98     }                                                                         \
99   }                                                                           \
100   while (0)
101 #endif
102
103 /* This is how we tell the assembler to equate two values.  */
104 #ifdef SET_ASM_OP
105 #ifndef ASM_OUTPUT_DEF
106 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                              \
107  do {   fprintf ((FILE), "%s", SET_ASM_OP);                             \
108         assemble_name (FILE, LABEL1);                                   \
109         fprintf (FILE, ",");                                            \
110         assemble_name (FILE, LABEL2);                                   \
111         fprintf (FILE, "\n");                                           \
112   } while (0)
113 #endif
114 #endif
115
116 #if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON)
117 #define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE)                   \
118   do                                                                    \
119     {                                                                   \
120       fprintf ((FILE), "\t.tls_common\t");                              \
121       assemble_name ((FILE), (NAME));                                   \
122       fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",          \
123                (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT);              \
124     }                                                                   \
125   while (0)
126 #endif
127
128 /* Decide whether to defer emitting the assembler output for an equate
129    of two values.  The default is to not defer output.  */
130 #ifndef TARGET_DEFERRED_OUTPUT_DEFS
131 #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) false
132 #endif
133
134 /* This is how to output the definition of a user-level label named
135    NAME, such as the label on a static function or variable NAME.  */
136
137 #ifndef ASM_OUTPUT_LABEL
138 #define ASM_OUTPUT_LABEL(FILE,NAME) \
139   do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
140 #endif
141
142 /* Output the definition of a compiler-generated label named NAME.  */
143 #ifndef ASM_OUTPUT_INTERNAL_LABEL
144 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME)    \
145   do {                                          \
146     assemble_name_raw ((FILE), (NAME));         \
147     fputs (":\n", (FILE));                      \
148   } while (0)
149 #endif
150
151 /* This is how to output a reference to a user-level label named NAME.  */
152
153 #ifndef ASM_OUTPUT_LABELREF
154 #define ASM_OUTPUT_LABELREF(FILE,NAME)  asm_fprintf ((FILE), "%U%s", (NAME))
155 #endif
156
157 /* Allow target to print debug info labels specially.  This is useful for
158    VLIW targets, since debug info labels should go into the middle of
159    instruction bundles instead of breaking them.  */
160
161 #ifndef ASM_OUTPUT_DEBUG_LABEL
162 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
163   (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM)
164 #endif
165
166 /* This is how we tell the assembler that a symbol is weak.  */
167 #ifndef ASM_OUTPUT_WEAK_ALIAS
168 #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
169 #define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE)      \
170   do                                                    \
171     {                                                   \
172       ASM_WEAKEN_LABEL (STREAM, NAME);                  \
173       if (VALUE)                                        \
174         ASM_OUTPUT_DEF (STREAM, NAME, VALUE);           \
175     }                                                   \
176   while (0)
177 #endif
178 #endif
179
180 /* This is how we tell the assembler that a symbol is a weak alias to
181    another symbol that doesn't require the other symbol to be defined.
182    Uses of the former will turn into weak uses of the latter, i.e.,
183    uses that, in case the latter is undefined, will not cause errors,
184    and will add it to the symbol table as weak undefined.  However, if
185    the latter is referenced directly, a strong reference prevails.  */
186 #ifndef ASM_OUTPUT_WEAKREF
187 #if defined HAVE_GAS_WEAKREF
188 #define ASM_OUTPUT_WEAKREF(FILE, DECL, NAME, VALUE)                     \
189   do                                                                    \
190     {                                                                   \
191       fprintf ((FILE), "\t.weakref\t");                                 \
192       assemble_name ((FILE), (NAME));                                   \
193       fprintf ((FILE), ",");                                            \
194       assemble_name ((FILE), (VALUE));                                  \
195       fprintf ((FILE), "\n");                                           \
196     }                                                                   \
197   while (0)
198 #endif
199 #endif
200
201 /* How to emit a .type directive.  */
202 #ifndef ASM_OUTPUT_TYPE_DIRECTIVE
203 #if defined TYPE_ASM_OP && defined TYPE_OPERAND_FMT
204 #define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE)   \
205   do                                                    \
206     {                                                   \
207       fputs (TYPE_ASM_OP, STREAM);                      \
208       assemble_name (STREAM, NAME);                     \
209       fputs (", ", STREAM);                             \
210       fprintf (STREAM, TYPE_OPERAND_FMT, TYPE);         \
211       putc ('\n', STREAM);                              \
212     }                                                   \
213   while (0)
214 #endif
215 #endif
216
217 /* How to emit a .size directive.  */
218 #ifndef ASM_OUTPUT_SIZE_DIRECTIVE
219 #ifdef SIZE_ASM_OP
220 #define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE)   \
221   do                                                    \
222     {                                                   \
223       HOST_WIDE_INT size_ = (SIZE);                     \
224       fputs (SIZE_ASM_OP, STREAM);                      \
225       assemble_name (STREAM, NAME);                     \
226       fprintf (STREAM, ", " HOST_WIDE_INT_PRINT_DEC "\n", size_); \
227     }                                                   \
228   while (0)
229
230 #define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME)          \
231   do                                                    \
232     {                                                   \
233       fputs (SIZE_ASM_OP, STREAM);                      \
234       assemble_name (STREAM, NAME);                     \
235       fputs (", .-", STREAM);                           \
236       assemble_name (STREAM, NAME);                     \
237       putc ('\n', STREAM);                              \
238     }                                                   \
239   while (0)
240
241 #endif
242 #endif
243
244 /* This determines whether or not we support weak symbols.  */
245 #ifndef SUPPORTS_WEAK
246 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
247 #define SUPPORTS_WEAK 1
248 #else
249 #define SUPPORTS_WEAK 0
250 #endif
251 #endif
252
253 /* This determines whether or not we support link-once semantics.  */
254 #ifndef SUPPORTS_ONE_ONLY
255 #ifdef MAKE_DECL_ONE_ONLY
256 #define SUPPORTS_ONE_ONLY 1
257 #else
258 #define SUPPORTS_ONE_ONLY 0
259 #endif
260 #endif
261
262 /* This determines whether weak symbols must be left out of a static
263    archive's table of contents.  Defining this macro to be nonzero has
264    the consequence that certain symbols will not be made weak that
265    otherwise would be.  The C++ ABI requires this macro to be zero;
266    see the documentation.  */
267 #ifndef TARGET_WEAK_NOT_IN_ARCHIVE_TOC
268 #define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 0
269 #endif
270
271 /* This determines whether or not we need linkonce unwind information.  */
272 #ifndef TARGET_USES_WEAK_UNWIND_INFO
273 #define TARGET_USES_WEAK_UNWIND_INFO 0
274 #endif
275
276 /* By default, there is no prefix on user-defined symbols.  */
277 #ifndef USER_LABEL_PREFIX
278 #define USER_LABEL_PREFIX ""
279 #endif
280
281 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
282    provide a weak attribute.  Else define it to nothing.
283
284    This would normally belong in ansidecl.h, but SUPPORTS_WEAK is
285    not available at that time.
286
287    Note, this is only for use by target files which we know are to be
288    compiled by GCC.  */
289 #ifndef TARGET_ATTRIBUTE_WEAK
290 # if SUPPORTS_WEAK
291 #  define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
292 # else
293 #  define TARGET_ATTRIBUTE_WEAK
294 # endif
295 #endif
296
297 /* Determines whether we may use common symbols to represent one-only
298    semantics (a.k.a. "vague linkage").  */
299 #ifndef USE_COMMON_FOR_ONE_ONLY
300 # define USE_COMMON_FOR_ONE_ONLY 1
301 #endif
302
303 /* By default we can assume that all global symbols are in one namespace,
304    across all shared libraries.  */
305 #ifndef MULTIPLE_SYMBOL_SPACES
306 # define MULTIPLE_SYMBOL_SPACES 0
307 #endif
308
309 /* If the target supports init_priority C++ attribute, give
310    SUPPORTS_INIT_PRIORITY a nonzero value.  */
311 #ifndef SUPPORTS_INIT_PRIORITY
312 #define SUPPORTS_INIT_PRIORITY 1
313 #endif /* SUPPORTS_INIT_PRIORITY */
314
315 /* If duplicate library search directories can be removed from a
316    linker command without changing the linker's semantics, give this
317    symbol a nonzero.  */
318 #ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
319 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
320 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
321
322 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
323    the rest of the DWARF 2 frame unwind support is also provided.  */
324 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX) \
325     && !defined (TARGET_UNWIND_INFO)
326 #define DWARF2_UNWIND_INFO 1
327 #endif
328
329 /* If we have named sections, and we're using crtstuff to run ctors,
330    use them for registering eh frame information.  */
331 #if defined (TARGET_ASM_NAMED_SECTION) && DWARF2_UNWIND_INFO \
332     && !defined(EH_FRAME_IN_DATA_SECTION)
333 #ifndef EH_FRAME_SECTION_NAME
334 #define EH_FRAME_SECTION_NAME ".eh_frame"
335 #endif
336 #endif
337
338 /* On many systems, different EH table encodings are used under
339    difference circumstances.  Some will require runtime relocations;
340    some will not.  For those that do not require runtime relocations,
341    we would like to make the table read-only.  However, since the
342    read-only tables may need to be combined with read-write tables
343    that do require runtime relocation, it is not safe to make the
344    tables read-only unless the linker will merge read-only and
345    read-write sections into a single read-write section.  If your
346    linker does not have this ability, but your system is such that no
347    encoding used with non-PIC code will ever require a runtime
348    relocation, then you can define EH_TABLES_CAN_BE_READ_ONLY to 1 in
349    your target configuration file.  */
350 #ifndef EH_TABLES_CAN_BE_READ_ONLY
351 #ifdef HAVE_LD_RO_RW_SECTION_MIXING
352 #define EH_TABLES_CAN_BE_READ_ONLY 1
353 #else
354 #define EH_TABLES_CAN_BE_READ_ONLY 0
355 #endif
356 #endif
357
358 /* If we have named section and we support weak symbols, then use the
359    .jcr section for recording java classes which need to be registered
360    at program start-up time.  */
361 #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
362 #ifndef JCR_SECTION_NAME
363 #define JCR_SECTION_NAME ".jcr"
364 #endif
365 #endif
366
367 /* This decision to use a .jcr section can be overridden by defining
368    USE_JCR_SECTION to 0 in target file.  This is necessary if target
369    can define JCR_SECTION_NAME but does not have crtstuff or
370    linker support for .jcr section.  */
371 #ifndef TARGET_USE_JCR_SECTION
372 #ifdef JCR_SECTION_NAME
373 #define TARGET_USE_JCR_SECTION 1
374 #else
375 #define TARGET_USE_JCR_SECTION 0
376 #endif
377 #endif
378
379 /* Number of hardware registers that go into the DWARF-2 unwind info.
380    If not defined, equals FIRST_PSEUDO_REGISTER  */
381
382 #ifndef DWARF_FRAME_REGISTERS
383 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
384 #endif
385
386 /* How to renumber registers for dbx and gdb.  If not defined, assume
387    no renumbering is necessary.  */
388
389 #ifndef DBX_REGISTER_NUMBER
390 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
391 #endif
392
393 /* Default sizes for base C types.  If the sizes are different for
394    your target, you should override these values by defining the
395    appropriate symbols in your tm.h file.  */
396
397 #ifndef BITS_PER_UNIT
398 #define BITS_PER_UNIT 8
399 #endif
400
401 #ifndef BITS_PER_WORD
402 #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
403 #endif
404
405 #ifndef CHAR_TYPE_SIZE
406 #define CHAR_TYPE_SIZE BITS_PER_UNIT
407 #endif
408
409 #ifndef BOOL_TYPE_SIZE
410 /* `bool' has size and alignment `1', on almost all platforms.  */
411 #define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
412 #endif
413
414 #ifndef SHORT_TYPE_SIZE
415 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
416 #endif
417
418 #ifndef INT_TYPE_SIZE
419 #define INT_TYPE_SIZE BITS_PER_WORD
420 #endif
421
422 #ifndef LONG_TYPE_SIZE
423 #define LONG_TYPE_SIZE BITS_PER_WORD
424 #endif
425
426 #ifndef LONG_LONG_TYPE_SIZE
427 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
428 #endif
429
430 #ifndef WCHAR_TYPE_SIZE
431 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
432 #endif
433
434 #ifndef FLOAT_TYPE_SIZE
435 #define FLOAT_TYPE_SIZE BITS_PER_WORD
436 #endif
437
438 #ifndef DOUBLE_TYPE_SIZE
439 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
440 #endif
441
442 #ifndef LONG_DOUBLE_TYPE_SIZE
443 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
444 #endif
445
446 #ifndef DECIMAL32_TYPE_SIZE
447 #define DECIMAL32_TYPE_SIZE 32
448 #endif 
449
450 #ifndef DECIMAL64_TYPE_SIZE 
451 #define DECIMAL64_TYPE_SIZE 64
452 #endif 
453
454 #ifndef DECIMAL128_TYPE_SIZE
455 #define DECIMAL128_TYPE_SIZE 128
456 #endif
457
458 #ifndef SHORT_FRACT_TYPE_SIZE
459 #define SHORT_FRACT_TYPE_SIZE BITS_PER_UNIT
460 #endif
461
462 #ifndef FRACT_TYPE_SIZE
463 #define FRACT_TYPE_SIZE (BITS_PER_UNIT * 2)
464 #endif
465
466 #ifndef LONG_FRACT_TYPE_SIZE
467 #define LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 4)
468 #endif
469
470 #ifndef LONG_LONG_FRACT_TYPE_SIZE
471 #define LONG_LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 8)
472 #endif
473
474 #ifndef SHORT_ACCUM_TYPE_SIZE
475 #define SHORT_ACCUM_TYPE_SIZE (SHORT_FRACT_TYPE_SIZE * 2)
476 #endif
477
478 #ifndef ACCUM_TYPE_SIZE
479 #define ACCUM_TYPE_SIZE (FRACT_TYPE_SIZE * 2)
480 #endif
481
482 #ifndef LONG_ACCUM_TYPE_SIZE
483 #define LONG_ACCUM_TYPE_SIZE (LONG_FRACT_TYPE_SIZE * 2)
484 #endif
485
486 #ifndef LONG_LONG_ACCUM_TYPE_SIZE
487 #define LONG_LONG_ACCUM_TYPE_SIZE (LONG_LONG_FRACT_TYPE_SIZE * 2)
488 #endif
489
490 /* Width in bits of a pointer.  Mind the value of the macro `Pmode'.  */
491 #ifndef POINTER_SIZE
492 #define POINTER_SIZE BITS_PER_WORD
493 #endif
494
495 #ifndef PIC_OFFSET_TABLE_REGNUM
496 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
497 #endif
498
499 #ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES
500 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0
501 #endif
502
503 #ifndef TARGET_DECLSPEC
504 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
505 /* If the target supports the "dllimport" attribute, users are
506    probably used to the "__declspec" syntax.  */
507 #define TARGET_DECLSPEC 1
508 #else
509 #define TARGET_DECLSPEC 0
510 #endif
511 #endif
512
513 /* By default, the preprocessor should be invoked the same way in C++
514    as in C.  */
515 #ifndef CPLUSPLUS_CPP_SPEC
516 #ifdef CPP_SPEC
517 #define CPLUSPLUS_CPP_SPEC CPP_SPEC
518 #endif
519 #endif
520
521 #ifndef ACCUMULATE_OUTGOING_ARGS
522 #define ACCUMULATE_OUTGOING_ARGS 0
523 #endif
524
525 /* Supply a default definition for PUSH_ARGS.  */
526 #ifndef PUSH_ARGS
527 #ifdef PUSH_ROUNDING
528 #define PUSH_ARGS       !ACCUMULATE_OUTGOING_ARGS
529 #else
530 #define PUSH_ARGS       0
531 #endif
532 #endif
533
534 /* Decide whether a function's arguments should be processed
535    from first to last or from last to first.
536
537    They should if the stack and args grow in opposite directions, but
538    only if we have push insns.  */
539
540 #ifdef PUSH_ROUNDING
541
542 #ifndef PUSH_ARGS_REVERSED
543 #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
544 #define PUSH_ARGS_REVERSED  PUSH_ARGS
545 #endif
546 #endif
547
548 #endif
549
550 #ifndef PUSH_ARGS_REVERSED
551 #define PUSH_ARGS_REVERSED 0
552 #endif
553
554 /* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY.
555    STACK_BOUNDARY is required.  */
556 #ifndef PREFERRED_STACK_BOUNDARY
557 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
558 #endif
559
560 #ifndef TARGET_DEFAULT_PACK_STRUCT
561 #define TARGET_DEFAULT_PACK_STRUCT 0
562 #endif
563
564 /* By default, the C++ compiler will use function addresses in the
565    vtable entries.  Setting this nonzero tells the compiler to use
566    function descriptors instead.  The value of this macro says how
567    many words wide the descriptor is (normally 2).  It is assumed
568    that the address of a function descriptor may be treated as a
569    pointer to a function.  */
570 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
571 #define TARGET_VTABLE_USES_DESCRIPTORS 0
572 #endif
573
574 /* By default, the vtable entries are void pointers, the so the alignment
575    is the same as pointer alignment.  The value of this macro specifies
576    the alignment of the vtable entry in bits.  It should be defined only
577    when special alignment is necessary.  */
578 #ifndef TARGET_VTABLE_ENTRY_ALIGN
579 #define TARGET_VTABLE_ENTRY_ALIGN POINTER_SIZE
580 #endif
581
582 /* There are a few non-descriptor entries in the vtable at offsets below
583    zero.  If these entries must be padded (say, to preserve the alignment
584    specified by TARGET_VTABLE_ENTRY_ALIGN), set this to the number of
585    words in each data entry.  */
586 #ifndef TARGET_VTABLE_DATA_ENTRY_DISTANCE
587 #define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1
588 #endif
589
590 /* Decide whether it is safe to use a local alias for a virtual function
591    when constructing thunks.  */
592 #ifndef TARGET_USE_LOCAL_THUNK_ALIAS_P
593 #ifdef ASM_OUTPUT_DEF
594 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 1
595 #else
596 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 0
597 #endif
598 #endif
599
600 /* Select a format to encode pointers in exception handling data.  We
601    prefer those that result in fewer dynamic relocations.  Assume no
602    special support here and encode direct references.  */
603 #ifndef ASM_PREFERRED_EH_DATA_FORMAT
604 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)  DW_EH_PE_absptr
605 #endif
606
607 /* By default, the C++ compiler will use the lowest bit of the pointer
608    to function to indicate a pointer-to-member-function points to a
609    virtual member function.  However, if FUNCTION_BOUNDARY indicates
610    function addresses aren't always even, the lowest bit of the delta
611    field will be used.  */
612 #ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION
613 #define TARGET_PTRMEMFUNC_VBIT_LOCATION \
614   (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \
615    ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta)
616 #endif
617
618 #ifndef DEFAULT_GDB_EXTENSIONS
619 #define DEFAULT_GDB_EXTENSIONS 1
620 #endif
621
622 /* If more than one debugging type is supported, you must define
623    PREFERRED_DEBUGGING_TYPE to choose the default.  */
624
625 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) \
626          + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
627          + defined (VMS_DEBUGGING_INFO))
628 #ifndef PREFERRED_DEBUGGING_TYPE
629 #error You must define PREFERRED_DEBUGGING_TYPE
630 #endif /* no PREFERRED_DEBUGGING_TYPE */
631
632 /* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE
633    here so other code needn't care.  */
634 #elif defined DBX_DEBUGGING_INFO
635 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
636
637 #elif defined SDB_DEBUGGING_INFO
638 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
639
640 #elif defined DWARF2_DEBUGGING_INFO
641 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
642
643 #elif defined VMS_DEBUGGING_INFO
644 #define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
645
646 #elif defined XCOFF_DEBUGGING_INFO
647 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
648
649 #else
650 /* No debugging format is supported by this target.  */
651 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
652 #endif
653
654 /* Define codes for all the float formats that we know of.  */
655 #define UNKNOWN_FLOAT_FORMAT 0
656 #define IEEE_FLOAT_FORMAT 1
657 #define VAX_FLOAT_FORMAT 2
658 #define C4X_FLOAT_FORMAT 3
659
660 /* Default to IEEE float if not specified.  Nearly all machines use it.  */
661 #ifndef TARGET_FLOAT_FORMAT
662 #define TARGET_FLOAT_FORMAT     IEEE_FLOAT_FORMAT
663 #endif
664
665 #ifndef LARGEST_EXPONENT_IS_NORMAL
666 #define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
667 #endif
668
669 #ifndef ROUND_TOWARDS_ZERO
670 #define ROUND_TOWARDS_ZERO 0
671 #endif
672
673 #ifndef MODE_HAS_NANS
674 #define MODE_HAS_NANS(MODE)                                     \
675   (FLOAT_MODE_P (MODE)                                          \
676    && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT                  \
677    && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
678 #endif
679
680 #ifndef MODE_HAS_INFINITIES
681 #define MODE_HAS_INFINITIES(MODE)                               \
682   (FLOAT_MODE_P (MODE)                                          \
683    && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT                  \
684    && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
685 #endif
686
687 #ifndef MODE_HAS_SIGNED_ZEROS
688 #define MODE_HAS_SIGNED_ZEROS(MODE) \
689   (FLOAT_MODE_P (MODE) && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
690 #endif
691
692 #ifndef MODE_HAS_SIGN_DEPENDENT_ROUNDING
693 #define MODE_HAS_SIGN_DEPENDENT_ROUNDING(MODE)                  \
694   (FLOAT_MODE_P (MODE)                                          \
695    && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT                  \
696    && !ROUND_TOWARDS_ZERO)
697 #endif
698
699 #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
700 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false
701 #endif
702
703 /* True if the targets integer-comparison functions return { 0, 1, 2
704    } to indicate { <, ==, > }.  False if { -1, 0, 1 } is used
705    instead.  The libgcc routines are biased.  */
706 #ifndef TARGET_LIB_INT_CMP_BIASED
707 #define TARGET_LIB_INT_CMP_BIASED (true)
708 #endif
709
710 /* If FLOAT_WORDS_BIG_ENDIAN is not defined in the header files,
711    then the word-endianness is the same as for integers.  */
712 #ifndef FLOAT_WORDS_BIG_ENDIAN
713 #define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
714 #endif
715
716 #ifndef TARGET_FLT_EVAL_METHOD
717 #define TARGET_FLT_EVAL_METHOD 0
718 #endif
719
720 #ifndef TARGET_DEC_EVAL_METHOD
721 #define TARGET_DEC_EVAL_METHOD 2
722 #endif
723
724 #ifndef HOT_TEXT_SECTION_NAME
725 #define HOT_TEXT_SECTION_NAME ".text.hot"
726 #endif
727
728 #ifndef UNLIKELY_EXECUTED_TEXT_SECTION_NAME
729 #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
730 #endif
731
732 #ifndef HAS_LONG_COND_BRANCH
733 #define HAS_LONG_COND_BRANCH 0
734 #endif
735
736 #ifndef HAS_LONG_UNCOND_BRANCH
737 #define HAS_LONG_UNCOND_BRANCH 0
738 #endif
739
740 /* By default, only attempt to parallelize bitwise operations, and
741    possibly adds/subtracts using bit-twiddling.  */
742 #ifndef UNITS_PER_SIMD_WORD
743 #define UNITS_PER_SIMD_WORD UNITS_PER_WORD
744 #endif
745
746 /* Determine whether __cxa_atexit, rather than atexit, is used to
747    register C++ destructors for local statics and global objects.  */
748 #ifndef DEFAULT_USE_CXA_ATEXIT
749 #define DEFAULT_USE_CXA_ATEXIT 0
750 #endif
751
752 /* If none of these macros are defined, the port must use the new
753    technique of defining constraints in the machine description.
754    tm_p.h will define those macros that machine-independent code
755    still uses.  */
756 #if  !defined CONSTRAINT_LEN                    \
757   && !defined REG_CLASS_FROM_LETTER             \
758   && !defined REG_CLASS_FROM_CONSTRAINT         \
759   && !defined CONST_OK_FOR_LETTER_P             \
760   && !defined CONST_OK_FOR_CONSTRAINT_P         \
761   && !defined CONST_DOUBLE_OK_FOR_LETTER_P      \
762   && !defined CONST_DOUBLE_OK_FOR_CONSTRAINT_P  \
763   && !defined EXTRA_CONSTRAINT                  \
764   && !defined EXTRA_CONSTRAINT_STR              \
765   && !defined EXTRA_MEMORY_CONSTRAINT           \
766   && !defined EXTRA_ADDRESS_CONSTRAINT
767
768 #define USE_MD_CONSTRAINTS
769
770 #if GCC_VERSION >= 3000 && defined IN_GCC
771 /* These old constraint macros shouldn't appear anywhere in a
772    configuration using MD constraint definitions.  */
773 #pragma GCC poison REG_CLASS_FROM_LETTER CONST_OK_FOR_LETTER_P \
774                    CONST_DOUBLE_OK_FOR_LETTER_P EXTRA_CONSTRAINT
775 #endif
776
777 #else /* old constraint mechanism in use */
778
779 /* Determine whether extra constraint letter should be handled
780    via address reload (like 'o').  */
781 #ifndef EXTRA_MEMORY_CONSTRAINT
782 #define EXTRA_MEMORY_CONSTRAINT(C,STR) 0
783 #endif
784
785 /* Determine whether extra constraint letter should be handled
786    as an address (like 'p').  */
787 #ifndef EXTRA_ADDRESS_CONSTRAINT
788 #define EXTRA_ADDRESS_CONSTRAINT(C,STR) 0
789 #endif
790
791 /* When a port defines CONSTRAINT_LEN, it should use DEFAULT_CONSTRAINT_LEN
792    for all the characters that it does not want to change, so things like the
793   'length' of a digit in a matching constraint is an implementation detail,
794    and not part of the interface.  */
795 #define DEFAULT_CONSTRAINT_LEN(C,STR) 1
796
797 #ifndef CONSTRAINT_LEN
798 #define CONSTRAINT_LEN(C,STR) DEFAULT_CONSTRAINT_LEN (C, STR)
799 #endif
800
801 #if defined (CONST_OK_FOR_LETTER_P) && ! defined (CONST_OK_FOR_CONSTRAINT_P)
802 #define CONST_OK_FOR_CONSTRAINT_P(VAL,C,STR) CONST_OK_FOR_LETTER_P (VAL, C)
803 #endif
804
805 #if defined (CONST_DOUBLE_OK_FOR_LETTER_P) && ! defined (CONST_DOUBLE_OK_FOR_CONSTRAINT_P)
806 #define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(OP,C,STR) \
807   CONST_DOUBLE_OK_FOR_LETTER_P (OP, C)
808 #endif
809
810 #ifndef REG_CLASS_FROM_CONSTRAINT
811 #define REG_CLASS_FROM_CONSTRAINT(C,STR) REG_CLASS_FROM_LETTER (C)
812 #endif
813
814 #if defined (EXTRA_CONSTRAINT) && ! defined (EXTRA_CONSTRAINT_STR)
815 #define EXTRA_CONSTRAINT_STR(OP, C,STR) EXTRA_CONSTRAINT (OP, C)
816 #endif
817
818 #endif /* old constraint mechanism in use */
819
820 #ifndef REGISTER_MOVE_COST
821 #define REGISTER_MOVE_COST(m, x, y) 2
822 #endif
823
824 /* Determine whether the entire c99 runtime
825    is present in the runtime library.  */
826 #ifndef TARGET_C99_FUNCTIONS
827 #define TARGET_C99_FUNCTIONS 0
828 #endif
829
830 /* Determine whether the target runtime library has
831    a sincos implementation following the GNU extension.  */
832 #ifndef TARGET_HAS_SINCOS
833 #define TARGET_HAS_SINCOS 0
834 #endif
835
836 /* Indicate that CLZ and CTZ are undefined at zero.  */
837 #ifndef CLZ_DEFINED_VALUE_AT_ZERO
838 #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE)  0
839 #endif
840 #ifndef CTZ_DEFINED_VALUE_AT_ZERO
841 #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE)  0
842 #endif
843
844 /* Provide a default value for STORE_FLAG_VALUE.  */
845 #ifndef STORE_FLAG_VALUE
846 #define STORE_FLAG_VALUE  1
847 #endif
848
849 /* This macro is used to determine what the largest unit size that
850    move_by_pieces can use is.  */
851
852 /* MOVE_MAX_PIECES is the number of bytes at a time which we can
853    move efficiently, as opposed to  MOVE_MAX which is the maximum
854    number of bytes we can move with a single instruction.  */
855
856 #ifndef MOVE_MAX_PIECES
857 #define MOVE_MAX_PIECES   MOVE_MAX
858 #endif
859
860 #ifndef STACK_POINTER_OFFSET
861 #define STACK_POINTER_OFFSET    0
862 #endif
863
864 #ifndef LOCAL_REGNO
865 #define LOCAL_REGNO(REGNO)  0
866 #endif
867
868 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
869    the stack pointer does not matter.  The value is tested only in
870    functions that have frame pointers.  */
871 #ifndef EXIT_IGNORE_STACK
872 #define EXIT_IGNORE_STACK 0
873 #endif
874
875 /* Assume that case vectors are not pc-relative.  */
876 #ifndef CASE_VECTOR_PC_RELATIVE
877 #define CASE_VECTOR_PC_RELATIVE 0
878 #endif
879
880 /* Assume that trampolines need function alignment.  */
881 #ifndef TRAMPOLINE_ALIGNMENT
882 #define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
883 #endif
884
885 /* Register mappings for target machines without register windows.  */
886 #ifndef INCOMING_REGNO
887 #define INCOMING_REGNO(N) (N)
888 #endif
889
890 #ifndef OUTGOING_REGNO
891 #define OUTGOING_REGNO(N) (N)
892 #endif
893
894 #ifndef SHIFT_COUNT_TRUNCATED
895 #define SHIFT_COUNT_TRUNCATED 0
896 #endif
897
898 #ifndef LEGITIMIZE_ADDRESS
899 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
900 #endif
901
902 #ifndef LEGITIMATE_PIC_OPERAND_P
903 #define LEGITIMATE_PIC_OPERAND_P(X) 1
904 #endif
905
906 #ifndef REVERSIBLE_CC_MODE
907 #define REVERSIBLE_CC_MODE(MODE) 0
908 #endif
909
910 /* Biggest alignment supported by the object file format of this machine.  */
911 #ifndef MAX_OFILE_ALIGNMENT
912 #define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
913 #endif
914
915 #ifndef FRAME_GROWS_DOWNWARD
916 #define FRAME_GROWS_DOWNWARD 0
917 #endif
918
919 /* On most machines, the CFA coincides with the first incoming parm.  */
920 #ifndef ARG_POINTER_CFA_OFFSET
921 #define ARG_POINTER_CFA_OFFSET(FNDECL) FIRST_PARM_OFFSET (FNDECL)
922 #endif
923
924 /* On most machines, we use the CFA as DW_AT_frame_base.  */
925 #ifndef CFA_FRAME_BASE_OFFSET
926 #define CFA_FRAME_BASE_OFFSET(FNDECL) 0
927 #endif
928
929 /* The offset from the incoming value of %sp to the top of the stack frame
930    for the current function.  */
931 #ifndef INCOMING_FRAME_SP_OFFSET
932 #define INCOMING_FRAME_SP_OFFSET 0
933 #endif
934
935 #ifndef HARD_REGNO_NREGS_HAS_PADDING
936 #define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE) 0
937 #define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) -1
938 #endif
939
940 #ifndef OUTGOING_REG_PARM_STACK_SPACE
941 #define OUTGOING_REG_PARM_STACK_SPACE 0
942 #endif
943
944 #endif  /* ! GCC_DEFAULTS_H */