./:
[official-gcc.git] / gcc / defaults.h
blobb41f60366d507afd03b795ab083844a8a92e59a5
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, 2008, 2009
4 Free Software Foundation, Inc.
5 Contributed by Ron Guilmette (rfg@monkeys.com)
7 This file is part of GCC.
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.
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.
19 Under Section 7 of GPL version 3, you are granted additional
20 permissions described in the GCC Runtime Library Exception, version
21 3.1, as published by the Free Software Foundation.
23 You should have received a copy of the GNU General Public License and
24 a copy of the GCC Runtime Library Exception along with this program;
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 <http://www.gnu.org/licenses/>. */
28 #ifndef GCC_DEFAULTS_H
29 #define GCC_DEFAULTS_H
31 #ifndef GET_ENVIRONMENT
32 #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
33 #endif
35 #define obstack_chunk_alloc ((void *(*) (long)) xmalloc)
36 #define obstack_chunk_free ((void (*) (void *)) free)
37 #define OBSTACK_CHUNK_SIZE 0
38 #define gcc_obstack_init(OBSTACK) \
39 _obstack_begin ((OBSTACK), OBSTACK_CHUNK_SIZE, 0, \
40 obstack_chunk_alloc, \
41 obstack_chunk_free)
43 /* Store in OUTPUT a string (made with alloca) containing an
44 assembler-name for a local static variable or function named NAME.
45 LABELNO is an integer which is different for each call. */
47 #ifndef ASM_PN_FORMAT
48 # ifndef NO_DOT_IN_LABEL
49 # define ASM_PN_FORMAT "%s.%lu"
50 # else
51 # ifndef NO_DOLLAR_IN_LABEL
52 # define ASM_PN_FORMAT "%s$%lu"
53 # else
54 # define ASM_PN_FORMAT "__%s_%lu"
55 # endif
56 # endif
57 #endif /* ! ASM_PN_FORMAT */
59 #ifndef ASM_FORMAT_PRIVATE_NAME
60 # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
61 do { const char *const name_ = (NAME); \
62 char *const output_ = (OUTPUT) = \
63 (char *) alloca (strlen (name_) + 32); \
64 sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
65 } while (0)
66 #endif
68 /* Choose a reasonable default for ASM_OUTPUT_ASCII. */
70 #ifndef ASM_OUTPUT_ASCII
71 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
72 do { \
73 FILE *_hide_asm_out_file = (MYFILE); \
74 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
75 int _hide_thissize = (MYLENGTH); \
76 { \
77 FILE *asm_out_file = _hide_asm_out_file; \
78 const unsigned char *p = _hide_p; \
79 int thissize = _hide_thissize; \
80 int i; \
81 fprintf (asm_out_file, "\t.ascii \""); \
83 for (i = 0; i < thissize; i++) \
84 { \
85 int c = p[i]; \
86 if (c == '\"' || c == '\\') \
87 putc ('\\', asm_out_file); \
88 if (ISPRINT(c)) \
89 putc (c, asm_out_file); \
90 else \
91 { \
92 fprintf (asm_out_file, "\\%o", c); \
93 /* After an octal-escape, if a digit follows, \
94 terminate one string constant and start another. \
95 The VAX assembler fails to stop reading the escape \
96 after three digits, so this is the only way we \
97 can get it to parse the data properly. */ \
98 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
99 fprintf (asm_out_file, "\"\n\t.ascii \""); \
102 fprintf (asm_out_file, "\"\n"); \
105 while (0)
106 #endif
108 /* This is how we tell the assembler to equate two values. */
109 #ifdef SET_ASM_OP
110 #ifndef ASM_OUTPUT_DEF
111 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
112 do { fprintf ((FILE), "%s", SET_ASM_OP); \
113 assemble_name (FILE, LABEL1); \
114 fprintf (FILE, ","); \
115 assemble_name (FILE, LABEL2); \
116 fprintf (FILE, "\n"); \
117 } while (0)
118 #endif
119 #endif
121 #if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON)
122 #define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \
123 do \
125 fprintf ((FILE), "\t.tls_common\t"); \
126 assemble_name ((FILE), (NAME)); \
127 fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
128 (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT); \
130 while (0)
131 #endif
133 /* Decide whether to defer emitting the assembler output for an equate
134 of two values. The default is to not defer output. */
135 #ifndef TARGET_DEFERRED_OUTPUT_DEFS
136 #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) false
137 #endif
139 /* This is how to output the definition of a user-level label named
140 NAME, such as the label on a static function or variable NAME. */
142 #ifndef ASM_OUTPUT_LABEL
143 #define ASM_OUTPUT_LABEL(FILE,NAME) \
144 do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
145 #endif
147 /* Output the definition of a compiler-generated label named NAME. */
148 #ifndef ASM_OUTPUT_INTERNAL_LABEL
149 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
150 do { \
151 assemble_name_raw ((FILE), (NAME)); \
152 fputs (":\n", (FILE)); \
153 } while (0)
154 #endif
156 /* This is how to output a reference to a user-level label named NAME. */
158 #ifndef ASM_OUTPUT_LABELREF
159 #define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
160 #endif
162 /* Allow target to print debug info labels specially. This is useful for
163 VLIW targets, since debug info labels should go into the middle of
164 instruction bundles instead of breaking them. */
166 #ifndef ASM_OUTPUT_DEBUG_LABEL
167 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
168 (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM)
169 #endif
171 /* This is how we tell the assembler that a symbol is weak. */
172 #ifndef ASM_OUTPUT_WEAK_ALIAS
173 #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
174 #define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \
175 do \
177 ASM_WEAKEN_LABEL (STREAM, NAME); \
178 if (VALUE) \
179 ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \
181 while (0)
182 #endif
183 #endif
185 /* This is how we tell the assembler that a symbol is a weak alias to
186 another symbol that doesn't require the other symbol to be defined.
187 Uses of the former will turn into weak uses of the latter, i.e.,
188 uses that, in case the latter is undefined, will not cause errors,
189 and will add it to the symbol table as weak undefined. However, if
190 the latter is referenced directly, a strong reference prevails. */
191 #ifndef ASM_OUTPUT_WEAKREF
192 #if defined HAVE_GAS_WEAKREF
193 #define ASM_OUTPUT_WEAKREF(FILE, DECL, NAME, VALUE) \
194 do \
196 fprintf ((FILE), "\t.weakref\t"); \
197 assemble_name ((FILE), (NAME)); \
198 fprintf ((FILE), ","); \
199 assemble_name ((FILE), (VALUE)); \
200 fprintf ((FILE), "\n"); \
202 while (0)
203 #endif
204 #endif
206 /* How to emit a .type directive. */
207 #ifndef ASM_OUTPUT_TYPE_DIRECTIVE
208 #if defined TYPE_ASM_OP && defined TYPE_OPERAND_FMT
209 #define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) \
210 do \
212 fputs (TYPE_ASM_OP, STREAM); \
213 assemble_name (STREAM, NAME); \
214 fputs (", ", STREAM); \
215 fprintf (STREAM, TYPE_OPERAND_FMT, TYPE); \
216 putc ('\n', STREAM); \
218 while (0)
219 #endif
220 #endif
222 /* How to emit a .size directive. */
223 #ifndef ASM_OUTPUT_SIZE_DIRECTIVE
224 #ifdef SIZE_ASM_OP
225 #define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE) \
226 do \
228 HOST_WIDE_INT size_ = (SIZE); \
229 fputs (SIZE_ASM_OP, STREAM); \
230 assemble_name (STREAM, NAME); \
231 fprintf (STREAM, ", " HOST_WIDE_INT_PRINT_DEC "\n", size_); \
233 while (0)
235 #define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME) \
236 do \
238 fputs (SIZE_ASM_OP, STREAM); \
239 assemble_name (STREAM, NAME); \
240 fputs (", .-", STREAM); \
241 assemble_name (STREAM, NAME); \
242 putc ('\n', STREAM); \
244 while (0)
246 #endif
247 #endif
249 /* This determines whether or not we support weak symbols. */
250 #ifndef SUPPORTS_WEAK
251 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
252 #define SUPPORTS_WEAK 1
253 #else
254 #define SUPPORTS_WEAK 0
255 #endif
256 #endif
258 /* This determines whether or not we support link-once semantics. */
259 #ifndef SUPPORTS_ONE_ONLY
260 #ifdef MAKE_DECL_ONE_ONLY
261 #define SUPPORTS_ONE_ONLY 1
262 #else
263 #define SUPPORTS_ONE_ONLY 0
264 #endif
265 #endif
267 /* This determines whether weak symbols must be left out of a static
268 archive's table of contents. Defining this macro to be nonzero has
269 the consequence that certain symbols will not be made weak that
270 otherwise would be. The C++ ABI requires this macro to be zero;
271 see the documentation. */
272 #ifndef TARGET_WEAK_NOT_IN_ARCHIVE_TOC
273 #define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 0
274 #endif
276 /* This determines whether or not we need linkonce unwind information. */
277 #ifndef TARGET_USES_WEAK_UNWIND_INFO
278 #define TARGET_USES_WEAK_UNWIND_INFO 0
279 #endif
281 /* By default, there is no prefix on user-defined symbols. */
282 #ifndef USER_LABEL_PREFIX
283 #define USER_LABEL_PREFIX ""
284 #endif
286 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
287 provide a weak attribute. Else define it to nothing.
289 This would normally belong in ansidecl.h, but SUPPORTS_WEAK is
290 not available at that time.
292 Note, this is only for use by target files which we know are to be
293 compiled by GCC. */
294 #ifndef TARGET_ATTRIBUTE_WEAK
295 # if SUPPORTS_WEAK
296 # define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
297 # else
298 # define TARGET_ATTRIBUTE_WEAK
299 # endif
300 #endif
302 /* Determines whether we may use common symbols to represent one-only
303 semantics (a.k.a. "vague linkage"). */
304 #ifndef USE_COMMON_FOR_ONE_ONLY
305 # define USE_COMMON_FOR_ONE_ONLY 1
306 #endif
308 /* By default we can assume that all global symbols are in one namespace,
309 across all shared libraries. */
310 #ifndef MULTIPLE_SYMBOL_SPACES
311 # define MULTIPLE_SYMBOL_SPACES 0
312 #endif
314 /* If the target supports init_priority C++ attribute, give
315 SUPPORTS_INIT_PRIORITY a nonzero value. */
316 #ifndef SUPPORTS_INIT_PRIORITY
317 #define SUPPORTS_INIT_PRIORITY 1
318 #endif /* SUPPORTS_INIT_PRIORITY */
320 /* If duplicate library search directories can be removed from a
321 linker command without changing the linker's semantics, give this
322 symbol a nonzero. */
323 #ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
324 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
325 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
327 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
328 the rest of the DWARF 2 frame unwind support is also provided. */
329 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX) \
330 && !defined (TARGET_UNWIND_INFO)
331 #define DWARF2_UNWIND_INFO 1
332 #endif
334 /* If we have named sections, and we're using crtstuff to run ctors,
335 use them for registering eh frame information. */
336 #if defined (TARGET_ASM_NAMED_SECTION) && DWARF2_UNWIND_INFO \
337 && !defined(EH_FRAME_IN_DATA_SECTION)
338 #ifndef EH_FRAME_SECTION_NAME
339 #define EH_FRAME_SECTION_NAME ".eh_frame"
340 #endif
341 #endif
343 /* On many systems, different EH table encodings are used under
344 difference circumstances. Some will require runtime relocations;
345 some will not. For those that do not require runtime relocations,
346 we would like to make the table read-only. However, since the
347 read-only tables may need to be combined with read-write tables
348 that do require runtime relocation, it is not safe to make the
349 tables read-only unless the linker will merge read-only and
350 read-write sections into a single read-write section. If your
351 linker does not have this ability, but your system is such that no
352 encoding used with non-PIC code will ever require a runtime
353 relocation, then you can define EH_TABLES_CAN_BE_READ_ONLY to 1 in
354 your target configuration file. */
355 #ifndef EH_TABLES_CAN_BE_READ_ONLY
356 #ifdef HAVE_LD_RO_RW_SECTION_MIXING
357 #define EH_TABLES_CAN_BE_READ_ONLY 1
358 #else
359 #define EH_TABLES_CAN_BE_READ_ONLY 0
360 #endif
361 #endif
363 /* If we have named section and we support weak symbols, then use the
364 .jcr section for recording java classes which need to be registered
365 at program start-up time. */
366 #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
367 #ifndef JCR_SECTION_NAME
368 #define JCR_SECTION_NAME ".jcr"
369 #endif
370 #endif
372 /* This decision to use a .jcr section can be overridden by defining
373 USE_JCR_SECTION to 0 in target file. This is necessary if target
374 can define JCR_SECTION_NAME but does not have crtstuff or
375 linker support for .jcr section. */
376 #ifndef TARGET_USE_JCR_SECTION
377 #ifdef JCR_SECTION_NAME
378 #define TARGET_USE_JCR_SECTION 1
379 #else
380 #define TARGET_USE_JCR_SECTION 0
381 #endif
382 #endif
384 /* Number of hardware registers that go into the DWARF-2 unwind info.
385 If not defined, equals FIRST_PSEUDO_REGISTER */
387 #ifndef DWARF_FRAME_REGISTERS
388 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
389 #endif
391 /* How to renumber registers for dbx and gdb. If not defined, assume
392 no renumbering is necessary. */
394 #ifndef DBX_REGISTER_NUMBER
395 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
396 #endif
398 /* Default sizes for base C types. If the sizes are different for
399 your target, you should override these values by defining the
400 appropriate symbols in your tm.h file. */
402 #ifndef BITS_PER_UNIT
403 #define BITS_PER_UNIT 8
404 #endif
406 #ifndef BITS_PER_WORD
407 #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
408 #endif
410 #ifndef CHAR_TYPE_SIZE
411 #define CHAR_TYPE_SIZE BITS_PER_UNIT
412 #endif
414 #ifndef BOOL_TYPE_SIZE
415 /* `bool' has size and alignment `1', on almost all platforms. */
416 #define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
417 #endif
419 #ifndef SHORT_TYPE_SIZE
420 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
421 #endif
423 #ifndef INT_TYPE_SIZE
424 #define INT_TYPE_SIZE BITS_PER_WORD
425 #endif
427 #ifndef LONG_TYPE_SIZE
428 #define LONG_TYPE_SIZE BITS_PER_WORD
429 #endif
431 #ifndef LONG_LONG_TYPE_SIZE
432 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
433 #endif
435 #ifndef WCHAR_TYPE_SIZE
436 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
437 #endif
439 #ifndef FLOAT_TYPE_SIZE
440 #define FLOAT_TYPE_SIZE BITS_PER_WORD
441 #endif
443 #ifndef DOUBLE_TYPE_SIZE
444 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
445 #endif
447 #ifndef LONG_DOUBLE_TYPE_SIZE
448 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
449 #endif
451 #ifndef DECIMAL32_TYPE_SIZE
452 #define DECIMAL32_TYPE_SIZE 32
453 #endif
455 #ifndef DECIMAL64_TYPE_SIZE
456 #define DECIMAL64_TYPE_SIZE 64
457 #endif
459 #ifndef DECIMAL128_TYPE_SIZE
460 #define DECIMAL128_TYPE_SIZE 128
461 #endif
463 #ifndef SHORT_FRACT_TYPE_SIZE
464 #define SHORT_FRACT_TYPE_SIZE BITS_PER_UNIT
465 #endif
467 #ifndef FRACT_TYPE_SIZE
468 #define FRACT_TYPE_SIZE (BITS_PER_UNIT * 2)
469 #endif
471 #ifndef LONG_FRACT_TYPE_SIZE
472 #define LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 4)
473 #endif
475 #ifndef LONG_LONG_FRACT_TYPE_SIZE
476 #define LONG_LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 8)
477 #endif
479 #ifndef SHORT_ACCUM_TYPE_SIZE
480 #define SHORT_ACCUM_TYPE_SIZE (SHORT_FRACT_TYPE_SIZE * 2)
481 #endif
483 #ifndef ACCUM_TYPE_SIZE
484 #define ACCUM_TYPE_SIZE (FRACT_TYPE_SIZE * 2)
485 #endif
487 #ifndef LONG_ACCUM_TYPE_SIZE
488 #define LONG_ACCUM_TYPE_SIZE (LONG_FRACT_TYPE_SIZE * 2)
489 #endif
491 #ifndef LONG_LONG_ACCUM_TYPE_SIZE
492 #define LONG_LONG_ACCUM_TYPE_SIZE (LONG_LONG_FRACT_TYPE_SIZE * 2)
493 #endif
495 /* We let tm.h override the types used here, to handle trivial differences
496 such as the choice of unsigned int or long unsigned int for size_t.
497 When machines start needing nontrivial differences in the size type,
498 it would be best to do something here to figure out automatically
499 from other information what type to use. */
501 #ifndef SIZE_TYPE
502 #define SIZE_TYPE "long unsigned int"
503 #endif
505 #ifndef PID_TYPE
506 #define PID_TYPE "int"
507 #endif
509 /* If GCC knows the exact uint_least16_t and uint_least32_t types from
510 <stdint.h>, use them for char16_t and char32_t. Otherwise, use
511 these guesses; getting the wrong type of a given width will not
512 affect C++ name mangling because in C++ these are distinct types
513 not typedefs. */
515 #ifdef UINT_LEAST16_TYPE
516 #define CHAR16_TYPE UINT_LEAST16_TYPE
517 #else
518 #define CHAR16_TYPE "short unsigned int"
519 #endif
521 #ifdef UINT_LEAST32_TYPE
522 #define CHAR32_TYPE UINT_LEAST32_TYPE
523 #else
524 #define CHAR32_TYPE "unsigned int"
525 #endif
527 #ifndef WCHAR_TYPE
528 #define WCHAR_TYPE "int"
529 #endif
531 /* WCHAR_TYPE gets overridden by -fshort-wchar. */
532 #define MODIFIED_WCHAR_TYPE \
533 (flag_short_wchar ? "short unsigned int" : WCHAR_TYPE)
535 #ifndef PTRDIFF_TYPE
536 #define PTRDIFF_TYPE "long int"
537 #endif
539 #ifndef WINT_TYPE
540 #define WINT_TYPE "unsigned int"
541 #endif
543 #ifndef INTMAX_TYPE
544 #define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
545 ? "int" \
546 : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
547 ? "long int" \
548 : "long long int"))
549 #endif
551 #ifndef UINTMAX_TYPE
552 #define UINTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
553 ? "unsigned int" \
554 : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
555 ? "long unsigned int" \
556 : "long long unsigned int"))
557 #endif
560 /* There are no default definitions of these <stdint.h> types. */
562 #ifndef SIG_ATOMIC_TYPE
563 #define SIG_ATOMIC_TYPE ((const char *) NULL)
564 #endif
566 #ifndef INT8_TYPE
567 #define INT8_TYPE ((const char *) NULL)
568 #endif
570 #ifndef INT16_TYPE
571 #define INT16_TYPE ((const char *) NULL)
572 #endif
574 #ifndef INT32_TYPE
575 #define INT32_TYPE ((const char *) NULL)
576 #endif
578 #ifndef INT64_TYPE
579 #define INT64_TYPE ((const char *) NULL)
580 #endif
582 #ifndef UINT8_TYPE
583 #define UINT8_TYPE ((const char *) NULL)
584 #endif
586 #ifndef UINT16_TYPE
587 #define UINT16_TYPE ((const char *) NULL)
588 #endif
590 #ifndef UINT32_TYPE
591 #define UINT32_TYPE ((const char *) NULL)
592 #endif
594 #ifndef UINT64_TYPE
595 #define UINT64_TYPE ((const char *) NULL)
596 #endif
598 #ifndef INT_LEAST8_TYPE
599 #define INT_LEAST8_TYPE ((const char *) NULL)
600 #endif
602 #ifndef INT_LEAST16_TYPE
603 #define INT_LEAST16_TYPE ((const char *) NULL)
604 #endif
606 #ifndef INT_LEAST32_TYPE
607 #define INT_LEAST32_TYPE ((const char *) NULL)
608 #endif
610 #ifndef INT_LEAST64_TYPE
611 #define INT_LEAST64_TYPE ((const char *) NULL)
612 #endif
614 #ifndef UINT_LEAST8_TYPE
615 #define UINT_LEAST8_TYPE ((const char *) NULL)
616 #endif
618 #ifndef UINT_LEAST16_TYPE
619 #define UINT_LEAST16_TYPE ((const char *) NULL)
620 #endif
622 #ifndef UINT_LEAST32_TYPE
623 #define UINT_LEAST32_TYPE ((const char *) NULL)
624 #endif
626 #ifndef UINT_LEAST64_TYPE
627 #define UINT_LEAST64_TYPE ((const char *) NULL)
628 #endif
630 #ifndef INT_FAST8_TYPE
631 #define INT_FAST8_TYPE ((const char *) NULL)
632 #endif
634 #ifndef INT_FAST16_TYPE
635 #define INT_FAST16_TYPE ((const char *) NULL)
636 #endif
638 #ifndef INT_FAST32_TYPE
639 #define INT_FAST32_TYPE ((const char *) NULL)
640 #endif
642 #ifndef INT_FAST64_TYPE
643 #define INT_FAST64_TYPE ((const char *) NULL)
644 #endif
646 #ifndef UINT_FAST8_TYPE
647 #define UINT_FAST8_TYPE ((const char *) NULL)
648 #endif
650 #ifndef UINT_FAST16_TYPE
651 #define UINT_FAST16_TYPE ((const char *) NULL)
652 #endif
654 #ifndef UINT_FAST32_TYPE
655 #define UINT_FAST32_TYPE ((const char *) NULL)
656 #endif
658 #ifndef UINT_FAST64_TYPE
659 #define UINT_FAST64_TYPE ((const char *) NULL)
660 #endif
662 #ifndef INTPTR_TYPE
663 #define INTPTR_TYPE ((const char *) NULL)
664 #endif
666 #ifndef UINTPTR_TYPE
667 #define UINTPTR_TYPE ((const char *) NULL)
668 #endif
670 /* Width in bits of a pointer. Mind the value of the macro `Pmode'. */
671 #ifndef POINTER_SIZE
672 #define POINTER_SIZE BITS_PER_WORD
673 #endif
675 #ifndef PIC_OFFSET_TABLE_REGNUM
676 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
677 #endif
679 #ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES
680 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0
681 #endif
683 #ifndef TARGET_DECLSPEC
684 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
685 /* If the target supports the "dllimport" attribute, users are
686 probably used to the "__declspec" syntax. */
687 #define TARGET_DECLSPEC 1
688 #else
689 #define TARGET_DECLSPEC 0
690 #endif
691 #endif
693 /* By default, the preprocessor should be invoked the same way in C++
694 as in C. */
695 #ifndef CPLUSPLUS_CPP_SPEC
696 #ifdef CPP_SPEC
697 #define CPLUSPLUS_CPP_SPEC CPP_SPEC
698 #endif
699 #endif
701 #ifndef ACCUMULATE_OUTGOING_ARGS
702 #define ACCUMULATE_OUTGOING_ARGS 0
703 #endif
705 /* Supply a default definition for PUSH_ARGS. */
706 #ifndef PUSH_ARGS
707 #ifdef PUSH_ROUNDING
708 #define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
709 #else
710 #define PUSH_ARGS 0
711 #endif
712 #endif
714 /* Decide whether a function's arguments should be processed
715 from first to last or from last to first.
717 They should if the stack and args grow in opposite directions, but
718 only if we have push insns. */
720 #ifdef PUSH_ROUNDING
722 #ifndef PUSH_ARGS_REVERSED
723 #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
724 #define PUSH_ARGS_REVERSED PUSH_ARGS
725 #endif
726 #endif
728 #endif
730 #ifndef PUSH_ARGS_REVERSED
731 #define PUSH_ARGS_REVERSED 0
732 #endif
734 /* Default value for the alignment (in bits) a C conformant malloc has to
735 provide. This default is intended to be safe and always correct. */
736 #ifndef MALLOC_ABI_ALIGNMENT
737 #define MALLOC_ABI_ALIGNMENT BITS_PER_WORD
738 #endif
740 /* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY.
741 STACK_BOUNDARY is required. */
742 #ifndef PREFERRED_STACK_BOUNDARY
743 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
744 #endif
746 /* Set INCOMING_STACK_BOUNDARY to PREFERRED_STACK_BOUNDARY if it is not
747 defined. */
748 #ifndef INCOMING_STACK_BOUNDARY
749 #define INCOMING_STACK_BOUNDARY PREFERRED_STACK_BOUNDARY
750 #endif
752 #ifndef TARGET_DEFAULT_PACK_STRUCT
753 #define TARGET_DEFAULT_PACK_STRUCT 0
754 #endif
756 /* By default, the C++ compiler will use function addresses in the
757 vtable entries. Setting this nonzero tells the compiler to use
758 function descriptors instead. The value of this macro says how
759 many words wide the descriptor is (normally 2). It is assumed
760 that the address of a function descriptor may be treated as a
761 pointer to a function. */
762 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
763 #define TARGET_VTABLE_USES_DESCRIPTORS 0
764 #endif
766 /* By default, the vtable entries are void pointers, the so the alignment
767 is the same as pointer alignment. The value of this macro specifies
768 the alignment of the vtable entry in bits. It should be defined only
769 when special alignment is necessary. */
770 #ifndef TARGET_VTABLE_ENTRY_ALIGN
771 #define TARGET_VTABLE_ENTRY_ALIGN POINTER_SIZE
772 #endif
774 /* There are a few non-descriptor entries in the vtable at offsets below
775 zero. If these entries must be padded (say, to preserve the alignment
776 specified by TARGET_VTABLE_ENTRY_ALIGN), set this to the number of
777 words in each data entry. */
778 #ifndef TARGET_VTABLE_DATA_ENTRY_DISTANCE
779 #define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1
780 #endif
782 /* Decide whether it is safe to use a local alias for a virtual function
783 when constructing thunks. */
784 #ifndef TARGET_USE_LOCAL_THUNK_ALIAS_P
785 #ifdef ASM_OUTPUT_DEF
786 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 1
787 #else
788 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 0
789 #endif
790 #endif
792 /* Select a format to encode pointers in exception handling data. We
793 prefer those that result in fewer dynamic relocations. Assume no
794 special support here and encode direct references. */
795 #ifndef ASM_PREFERRED_EH_DATA_FORMAT
796 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) DW_EH_PE_absptr
797 #endif
799 /* By default, the C++ compiler will use the lowest bit of the pointer
800 to function to indicate a pointer-to-member-function points to a
801 virtual member function. However, if FUNCTION_BOUNDARY indicates
802 function addresses aren't always even, the lowest bit of the delta
803 field will be used. */
804 #ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION
805 #define TARGET_PTRMEMFUNC_VBIT_LOCATION \
806 (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \
807 ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta)
808 #endif
810 #ifndef DEFAULT_GDB_EXTENSIONS
811 #define DEFAULT_GDB_EXTENSIONS 1
812 #endif
814 /* If more than one debugging type is supported, you must define
815 PREFERRED_DEBUGGING_TYPE to choose the default. */
817 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) \
818 + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
819 + defined (VMS_DEBUGGING_INFO))
820 #ifndef PREFERRED_DEBUGGING_TYPE
821 #error You must define PREFERRED_DEBUGGING_TYPE
822 #endif /* no PREFERRED_DEBUGGING_TYPE */
824 /* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE
825 here so other code needn't care. */
826 #elif defined DBX_DEBUGGING_INFO
827 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
829 #elif defined SDB_DEBUGGING_INFO
830 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
832 #elif defined DWARF2_DEBUGGING_INFO
833 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
835 #elif defined VMS_DEBUGGING_INFO
836 #define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
838 #elif defined XCOFF_DEBUGGING_INFO
839 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
841 #else
842 /* No debugging format is supported by this target. */
843 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
844 #endif
846 #ifndef LARGEST_EXPONENT_IS_NORMAL
847 #define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
848 #endif
850 #ifndef ROUND_TOWARDS_ZERO
851 #define ROUND_TOWARDS_ZERO 0
852 #endif
854 #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
855 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false
856 #endif
858 /* True if the targets integer-comparison functions return { 0, 1, 2
859 } to indicate { <, ==, > }. False if { -1, 0, 1 } is used
860 instead. The libgcc routines are biased. */
861 #ifndef TARGET_LIB_INT_CMP_BIASED
862 #define TARGET_LIB_INT_CMP_BIASED (true)
863 #endif
865 /* If FLOAT_WORDS_BIG_ENDIAN is not defined in the header files,
866 then the word-endianness is the same as for integers. */
867 #ifndef FLOAT_WORDS_BIG_ENDIAN
868 #define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
869 #endif
871 #ifdef TARGET_FLT_EVAL_METHOD
872 #define TARGET_FLT_EVAL_METHOD_NON_DEFAULT 1
873 #else
874 #define TARGET_FLT_EVAL_METHOD 0
875 #define TARGET_FLT_EVAL_METHOD_NON_DEFAULT 0
876 #endif
878 #ifndef TARGET_DEC_EVAL_METHOD
879 #define TARGET_DEC_EVAL_METHOD 2
880 #endif
882 #ifndef HOT_TEXT_SECTION_NAME
883 #define HOT_TEXT_SECTION_NAME ".text.hot"
884 #endif
886 #ifndef UNLIKELY_EXECUTED_TEXT_SECTION_NAME
887 #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
888 #endif
890 #ifndef HAS_LONG_COND_BRANCH
891 #define HAS_LONG_COND_BRANCH 0
892 #endif
894 #ifndef HAS_LONG_UNCOND_BRANCH
895 #define HAS_LONG_UNCOND_BRANCH 0
896 #endif
898 /* By default, only attempt to parallelize bitwise operations, and
899 possibly adds/subtracts using bit-twiddling. */
900 #ifndef UNITS_PER_SIMD_WORD
901 #define UNITS_PER_SIMD_WORD(MODE) UNITS_PER_WORD
902 #endif
904 /* Determine whether __cxa_atexit, rather than atexit, is used to
905 register C++ destructors for local statics and global objects. */
906 #ifndef DEFAULT_USE_CXA_ATEXIT
907 #define DEFAULT_USE_CXA_ATEXIT 0
908 #endif
910 /* If none of these macros are defined, the port must use the new
911 technique of defining constraints in the machine description.
912 tm_p.h will define those macros that machine-independent code
913 still uses. */
914 #if !defined CONSTRAINT_LEN \
915 && !defined REG_CLASS_FROM_LETTER \
916 && !defined REG_CLASS_FROM_CONSTRAINT \
917 && !defined CONST_OK_FOR_LETTER_P \
918 && !defined CONST_OK_FOR_CONSTRAINT_P \
919 && !defined CONST_DOUBLE_OK_FOR_LETTER_P \
920 && !defined CONST_DOUBLE_OK_FOR_CONSTRAINT_P \
921 && !defined EXTRA_CONSTRAINT \
922 && !defined EXTRA_CONSTRAINT_STR \
923 && !defined EXTRA_MEMORY_CONSTRAINT \
924 && !defined EXTRA_ADDRESS_CONSTRAINT
926 #define USE_MD_CONSTRAINTS
928 #if GCC_VERSION >= 3000 && defined IN_GCC
929 /* These old constraint macros shouldn't appear anywhere in a
930 configuration using MD constraint definitions. */
931 #pragma GCC poison REG_CLASS_FROM_LETTER CONST_OK_FOR_LETTER_P \
932 CONST_DOUBLE_OK_FOR_LETTER_P EXTRA_CONSTRAINT
933 #endif
935 #else /* old constraint mechanism in use */
937 /* Determine whether extra constraint letter should be handled
938 via address reload (like 'o'). */
939 #ifndef EXTRA_MEMORY_CONSTRAINT
940 #define EXTRA_MEMORY_CONSTRAINT(C,STR) 0
941 #endif
943 /* Determine whether extra constraint letter should be handled
944 as an address (like 'p'). */
945 #ifndef EXTRA_ADDRESS_CONSTRAINT
946 #define EXTRA_ADDRESS_CONSTRAINT(C,STR) 0
947 #endif
949 /* When a port defines CONSTRAINT_LEN, it should use DEFAULT_CONSTRAINT_LEN
950 for all the characters that it does not want to change, so things like the
951 'length' of a digit in a matching constraint is an implementation detail,
952 and not part of the interface. */
953 #define DEFAULT_CONSTRAINT_LEN(C,STR) 1
955 #ifndef CONSTRAINT_LEN
956 #define CONSTRAINT_LEN(C,STR) DEFAULT_CONSTRAINT_LEN (C, STR)
957 #endif
959 #if defined (CONST_OK_FOR_LETTER_P) && ! defined (CONST_OK_FOR_CONSTRAINT_P)
960 #define CONST_OK_FOR_CONSTRAINT_P(VAL,C,STR) CONST_OK_FOR_LETTER_P (VAL, C)
961 #endif
963 #if defined (CONST_DOUBLE_OK_FOR_LETTER_P) && ! defined (CONST_DOUBLE_OK_FOR_CONSTRAINT_P)
964 #define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(OP,C,STR) \
965 CONST_DOUBLE_OK_FOR_LETTER_P (OP, C)
966 #endif
968 #ifndef REG_CLASS_FROM_CONSTRAINT
969 #define REG_CLASS_FROM_CONSTRAINT(C,STR) REG_CLASS_FROM_LETTER (C)
970 #endif
972 #if defined (EXTRA_CONSTRAINT) && ! defined (EXTRA_CONSTRAINT_STR)
973 #define EXTRA_CONSTRAINT_STR(OP, C,STR) EXTRA_CONSTRAINT (OP, C)
974 #endif
976 #endif /* old constraint mechanism in use */
978 #ifndef REGISTER_MOVE_COST
979 #define REGISTER_MOVE_COST(m, x, y) 2
980 #endif
982 /* Determine whether the entire c99 runtime
983 is present in the runtime library. */
984 #ifndef TARGET_C99_FUNCTIONS
985 #define TARGET_C99_FUNCTIONS 0
986 #endif
988 /* Determine whether the target runtime library has
989 a sincos implementation following the GNU extension. */
990 #ifndef TARGET_HAS_SINCOS
991 #define TARGET_HAS_SINCOS 0
992 #endif
994 /* Indicate that CLZ and CTZ are undefined at zero. */
995 #ifndef CLZ_DEFINED_VALUE_AT_ZERO
996 #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0
997 #endif
998 #ifndef CTZ_DEFINED_VALUE_AT_ZERO
999 #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0
1000 #endif
1002 /* Provide a default value for STORE_FLAG_VALUE. */
1003 #ifndef STORE_FLAG_VALUE
1004 #define STORE_FLAG_VALUE 1
1005 #endif
1007 /* This macro is used to determine what the largest unit size that
1008 move_by_pieces can use is. */
1010 /* MOVE_MAX_PIECES is the number of bytes at a time which we can
1011 move efficiently, as opposed to MOVE_MAX which is the maximum
1012 number of bytes we can move with a single instruction. */
1014 #ifndef MOVE_MAX_PIECES
1015 #define MOVE_MAX_PIECES MOVE_MAX
1016 #endif
1018 #ifndef STACK_POINTER_OFFSET
1019 #define STACK_POINTER_OFFSET 0
1020 #endif
1022 #ifndef LOCAL_REGNO
1023 #define LOCAL_REGNO(REGNO) 0
1024 #endif
1026 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1027 the stack pointer does not matter. The value is tested only in
1028 functions that have frame pointers. */
1029 #ifndef EXIT_IGNORE_STACK
1030 #define EXIT_IGNORE_STACK 0
1031 #endif
1033 /* Assume that case vectors are not pc-relative. */
1034 #ifndef CASE_VECTOR_PC_RELATIVE
1035 #define CASE_VECTOR_PC_RELATIVE 0
1036 #endif
1038 /* Assume that trampolines need function alignment. */
1039 #ifndef TRAMPOLINE_ALIGNMENT
1040 #define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
1041 #endif
1043 /* Register mappings for target machines without register windows. */
1044 #ifndef INCOMING_REGNO
1045 #define INCOMING_REGNO(N) (N)
1046 #endif
1048 #ifndef OUTGOING_REGNO
1049 #define OUTGOING_REGNO(N) (N)
1050 #endif
1052 #ifndef SHIFT_COUNT_TRUNCATED
1053 #define SHIFT_COUNT_TRUNCATED 0
1054 #endif
1056 #ifndef LEGITIMATE_PIC_OPERAND_P
1057 #define LEGITIMATE_PIC_OPERAND_P(X) 1
1058 #endif
1060 #ifndef TARGET_MEM_CONSTRAINT
1061 #define TARGET_MEM_CONSTRAINT 'm'
1062 #endif
1064 #ifndef REVERSIBLE_CC_MODE
1065 #define REVERSIBLE_CC_MODE(MODE) 0
1066 #endif
1068 /* Biggest alignment supported by the object file format of this machine. */
1069 #ifndef MAX_OFILE_ALIGNMENT
1070 #define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
1071 #endif
1073 #ifndef FRAME_GROWS_DOWNWARD
1074 #define FRAME_GROWS_DOWNWARD 0
1075 #endif
1077 /* On most machines, the CFA coincides with the first incoming parm. */
1078 #ifndef ARG_POINTER_CFA_OFFSET
1079 #define ARG_POINTER_CFA_OFFSET(FNDECL) FIRST_PARM_OFFSET (FNDECL)
1080 #endif
1082 /* On most machines, we use the CFA as DW_AT_frame_base. */
1083 #ifndef CFA_FRAME_BASE_OFFSET
1084 #define CFA_FRAME_BASE_OFFSET(FNDECL) 0
1085 #endif
1087 /* The offset from the incoming value of %sp to the top of the stack frame
1088 for the current function. */
1089 #ifndef INCOMING_FRAME_SP_OFFSET
1090 #define INCOMING_FRAME_SP_OFFSET 0
1091 #endif
1093 #ifndef HARD_REGNO_NREGS_HAS_PADDING
1094 #define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE) 0
1095 #define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) -1
1096 #endif
1098 #ifndef OUTGOING_REG_PARM_STACK_SPACE
1099 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 0
1100 #endif
1102 /* MAX_STACK_ALIGNMENT is the maximum stack alignment guaranteed by
1103 the backend. MAX_SUPPORTED_STACK_ALIGNMENT is the maximum best
1104 effort stack alignment supported by the backend. If the backend
1105 supports stack alignment, MAX_SUPPORTED_STACK_ALIGNMENT and
1106 MAX_STACK_ALIGNMENT are the same. Otherwise, the incoming stack
1107 boundary will limit the maximum guaranteed stack alignment. */
1108 #ifdef MAX_STACK_ALIGNMENT
1109 #define MAX_SUPPORTED_STACK_ALIGNMENT MAX_STACK_ALIGNMENT
1110 #else
1111 #define MAX_STACK_ALIGNMENT STACK_BOUNDARY
1112 #define MAX_SUPPORTED_STACK_ALIGNMENT PREFERRED_STACK_BOUNDARY
1113 #endif
1115 #define SUPPORTS_STACK_ALIGNMENT (MAX_STACK_ALIGNMENT > STACK_BOUNDARY)
1117 #ifndef LOCAL_ALIGNMENT
1118 #define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
1119 #endif
1121 #ifndef STACK_SLOT_ALIGNMENT
1122 #define STACK_SLOT_ALIGNMENT(TYPE,MODE,ALIGN) \
1123 ((TYPE) ? LOCAL_ALIGNMENT ((TYPE), (ALIGN)) : (ALIGN))
1124 #endif
1126 #ifndef LOCAL_DECL_ALIGNMENT
1127 #define LOCAL_DECL_ALIGNMENT(DECL) \
1128 LOCAL_ALIGNMENT (TREE_TYPE (DECL), DECL_ALIGN (DECL))
1129 #endif
1131 /* Alignment value for attribute ((aligned)). */
1132 #ifndef ATTRIBUTE_ALIGNED_VALUE
1133 #define ATTRIBUTE_ALIGNED_VALUE BIGGEST_ALIGNMENT
1134 #endif
1136 /* Many ports have no mode-dependent addresses (except possibly autoincrement
1137 and autodecrement addresses, which are handled by target-independent code
1138 in recog.c). */
1139 #ifndef GO_IF_MODE_DEPENDENT_ADDRESS
1140 #define GO_IF_MODE_DEPENDENT_ADDRESS(X, WIN)
1141 #endif
1143 #ifndef FRAME_POINTER_REQUIRED
1144 #define FRAME_POINTER_REQUIRED false
1145 #endif
1147 #endif /* ! GCC_DEFAULTS_H */