2010-07-06 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / defaults.h
blobeb74033657b362cc0822d4a4073476f7f3d7f02d
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, 2010
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 /* Store in OUTPUT a string (made with alloca) containing an
36 assembler-name for a local static variable or function named NAME.
37 LABELNO is an integer which is different for each call. */
39 #ifndef ASM_PN_FORMAT
40 # ifndef NO_DOT_IN_LABEL
41 # define ASM_PN_FORMAT "%s.%lu"
42 # else
43 # ifndef NO_DOLLAR_IN_LABEL
44 # define ASM_PN_FORMAT "%s$%lu"
45 # else
46 # define ASM_PN_FORMAT "__%s_%lu"
47 # endif
48 # endif
49 #endif /* ! ASM_PN_FORMAT */
51 #ifndef ASM_FORMAT_PRIVATE_NAME
52 # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
53 do { const char *const name_ = (NAME); \
54 char *const output_ = (OUTPUT) = \
55 (char *) alloca (strlen (name_) + 32); \
56 sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
57 } while (0)
58 #endif
60 /* Choose a reasonable default for ASM_OUTPUT_ASCII. */
62 #ifndef ASM_OUTPUT_ASCII
63 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
64 do { \
65 FILE *_hide_asm_out_file = (MYFILE); \
66 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
67 int _hide_thissize = (MYLENGTH); \
68 { \
69 FILE *asm_out_file = _hide_asm_out_file; \
70 const unsigned char *p = _hide_p; \
71 int thissize = _hide_thissize; \
72 int i; \
73 fprintf (asm_out_file, "\t.ascii \""); \
75 for (i = 0; i < thissize; i++) \
76 { \
77 int c = p[i]; \
78 if (c == '\"' || c == '\\') \
79 putc ('\\', asm_out_file); \
80 if (ISPRINT(c)) \
81 putc (c, asm_out_file); \
82 else \
83 { \
84 fprintf (asm_out_file, "\\%o", c); \
85 /* After an octal-escape, if a digit follows, \
86 terminate one string constant and start another. \
87 The VAX assembler fails to stop reading the escape \
88 after three digits, so this is the only way we \
89 can get it to parse the data properly. */ \
90 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
91 fprintf (asm_out_file, "\"\n\t.ascii \""); \
92 } \
93 } \
94 fprintf (asm_out_file, "\"\n"); \
95 } \
96 } \
97 while (0)
98 #endif
100 /* This is how we tell the assembler to equate two values. */
101 #ifdef SET_ASM_OP
102 #ifndef ASM_OUTPUT_DEF
103 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
104 do { fprintf ((FILE), "%s", SET_ASM_OP); \
105 assemble_name (FILE, LABEL1); \
106 fprintf (FILE, ","); \
107 assemble_name (FILE, LABEL2); \
108 fprintf (FILE, "\n"); \
109 } while (0)
110 #endif
111 #endif
113 #ifndef TLS_COMMON_ASM_OP
114 #define TLS_COMMON_ASM_OP ".tls_common"
115 #endif
117 #if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON)
118 #define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \
119 do \
121 fprintf ((FILE), "\t%s\t", TLS_COMMON_ASM_OP); \
122 assemble_name ((FILE), (NAME)); \
123 fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
124 (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT); \
126 while (0)
127 #endif
129 /* Decide whether to defer emitting the assembler output for an equate
130 of two values. The default is to not defer output. */
131 #ifndef TARGET_DEFERRED_OUTPUT_DEFS
132 #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) false
133 #endif
135 /* This is how to output the definition of a user-level label named
136 NAME, such as the label on a static function or variable NAME. */
138 #ifndef ASM_OUTPUT_LABEL
139 #define ASM_OUTPUT_LABEL(FILE,NAME) \
140 do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
141 #endif
143 /* Output the definition of a compiler-generated label named NAME. */
144 #ifndef ASM_OUTPUT_INTERNAL_LABEL
145 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
146 do { \
147 assemble_name_raw ((FILE), (NAME)); \
148 fputs (":\n", (FILE)); \
149 } while (0)
150 #endif
152 /* This is how to output a reference to a user-level label named NAME. */
154 #ifndef ASM_OUTPUT_LABELREF
155 #define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
156 #endif
158 /* Allow target to print debug info labels specially. This is useful for
159 VLIW targets, since debug info labels should go into the middle of
160 instruction bundles instead of breaking them. */
162 #ifndef ASM_OUTPUT_DEBUG_LABEL
163 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
164 (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM)
165 #endif
167 /* This is how we tell the assembler that a symbol is weak. */
168 #ifndef ASM_OUTPUT_WEAK_ALIAS
169 #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
170 #define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \
171 do \
173 ASM_WEAKEN_LABEL (STREAM, NAME); \
174 if (VALUE) \
175 ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \
177 while (0)
178 #endif
179 #endif
181 /* This is how we tell the assembler that a symbol is a weak alias to
182 another symbol that doesn't require the other symbol to be defined.
183 Uses of the former will turn into weak uses of the latter, i.e.,
184 uses that, in case the latter is undefined, will not cause errors,
185 and will add it to the symbol table as weak undefined. However, if
186 the latter is referenced directly, a strong reference prevails. */
187 #ifndef ASM_OUTPUT_WEAKREF
188 #if defined HAVE_GAS_WEAKREF
189 #define ASM_OUTPUT_WEAKREF(FILE, DECL, NAME, VALUE) \
190 do \
192 fprintf ((FILE), "\t.weakref\t"); \
193 assemble_name ((FILE), (NAME)); \
194 fprintf ((FILE), ","); \
195 assemble_name ((FILE), (VALUE)); \
196 fprintf ((FILE), "\n"); \
198 while (0)
199 #endif
200 #endif
202 /* How to emit a .type directive. */
203 #ifndef ASM_OUTPUT_TYPE_DIRECTIVE
204 #if defined TYPE_ASM_OP && defined TYPE_OPERAND_FMT
205 #define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) \
206 do \
208 fputs (TYPE_ASM_OP, STREAM); \
209 assemble_name (STREAM, NAME); \
210 fputs (", ", STREAM); \
211 fprintf (STREAM, TYPE_OPERAND_FMT, TYPE); \
212 putc ('\n', STREAM); \
214 while (0)
215 #endif
216 #endif
218 /* How to emit a .size directive. */
219 #ifndef ASM_OUTPUT_SIZE_DIRECTIVE
220 #ifdef SIZE_ASM_OP
221 #define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE) \
222 do \
224 HOST_WIDE_INT size_ = (SIZE); \
225 fputs (SIZE_ASM_OP, STREAM); \
226 assemble_name (STREAM, NAME); \
227 fprintf (STREAM, ", " HOST_WIDE_INT_PRINT_DEC "\n", size_); \
229 while (0)
231 #define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME) \
232 do \
234 fputs (SIZE_ASM_OP, STREAM); \
235 assemble_name (STREAM, NAME); \
236 fputs (", .-", STREAM); \
237 assemble_name (STREAM, NAME); \
238 putc ('\n', STREAM); \
240 while (0)
242 #endif
243 #endif
245 /* This determines whether or not we support weak symbols. */
246 #ifndef SUPPORTS_WEAK
247 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
248 #define SUPPORTS_WEAK 1
249 #else
250 #define SUPPORTS_WEAK 0
251 #endif
252 #endif
254 /* This determines whether or not we support the discriminator
255 attribute in the .loc directive. */
256 #ifndef SUPPORTS_DISCRIMINATOR
257 #ifdef HAVE_GAS_DISCRIMINATOR
258 #define SUPPORTS_DISCRIMINATOR 1
259 #else
260 #define SUPPORTS_DISCRIMINATOR 0
261 #endif
262 #endif
264 /* This determines whether or not we support link-once semantics. */
265 #ifndef SUPPORTS_ONE_ONLY
266 #ifdef MAKE_DECL_ONE_ONLY
267 #define SUPPORTS_ONE_ONLY 1
268 #else
269 #define SUPPORTS_ONE_ONLY 0
270 #endif
271 #endif
273 /* This determines whether weak symbols must be left out of a static
274 archive's table of contents. Defining this macro to be nonzero has
275 the consequence that certain symbols will not be made weak that
276 otherwise would be. The C++ ABI requires this macro to be zero;
277 see the documentation. */
278 #ifndef TARGET_WEAK_NOT_IN_ARCHIVE_TOC
279 #define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 0
280 #endif
282 /* This determines whether or not we need linkonce unwind information. */
283 #ifndef TARGET_USES_WEAK_UNWIND_INFO
284 #define TARGET_USES_WEAK_UNWIND_INFO 0
285 #endif
287 /* By default, there is no prefix on user-defined symbols. */
288 #ifndef USER_LABEL_PREFIX
289 #define USER_LABEL_PREFIX ""
290 #endif
292 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
293 provide a weak attribute. Else define it to nothing.
295 This would normally belong in ansidecl.h, but SUPPORTS_WEAK is
296 not available at that time.
298 Note, this is only for use by target files which we know are to be
299 compiled by GCC. */
300 #ifndef TARGET_ATTRIBUTE_WEAK
301 # if SUPPORTS_WEAK
302 # define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
303 # else
304 # define TARGET_ATTRIBUTE_WEAK
305 # endif
306 #endif
308 /* Determines whether we may use common symbols to represent one-only
309 semantics (a.k.a. "vague linkage"). */
310 #ifndef USE_COMMON_FOR_ONE_ONLY
311 # define USE_COMMON_FOR_ONE_ONLY 1
312 #endif
314 /* By default we can assume that all global symbols are in one namespace,
315 across all shared libraries. */
316 #ifndef MULTIPLE_SYMBOL_SPACES
317 # define MULTIPLE_SYMBOL_SPACES 0
318 #endif
320 /* If the target supports init_priority C++ attribute, give
321 SUPPORTS_INIT_PRIORITY a nonzero value. */
322 #ifndef SUPPORTS_INIT_PRIORITY
323 #define SUPPORTS_INIT_PRIORITY 1
324 #endif /* SUPPORTS_INIT_PRIORITY */
326 /* If duplicate library search directories can be removed from a
327 linker command without changing the linker's semantics, give this
328 symbol a nonzero. */
329 #ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
330 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
331 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
333 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
334 the rest of the DWARF 2 frame unwind support is also provided. */
335 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX) \
336 && !defined (TARGET_UNWIND_INFO)
337 #define DWARF2_UNWIND_INFO 1
338 #endif
340 /* If we have named sections, and we're using crtstuff to run ctors,
341 use them for registering eh frame information. */
342 #if defined (TARGET_ASM_NAMED_SECTION) && DWARF2_UNWIND_INFO \
343 && !defined(EH_FRAME_IN_DATA_SECTION)
344 #ifndef EH_FRAME_SECTION_NAME
345 #define EH_FRAME_SECTION_NAME ".eh_frame"
346 #endif
347 #endif
349 /* On many systems, different EH table encodings are used under
350 difference circumstances. Some will require runtime relocations;
351 some will not. For those that do not require runtime relocations,
352 we would like to make the table read-only. However, since the
353 read-only tables may need to be combined with read-write tables
354 that do require runtime relocation, it is not safe to make the
355 tables read-only unless the linker will merge read-only and
356 read-write sections into a single read-write section. If your
357 linker does not have this ability, but your system is such that no
358 encoding used with non-PIC code will ever require a runtime
359 relocation, then you can define EH_TABLES_CAN_BE_READ_ONLY to 1 in
360 your target configuration file. */
361 #ifndef EH_TABLES_CAN_BE_READ_ONLY
362 #ifdef HAVE_LD_RO_RW_SECTION_MIXING
363 #define EH_TABLES_CAN_BE_READ_ONLY 1
364 #else
365 #define EH_TABLES_CAN_BE_READ_ONLY 0
366 #endif
367 #endif
369 /* If we have named section and we support weak symbols, then use the
370 .jcr section for recording java classes which need to be registered
371 at program start-up time. */
372 #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
373 #ifndef JCR_SECTION_NAME
374 #define JCR_SECTION_NAME ".jcr"
375 #endif
376 #endif
378 /* This decision to use a .jcr section can be overridden by defining
379 USE_JCR_SECTION to 0 in target file. This is necessary if target
380 can define JCR_SECTION_NAME but does not have crtstuff or
381 linker support for .jcr section. */
382 #ifndef TARGET_USE_JCR_SECTION
383 #ifdef JCR_SECTION_NAME
384 #define TARGET_USE_JCR_SECTION 1
385 #else
386 #define TARGET_USE_JCR_SECTION 0
387 #endif
388 #endif
390 /* Number of hardware registers that go into the DWARF-2 unwind info.
391 If not defined, equals FIRST_PSEUDO_REGISTER */
393 #ifndef DWARF_FRAME_REGISTERS
394 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
395 #endif
397 /* How to renumber registers for dbx and gdb. If not defined, assume
398 no renumbering is necessary. */
400 #ifndef DBX_REGISTER_NUMBER
401 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
402 #endif
404 /* Default sizes for base C types. If the sizes are different for
405 your target, you should override these values by defining the
406 appropriate symbols in your tm.h file. */
408 #ifndef BITS_PER_UNIT
409 #define BITS_PER_UNIT 8
410 #endif
412 #ifndef BITS_PER_WORD
413 #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
414 #endif
416 #ifndef CHAR_TYPE_SIZE
417 #define CHAR_TYPE_SIZE BITS_PER_UNIT
418 #endif
420 #ifndef BOOL_TYPE_SIZE
421 /* `bool' has size and alignment `1', on almost all platforms. */
422 #define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
423 #endif
425 #ifndef SHORT_TYPE_SIZE
426 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
427 #endif
429 #ifndef INT_TYPE_SIZE
430 #define INT_TYPE_SIZE BITS_PER_WORD
431 #endif
433 #ifndef LONG_TYPE_SIZE
434 #define LONG_TYPE_SIZE BITS_PER_WORD
435 #endif
437 #ifndef LONG_LONG_TYPE_SIZE
438 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
439 #endif
441 #ifndef WCHAR_TYPE_SIZE
442 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
443 #endif
445 #ifndef FLOAT_TYPE_SIZE
446 #define FLOAT_TYPE_SIZE BITS_PER_WORD
447 #endif
449 #ifndef DOUBLE_TYPE_SIZE
450 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
451 #endif
453 #ifndef LONG_DOUBLE_TYPE_SIZE
454 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
455 #endif
457 #ifndef DECIMAL32_TYPE_SIZE
458 #define DECIMAL32_TYPE_SIZE 32
459 #endif
461 #ifndef DECIMAL64_TYPE_SIZE
462 #define DECIMAL64_TYPE_SIZE 64
463 #endif
465 #ifndef DECIMAL128_TYPE_SIZE
466 #define DECIMAL128_TYPE_SIZE 128
467 #endif
469 #ifndef SHORT_FRACT_TYPE_SIZE
470 #define SHORT_FRACT_TYPE_SIZE BITS_PER_UNIT
471 #endif
473 #ifndef FRACT_TYPE_SIZE
474 #define FRACT_TYPE_SIZE (BITS_PER_UNIT * 2)
475 #endif
477 #ifndef LONG_FRACT_TYPE_SIZE
478 #define LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 4)
479 #endif
481 #ifndef LONG_LONG_FRACT_TYPE_SIZE
482 #define LONG_LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 8)
483 #endif
485 #ifndef SHORT_ACCUM_TYPE_SIZE
486 #define SHORT_ACCUM_TYPE_SIZE (SHORT_FRACT_TYPE_SIZE * 2)
487 #endif
489 #ifndef ACCUM_TYPE_SIZE
490 #define ACCUM_TYPE_SIZE (FRACT_TYPE_SIZE * 2)
491 #endif
493 #ifndef LONG_ACCUM_TYPE_SIZE
494 #define LONG_ACCUM_TYPE_SIZE (LONG_FRACT_TYPE_SIZE * 2)
495 #endif
497 #ifndef LONG_LONG_ACCUM_TYPE_SIZE
498 #define LONG_LONG_ACCUM_TYPE_SIZE (LONG_LONG_FRACT_TYPE_SIZE * 2)
499 #endif
501 /* We let tm.h override the types used here, to handle trivial differences
502 such as the choice of unsigned int or long unsigned int for size_t.
503 When machines start needing nontrivial differences in the size type,
504 it would be best to do something here to figure out automatically
505 from other information what type to use. */
507 #ifndef SIZE_TYPE
508 #define SIZE_TYPE "long unsigned int"
509 #endif
511 #ifndef PID_TYPE
512 #define PID_TYPE "int"
513 #endif
515 /* If GCC knows the exact uint_least16_t and uint_least32_t types from
516 <stdint.h>, use them for char16_t and char32_t. Otherwise, use
517 these guesses; getting the wrong type of a given width will not
518 affect C++ name mangling because in C++ these are distinct types
519 not typedefs. */
521 #ifdef UINT_LEAST16_TYPE
522 #define CHAR16_TYPE UINT_LEAST16_TYPE
523 #else
524 #define CHAR16_TYPE "short unsigned int"
525 #endif
527 #ifdef UINT_LEAST32_TYPE
528 #define CHAR32_TYPE UINT_LEAST32_TYPE
529 #else
530 #define CHAR32_TYPE "unsigned int"
531 #endif
533 #ifndef WCHAR_TYPE
534 #define WCHAR_TYPE "int"
535 #endif
537 /* WCHAR_TYPE gets overridden by -fshort-wchar. */
538 #define MODIFIED_WCHAR_TYPE \
539 (flag_short_wchar ? "short unsigned int" : WCHAR_TYPE)
541 #ifndef PTRDIFF_TYPE
542 #define PTRDIFF_TYPE "long int"
543 #endif
545 #ifndef WINT_TYPE
546 #define WINT_TYPE "unsigned int"
547 #endif
549 #ifndef INTMAX_TYPE
550 #define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
551 ? "int" \
552 : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
553 ? "long int" \
554 : "long long int"))
555 #endif
557 #ifndef UINTMAX_TYPE
558 #define UINTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
559 ? "unsigned int" \
560 : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
561 ? "long unsigned int" \
562 : "long long unsigned int"))
563 #endif
566 /* There are no default definitions of these <stdint.h> types. */
568 #ifndef SIG_ATOMIC_TYPE
569 #define SIG_ATOMIC_TYPE ((const char *) NULL)
570 #endif
572 #ifndef INT8_TYPE
573 #define INT8_TYPE ((const char *) NULL)
574 #endif
576 #ifndef INT16_TYPE
577 #define INT16_TYPE ((const char *) NULL)
578 #endif
580 #ifndef INT32_TYPE
581 #define INT32_TYPE ((const char *) NULL)
582 #endif
584 #ifndef INT64_TYPE
585 #define INT64_TYPE ((const char *) NULL)
586 #endif
588 #ifndef UINT8_TYPE
589 #define UINT8_TYPE ((const char *) NULL)
590 #endif
592 #ifndef UINT16_TYPE
593 #define UINT16_TYPE ((const char *) NULL)
594 #endif
596 #ifndef UINT32_TYPE
597 #define UINT32_TYPE ((const char *) NULL)
598 #endif
600 #ifndef UINT64_TYPE
601 #define UINT64_TYPE ((const char *) NULL)
602 #endif
604 #ifndef INT_LEAST8_TYPE
605 #define INT_LEAST8_TYPE ((const char *) NULL)
606 #endif
608 #ifndef INT_LEAST16_TYPE
609 #define INT_LEAST16_TYPE ((const char *) NULL)
610 #endif
612 #ifndef INT_LEAST32_TYPE
613 #define INT_LEAST32_TYPE ((const char *) NULL)
614 #endif
616 #ifndef INT_LEAST64_TYPE
617 #define INT_LEAST64_TYPE ((const char *) NULL)
618 #endif
620 #ifndef UINT_LEAST8_TYPE
621 #define UINT_LEAST8_TYPE ((const char *) NULL)
622 #endif
624 #ifndef UINT_LEAST16_TYPE
625 #define UINT_LEAST16_TYPE ((const char *) NULL)
626 #endif
628 #ifndef UINT_LEAST32_TYPE
629 #define UINT_LEAST32_TYPE ((const char *) NULL)
630 #endif
632 #ifndef UINT_LEAST64_TYPE
633 #define UINT_LEAST64_TYPE ((const char *) NULL)
634 #endif
636 #ifndef INT_FAST8_TYPE
637 #define INT_FAST8_TYPE ((const char *) NULL)
638 #endif
640 #ifndef INT_FAST16_TYPE
641 #define INT_FAST16_TYPE ((const char *) NULL)
642 #endif
644 #ifndef INT_FAST32_TYPE
645 #define INT_FAST32_TYPE ((const char *) NULL)
646 #endif
648 #ifndef INT_FAST64_TYPE
649 #define INT_FAST64_TYPE ((const char *) NULL)
650 #endif
652 #ifndef UINT_FAST8_TYPE
653 #define UINT_FAST8_TYPE ((const char *) NULL)
654 #endif
656 #ifndef UINT_FAST16_TYPE
657 #define UINT_FAST16_TYPE ((const char *) NULL)
658 #endif
660 #ifndef UINT_FAST32_TYPE
661 #define UINT_FAST32_TYPE ((const char *) NULL)
662 #endif
664 #ifndef UINT_FAST64_TYPE
665 #define UINT_FAST64_TYPE ((const char *) NULL)
666 #endif
668 #ifndef INTPTR_TYPE
669 #define INTPTR_TYPE ((const char *) NULL)
670 #endif
672 #ifndef UINTPTR_TYPE
673 #define UINTPTR_TYPE ((const char *) NULL)
674 #endif
676 /* Width in bits of a pointer. Mind the value of the macro `Pmode'. */
677 #ifndef POINTER_SIZE
678 #define POINTER_SIZE BITS_PER_WORD
679 #endif
681 #ifndef PIC_OFFSET_TABLE_REGNUM
682 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
683 #endif
685 #ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES
686 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0
687 #endif
689 #ifndef TARGET_DECLSPEC
690 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
691 /* If the target supports the "dllimport" attribute, users are
692 probably used to the "__declspec" syntax. */
693 #define TARGET_DECLSPEC 1
694 #else
695 #define TARGET_DECLSPEC 0
696 #endif
697 #endif
699 /* By default, the preprocessor should be invoked the same way in C++
700 as in C. */
701 #ifndef CPLUSPLUS_CPP_SPEC
702 #ifdef CPP_SPEC
703 #define CPLUSPLUS_CPP_SPEC CPP_SPEC
704 #endif
705 #endif
707 #ifndef ACCUMULATE_OUTGOING_ARGS
708 #define ACCUMULATE_OUTGOING_ARGS 0
709 #endif
711 /* Supply a default definition for PUSH_ARGS. */
712 #ifndef PUSH_ARGS
713 #ifdef PUSH_ROUNDING
714 #define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
715 #else
716 #define PUSH_ARGS 0
717 #endif
718 #endif
720 /* Decide whether a function's arguments should be processed
721 from first to last or from last to first.
723 They should if the stack and args grow in opposite directions, but
724 only if we have push insns. */
726 #ifdef PUSH_ROUNDING
728 #ifndef PUSH_ARGS_REVERSED
729 #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
730 #define PUSH_ARGS_REVERSED PUSH_ARGS
731 #endif
732 #endif
734 #endif
736 #ifndef PUSH_ARGS_REVERSED
737 #define PUSH_ARGS_REVERSED 0
738 #endif
740 /* Default value for the alignment (in bits) a C conformant malloc has to
741 provide. This default is intended to be safe and always correct. */
742 #ifndef MALLOC_ABI_ALIGNMENT
743 #define MALLOC_ABI_ALIGNMENT BITS_PER_WORD
744 #endif
746 /* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY.
747 STACK_BOUNDARY is required. */
748 #ifndef PREFERRED_STACK_BOUNDARY
749 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
750 #endif
752 /* Set INCOMING_STACK_BOUNDARY to PREFERRED_STACK_BOUNDARY if it is not
753 defined. */
754 #ifndef INCOMING_STACK_BOUNDARY
755 #define INCOMING_STACK_BOUNDARY PREFERRED_STACK_BOUNDARY
756 #endif
758 #ifndef TARGET_DEFAULT_PACK_STRUCT
759 #define TARGET_DEFAULT_PACK_STRUCT 0
760 #endif
762 /* By default, the C++ compiler will use function addresses in the
763 vtable entries. Setting this nonzero tells the compiler to use
764 function descriptors instead. The value of this macro says how
765 many words wide the descriptor is (normally 2). It is assumed
766 that the address of a function descriptor may be treated as a
767 pointer to a function. */
768 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
769 #define TARGET_VTABLE_USES_DESCRIPTORS 0
770 #endif
772 /* By default, the vtable entries are void pointers, the so the alignment
773 is the same as pointer alignment. The value of this macro specifies
774 the alignment of the vtable entry in bits. It should be defined only
775 when special alignment is necessary. */
776 #ifndef TARGET_VTABLE_ENTRY_ALIGN
777 #define TARGET_VTABLE_ENTRY_ALIGN POINTER_SIZE
778 #endif
780 /* There are a few non-descriptor entries in the vtable at offsets below
781 zero. If these entries must be padded (say, to preserve the alignment
782 specified by TARGET_VTABLE_ENTRY_ALIGN), set this to the number of
783 words in each data entry. */
784 #ifndef TARGET_VTABLE_DATA_ENTRY_DISTANCE
785 #define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1
786 #endif
788 /* Decide whether it is safe to use a local alias for a virtual function
789 when constructing thunks. */
790 #ifndef TARGET_USE_LOCAL_THUNK_ALIAS_P
791 #ifdef ASM_OUTPUT_DEF
792 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 1
793 #else
794 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 0
795 #endif
796 #endif
798 /* Select a format to encode pointers in exception handling data. We
799 prefer those that result in fewer dynamic relocations. Assume no
800 special support here and encode direct references. */
801 #ifndef ASM_PREFERRED_EH_DATA_FORMAT
802 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) DW_EH_PE_absptr
803 #endif
805 /* By default, the C++ compiler will use the lowest bit of the pointer
806 to function to indicate a pointer-to-member-function points to a
807 virtual member function. However, if FUNCTION_BOUNDARY indicates
808 function addresses aren't always even, the lowest bit of the delta
809 field will be used. */
810 #ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION
811 #define TARGET_PTRMEMFUNC_VBIT_LOCATION \
812 (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \
813 ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta)
814 #endif
816 #ifndef DEFAULT_GDB_EXTENSIONS
817 #define DEFAULT_GDB_EXTENSIONS 1
818 #endif
820 /* If more than one debugging type is supported, you must define
821 PREFERRED_DEBUGGING_TYPE to choose the default. */
823 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) \
824 + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
825 + defined (VMS_DEBUGGING_INFO))
826 #ifndef PREFERRED_DEBUGGING_TYPE
827 #error You must define PREFERRED_DEBUGGING_TYPE
828 #endif /* no PREFERRED_DEBUGGING_TYPE */
830 /* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE
831 here so other code needn't care. */
832 #elif defined DBX_DEBUGGING_INFO
833 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
835 #elif defined SDB_DEBUGGING_INFO
836 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
838 #elif defined DWARF2_DEBUGGING_INFO
839 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
841 #elif defined VMS_DEBUGGING_INFO
842 #define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
844 #elif defined XCOFF_DEBUGGING_INFO
845 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
847 #else
848 /* No debugging format is supported by this target. */
849 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
850 #endif
852 #ifndef LARGEST_EXPONENT_IS_NORMAL
853 #define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
854 #endif
856 #ifndef ROUND_TOWARDS_ZERO
857 #define ROUND_TOWARDS_ZERO 0
858 #endif
860 #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
861 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false
862 #endif
864 /* True if the targets integer-comparison functions return { 0, 1, 2
865 } to indicate { <, ==, > }. False if { -1, 0, 1 } is used
866 instead. The libgcc routines are biased. */
867 #ifndef TARGET_LIB_INT_CMP_BIASED
868 #define TARGET_LIB_INT_CMP_BIASED (true)
869 #endif
871 /* If FLOAT_WORDS_BIG_ENDIAN is not defined in the header files,
872 then the word-endianness is the same as for integers. */
873 #ifndef FLOAT_WORDS_BIG_ENDIAN
874 #define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
875 #endif
877 #ifdef TARGET_FLT_EVAL_METHOD
878 #define TARGET_FLT_EVAL_METHOD_NON_DEFAULT 1
879 #else
880 #define TARGET_FLT_EVAL_METHOD 0
881 #define TARGET_FLT_EVAL_METHOD_NON_DEFAULT 0
882 #endif
884 #ifndef TARGET_DEC_EVAL_METHOD
885 #define TARGET_DEC_EVAL_METHOD 2
886 #endif
888 #ifndef HOT_TEXT_SECTION_NAME
889 #define HOT_TEXT_SECTION_NAME ".text.hot"
890 #endif
892 #ifndef UNLIKELY_EXECUTED_TEXT_SECTION_NAME
893 #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
894 #endif
896 #ifndef HAS_LONG_COND_BRANCH
897 #define HAS_LONG_COND_BRANCH 0
898 #endif
900 #ifndef HAS_LONG_UNCOND_BRANCH
901 #define HAS_LONG_UNCOND_BRANCH 0
902 #endif
904 /* By default, only attempt to parallelize bitwise operations, and
905 possibly adds/subtracts using bit-twiddling. */
906 #ifndef UNITS_PER_SIMD_WORD
907 #define UNITS_PER_SIMD_WORD(MODE) UNITS_PER_WORD
908 #endif
910 /* Determine whether __cxa_atexit, rather than atexit, is used to
911 register C++ destructors for local statics and global objects. */
912 #ifndef DEFAULT_USE_CXA_ATEXIT
913 #define DEFAULT_USE_CXA_ATEXIT 0
914 #endif
916 /* If none of these macros are defined, the port must use the new
917 technique of defining constraints in the machine description.
918 tm_p.h will define those macros that machine-independent code
919 still uses. */
920 #if !defined CONSTRAINT_LEN \
921 && !defined REG_CLASS_FROM_LETTER \
922 && !defined REG_CLASS_FROM_CONSTRAINT \
923 && !defined CONST_OK_FOR_LETTER_P \
924 && !defined CONST_OK_FOR_CONSTRAINT_P \
925 && !defined CONST_DOUBLE_OK_FOR_LETTER_P \
926 && !defined CONST_DOUBLE_OK_FOR_CONSTRAINT_P \
927 && !defined EXTRA_CONSTRAINT \
928 && !defined EXTRA_CONSTRAINT_STR \
929 && !defined EXTRA_MEMORY_CONSTRAINT \
930 && !defined EXTRA_ADDRESS_CONSTRAINT
932 #define USE_MD_CONSTRAINTS
934 #if GCC_VERSION >= 3000 && defined IN_GCC
935 /* These old constraint macros shouldn't appear anywhere in a
936 configuration using MD constraint definitions. */
937 #pragma GCC poison REG_CLASS_FROM_LETTER CONST_OK_FOR_LETTER_P \
938 CONST_DOUBLE_OK_FOR_LETTER_P EXTRA_CONSTRAINT
939 #endif
941 #else /* old constraint mechanism in use */
943 /* Determine whether extra constraint letter should be handled
944 via address reload (like 'o'). */
945 #ifndef EXTRA_MEMORY_CONSTRAINT
946 #define EXTRA_MEMORY_CONSTRAINT(C,STR) 0
947 #endif
949 /* Determine whether extra constraint letter should be handled
950 as an address (like 'p'). */
951 #ifndef EXTRA_ADDRESS_CONSTRAINT
952 #define EXTRA_ADDRESS_CONSTRAINT(C,STR) 0
953 #endif
955 /* When a port defines CONSTRAINT_LEN, it should use DEFAULT_CONSTRAINT_LEN
956 for all the characters that it does not want to change, so things like the
957 'length' of a digit in a matching constraint is an implementation detail,
958 and not part of the interface. */
959 #define DEFAULT_CONSTRAINT_LEN(C,STR) 1
961 #ifndef CONSTRAINT_LEN
962 #define CONSTRAINT_LEN(C,STR) DEFAULT_CONSTRAINT_LEN (C, STR)
963 #endif
965 #if defined (CONST_OK_FOR_LETTER_P) && ! defined (CONST_OK_FOR_CONSTRAINT_P)
966 #define CONST_OK_FOR_CONSTRAINT_P(VAL,C,STR) CONST_OK_FOR_LETTER_P (VAL, C)
967 #endif
969 #if defined (CONST_DOUBLE_OK_FOR_LETTER_P) && ! defined (CONST_DOUBLE_OK_FOR_CONSTRAINT_P)
970 #define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(OP,C,STR) \
971 CONST_DOUBLE_OK_FOR_LETTER_P (OP, C)
972 #endif
974 #ifndef REG_CLASS_FROM_CONSTRAINT
975 #define REG_CLASS_FROM_CONSTRAINT(C,STR) REG_CLASS_FROM_LETTER (C)
976 #endif
978 #if defined (EXTRA_CONSTRAINT) && ! defined (EXTRA_CONSTRAINT_STR)
979 #define EXTRA_CONSTRAINT_STR(OP, C,STR) EXTRA_CONSTRAINT (OP, C)
980 #endif
982 #endif /* old constraint mechanism in use */
984 /* Determine whether the entire c99 runtime
985 is present in the runtime library. */
986 #ifndef TARGET_C99_FUNCTIONS
987 #define TARGET_C99_FUNCTIONS 0
988 #endif
990 /* Determine whether the target runtime library has
991 a sincos implementation following the GNU extension. */
992 #ifndef TARGET_HAS_SINCOS
993 #define TARGET_HAS_SINCOS 0
994 #endif
996 /* Indicate that CLZ and CTZ are undefined at zero. */
997 #ifndef CLZ_DEFINED_VALUE_AT_ZERO
998 #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0
999 #endif
1000 #ifndef CTZ_DEFINED_VALUE_AT_ZERO
1001 #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0
1002 #endif
1004 /* Provide a default value for STORE_FLAG_VALUE. */
1005 #ifndef STORE_FLAG_VALUE
1006 #define STORE_FLAG_VALUE 1
1007 #endif
1009 /* This macro is used to determine what the largest unit size that
1010 move_by_pieces can use is. */
1012 /* MOVE_MAX_PIECES is the number of bytes at a time which we can
1013 move efficiently, as opposed to MOVE_MAX which is the maximum
1014 number of bytes we can move with a single instruction. */
1016 #ifndef MOVE_MAX_PIECES
1017 #define MOVE_MAX_PIECES MOVE_MAX
1018 #endif
1020 #ifndef STACK_POINTER_OFFSET
1021 #define STACK_POINTER_OFFSET 0
1022 #endif
1024 #ifndef LOCAL_REGNO
1025 #define LOCAL_REGNO(REGNO) 0
1026 #endif
1028 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1029 the stack pointer does not matter. The value is tested only in
1030 functions that have frame pointers. */
1031 #ifndef EXIT_IGNORE_STACK
1032 #define EXIT_IGNORE_STACK 0
1033 #endif
1035 /* Assume that case vectors are not pc-relative. */
1036 #ifndef CASE_VECTOR_PC_RELATIVE
1037 #define CASE_VECTOR_PC_RELATIVE 0
1038 #endif
1040 /* Assume that trampolines need function alignment. */
1041 #ifndef TRAMPOLINE_ALIGNMENT
1042 #define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
1043 #endif
1045 /* Register mappings for target machines without register windows. */
1046 #ifndef INCOMING_REGNO
1047 #define INCOMING_REGNO(N) (N)
1048 #endif
1050 #ifndef OUTGOING_REGNO
1051 #define OUTGOING_REGNO(N) (N)
1052 #endif
1054 #ifndef SHIFT_COUNT_TRUNCATED
1055 #define SHIFT_COUNT_TRUNCATED 0
1056 #endif
1058 #ifndef LEGITIMATE_PIC_OPERAND_P
1059 #define LEGITIMATE_PIC_OPERAND_P(X) 1
1060 #endif
1062 #ifndef TARGET_MEM_CONSTRAINT
1063 #define TARGET_MEM_CONSTRAINT 'm'
1064 #endif
1066 #ifndef REVERSIBLE_CC_MODE
1067 #define REVERSIBLE_CC_MODE(MODE) 0
1068 #endif
1070 /* Biggest alignment supported by the object file format of this machine. */
1071 #ifndef MAX_OFILE_ALIGNMENT
1072 #define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
1073 #endif
1075 #ifndef FRAME_GROWS_DOWNWARD
1076 #define FRAME_GROWS_DOWNWARD 0
1077 #endif
1079 /* On most machines, the CFA coincides with the first incoming parm. */
1080 #ifndef ARG_POINTER_CFA_OFFSET
1081 #define ARG_POINTER_CFA_OFFSET(FNDECL) \
1082 (FIRST_PARM_OFFSET (FNDECL) + crtl->args.pretend_args_size)
1083 #endif
1085 /* On most machines, we use the CFA as DW_AT_frame_base. */
1086 #ifndef CFA_FRAME_BASE_OFFSET
1087 #define CFA_FRAME_BASE_OFFSET(FNDECL) 0
1088 #endif
1090 /* The offset from the incoming value of %sp to the top of the stack frame
1091 for the current function. */
1092 #ifndef INCOMING_FRAME_SP_OFFSET
1093 #define INCOMING_FRAME_SP_OFFSET 0
1094 #endif
1096 #ifndef HARD_REGNO_NREGS_HAS_PADDING
1097 #define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE) 0
1098 #define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) -1
1099 #endif
1101 #ifndef OUTGOING_REG_PARM_STACK_SPACE
1102 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 0
1103 #endif
1105 /* MAX_STACK_ALIGNMENT is the maximum stack alignment guaranteed by
1106 the backend. MAX_SUPPORTED_STACK_ALIGNMENT is the maximum best
1107 effort stack alignment supported by the backend. If the backend
1108 supports stack alignment, MAX_SUPPORTED_STACK_ALIGNMENT and
1109 MAX_STACK_ALIGNMENT are the same. Otherwise, the incoming stack
1110 boundary will limit the maximum guaranteed stack alignment. */
1111 #ifdef MAX_STACK_ALIGNMENT
1112 #define MAX_SUPPORTED_STACK_ALIGNMENT MAX_STACK_ALIGNMENT
1113 #else
1114 #define MAX_STACK_ALIGNMENT STACK_BOUNDARY
1115 #define MAX_SUPPORTED_STACK_ALIGNMENT PREFERRED_STACK_BOUNDARY
1116 #endif
1118 #define SUPPORTS_STACK_ALIGNMENT (MAX_STACK_ALIGNMENT > STACK_BOUNDARY)
1120 #ifndef LOCAL_ALIGNMENT
1121 #define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
1122 #endif
1124 #ifndef STACK_SLOT_ALIGNMENT
1125 #define STACK_SLOT_ALIGNMENT(TYPE,MODE,ALIGN) \
1126 ((TYPE) ? LOCAL_ALIGNMENT ((TYPE), (ALIGN)) : (ALIGN))
1127 #endif
1129 #ifndef LOCAL_DECL_ALIGNMENT
1130 #define LOCAL_DECL_ALIGNMENT(DECL) \
1131 LOCAL_ALIGNMENT (TREE_TYPE (DECL), DECL_ALIGN (DECL))
1132 #endif
1134 #ifndef MINIMUM_ALIGNMENT
1135 #define MINIMUM_ALIGNMENT(EXP,MODE,ALIGN) (ALIGN)
1136 #endif
1138 /* Alignment value for attribute ((aligned)). */
1139 #ifndef ATTRIBUTE_ALIGNED_VALUE
1140 #define ATTRIBUTE_ALIGNED_VALUE BIGGEST_ALIGNMENT
1141 #endif
1143 /* Many ports have no mode-dependent addresses (except possibly autoincrement
1144 and autodecrement addresses, which are handled by target-independent code
1145 in recog.c). */
1146 #ifndef GO_IF_MODE_DEPENDENT_ADDRESS
1147 #define GO_IF_MODE_DEPENDENT_ADDRESS(X, WIN)
1148 #endif
1150 /* For most ports anything that evaluates to a constant symbolic
1151 or integer value is acceptable as a constant address. */
1152 #ifndef CONSTANT_ADDRESS_P
1153 #define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE)
1154 #endif
1156 #ifndef MAX_FIXED_MODE_SIZE
1157 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
1158 #endif
1160 /* Nonzero if structures and unions should be returned in memory.
1162 This should only be defined if compatibility with another compiler or
1163 with an ABI is needed, because it results in slower code. */
1165 #ifndef DEFAULT_PCC_STRUCT_RETURN
1166 #define DEFAULT_PCC_STRUCT_RETURN 1
1167 #endif
1169 #ifdef GCC_INSN_FLAGS_H
1170 /* Dependent default target macro definitions
1172 This section of defaults.h defines target macros that depend on generated
1173 headers. This is a bit awkward: We want to put all default definitions
1174 for target macros in defaults.h, but some of the defaults depend on the
1175 HAVE_* flags defines of insn-flags.h. But insn-flags.h is not always
1176 included by files that do include defaults.h.
1178 Fortunately, the default macro definitions that depend on the HAVE_*
1179 macros are also the ones that will only be used inside GCC itself, i.e.
1180 not in the gen* programs or in target objects like libgcc.
1182 Obviously, it would be best to keep this section of defaults.h as small
1183 as possible, by converting the macros defined below to target hooks or
1184 functions.
1187 /* Just because the user configured --with-sjlj-exceptions=no doesn't
1188 mean that we can use call frame exceptions. Detect that the target
1189 has appropriate support. */
1191 #ifndef MUST_USE_SJLJ_EXCEPTIONS
1192 # if defined (EH_RETURN_DATA_REGNO) \
1193 && (defined (TARGET_UNWIND_INFO) \
1194 || (DWARF2_UNWIND_INFO \
1195 && (defined (EH_RETURN_HANDLER_RTX) \
1196 || defined (HAVE_eh_return))))
1197 # define MUST_USE_SJLJ_EXCEPTIONS 0
1198 # else
1199 # define MUST_USE_SJLJ_EXCEPTIONS 1
1200 # endif
1201 #endif
1203 #ifdef CONFIG_SJLJ_EXCEPTIONS
1204 # if CONFIG_SJLJ_EXCEPTIONS == 1
1205 # define USING_SJLJ_EXCEPTIONS 1
1206 # endif
1207 # if CONFIG_SJLJ_EXCEPTIONS == 0
1208 # define USING_SJLJ_EXCEPTIONS 0
1209 # if !defined(EH_RETURN_DATA_REGNO)
1210 #error "EH_RETURN_DATA_REGNO required"
1211 # endif
1212 # if ! (defined(TARGET_UNWIND_INFO) || DWARF2_UNWIND_INFO)
1213 #error "{DWARF2,TARGET}_UNWIND_INFO required"
1214 # endif
1215 # if !defined(TARGET_UNWIND_INFO) \
1216 && !(defined(EH_RETURN_HANDLER_RTX) || defined(HAVE_eh_return))
1217 #error "EH_RETURN_HANDLER_RTX or eh_return required"
1218 # endif
1219 /* Usually the above error checks will have already triggered an
1220 error, but backends may set MUST_USE_SJLJ_EXCEPTIONS for their own
1221 reasons. */
1222 # if MUST_USE_SJLJ_EXCEPTIONS
1223 #error "Must use SJLJ exceptions but configured not to"
1224 # endif
1225 # endif
1226 #else
1227 # define USING_SJLJ_EXCEPTIONS MUST_USE_SJLJ_EXCEPTIONS
1228 #endif
1230 /* The default branch cost is 1. */
1231 #ifndef BRANCH_COST
1232 #define BRANCH_COST(speed_p, predictable_p) 1
1233 #endif
1235 /* If a memory-to-memory move would take MOVE_RATIO or more simple
1236 move-instruction sequences, we will do a movmem or libcall instead. */
1238 #ifndef MOVE_RATIO
1239 #if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti)
1240 #define MOVE_RATIO(speed) 2
1241 #else
1242 /* If we are optimizing for space (-Os), cut down the default move ratio. */
1243 #define MOVE_RATIO(speed) ((speed) ? 15 : 3)
1244 #endif
1245 #endif
1247 /* If a clear memory operation would take CLEAR_RATIO or more simple
1248 move-instruction sequences, we will do a setmem or libcall instead. */
1250 #ifndef CLEAR_RATIO
1251 #if defined (HAVE_setmemqi) || defined (HAVE_setmemhi) || defined (HAVE_setmemsi) || defined (HAVE_setmemdi) || defined (HAVE_setmemti)
1252 #define CLEAR_RATIO(speed) 2
1253 #else
1254 /* If we are optimizing for space, cut down the default clear ratio. */
1255 #define CLEAR_RATIO(speed) ((speed) ? 15 :3)
1256 #endif
1257 #endif
1259 /* If a memory set (to value other than zero) operation would take
1260 SET_RATIO or more simple move-instruction sequences, we will do a movmem
1261 or libcall instead. */
1262 #ifndef SET_RATIO
1263 #define SET_RATIO(speed) MOVE_RATIO(speed)
1264 #endif
1266 /* Supply a default definition for FUNCTION_ARG_PADDING:
1267 usually pad upward, but pad short args downward on
1268 big-endian machines. */
1270 #define DEFAULT_FUNCTION_ARG_PADDING(MODE, TYPE) \
1271 (! BYTES_BIG_ENDIAN \
1272 ? upward \
1273 : (((MODE) == BLKmode \
1274 ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
1275 && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \
1276 : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \
1277 ? downward : upward))
1279 #ifndef FUNCTION_ARG_PADDING
1280 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
1281 DEFAULT_FUNCTION_ARG_PADDING ((MODE), (TYPE))
1282 #endif
1284 /* Supply a default definition for FUNCTION_ARG_BOUNDARY. Normally, we let
1285 FUNCTION_ARG_PADDING, which also pads the length, handle any needed
1286 alignment. */
1288 #ifndef FUNCTION_ARG_BOUNDARY
1289 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) PARM_BOUNDARY
1290 #endif
1292 /* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save.
1293 Normally move_insn, so Pmode stack pointer. */
1295 #ifndef STACK_SAVEAREA_MODE
1296 #define STACK_SAVEAREA_MODE(LEVEL) Pmode
1297 #endif
1299 /* Supply a default definition of STACK_SIZE_MODE for
1300 allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */
1302 #ifndef STACK_SIZE_MODE
1303 #define STACK_SIZE_MODE word_mode
1304 #endif
1306 /* Provide default values for the macros controlling stack checking. */
1308 /* The default is neither full builtin stack checking... */
1309 #ifndef STACK_CHECK_BUILTIN
1310 #define STACK_CHECK_BUILTIN 0
1311 #endif
1313 /* ...nor static builtin stack checking. */
1314 #ifndef STACK_CHECK_STATIC_BUILTIN
1315 #define STACK_CHECK_STATIC_BUILTIN 0
1316 #endif
1318 /* The default interval is one page (4096 bytes). */
1319 #ifndef STACK_CHECK_PROBE_INTERVAL_EXP
1320 #define STACK_CHECK_PROBE_INTERVAL_EXP 12
1321 #endif
1323 /* The default is not to move the stack pointer. */
1324 #ifndef STACK_CHECK_MOVING_SP
1325 #define STACK_CHECK_MOVING_SP 0
1326 #endif
1328 /* This is a kludge to try to capture the discrepancy between the old
1329 mechanism (generic stack checking) and the new mechanism (static
1330 builtin stack checking). STACK_CHECK_PROTECT needs to be bumped
1331 for the latter because part of the protection area is effectively
1332 included in STACK_CHECK_MAX_FRAME_SIZE for the former. */
1333 #ifdef STACK_CHECK_PROTECT
1334 #define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT
1335 #else
1336 #define STACK_OLD_CHECK_PROTECT \
1337 (USING_SJLJ_EXCEPTIONS ? 75 * UNITS_PER_WORD : 8 * 1024)
1338 #endif
1340 /* Minimum amount of stack required to recover from an anticipated stack
1341 overflow detection. The default value conveys an estimate of the amount
1342 of stack required to propagate an exception. */
1343 #ifndef STACK_CHECK_PROTECT
1344 #define STACK_CHECK_PROTECT \
1345 (USING_SJLJ_EXCEPTIONS ? 75 * UNITS_PER_WORD : 12 * 1024)
1346 #endif
1348 /* Make the maximum frame size be the largest we can and still only need
1349 one probe per function. */
1350 #ifndef STACK_CHECK_MAX_FRAME_SIZE
1351 #define STACK_CHECK_MAX_FRAME_SIZE \
1352 ((1 << STACK_CHECK_PROBE_INTERVAL_EXP) - UNITS_PER_WORD)
1353 #endif
1355 /* This is arbitrary, but should be large enough everywhere. */
1356 #ifndef STACK_CHECK_FIXED_FRAME_SIZE
1357 #define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD)
1358 #endif
1360 /* Provide a reasonable default for the maximum size of an object to
1361 allocate in the fixed frame. We may need to be able to make this
1362 controllable by the user at some point. */
1363 #ifndef STACK_CHECK_MAX_VAR_SIZE
1364 #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100)
1365 #endif
1367 #endif /* GCC_INSN_FLAGS_H */
1369 #endif /* ! GCC_DEFAULTS_H */