OSDN Git Service

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