1 /* Definitions of various defaults for tm.h macros.
2 Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4 Contributed by Ron Guilmette (rfg@monkeys.com)
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef GCC_DEFAULTS_H
24 #define GCC_DEFAULTS_H
26 #ifndef GET_ENVIRONMENT
27 #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
30 #define obstack_chunk_alloc xmalloc
31 #define obstack_chunk_free free
33 /* Define default standard character escape sequences. */
35 # define TARGET_BELL 007
36 # define TARGET_BS 010
37 # define TARGET_TAB 011
38 # define TARGET_NEWLINE 012
39 # define TARGET_VT 013
40 # define TARGET_FF 014
41 # define TARGET_CR 015
42 # define TARGET_ESC 033
45 /* When removal of CPP_PREDEFINES is complete, TARGET_CPU_CPP_BULITINS
46 can also be removed from here. */
47 #ifndef TARGET_OS_CPP_BUILTINS
48 # define TARGET_OS_CPP_BUILTINS()
50 #ifndef TARGET_CPU_CPP_BUILTINS
51 # define TARGET_CPU_CPP_BUILTINS()
53 #ifndef CPP_PREDEFINES
54 # define CPP_PREDEFINES ""
57 /* Store in OUTPUT a string (made with alloca) containing an
58 assembler-name for a local static variable or function named NAME.
59 LABELNO is an integer which is different for each call. */
62 # ifndef NO_DOT_IN_LABEL
63 # define ASM_PN_FORMAT "%s.%lu"
65 # ifndef NO_DOLLAR_IN_LABEL
66 # define ASM_PN_FORMAT "%s$%lu"
68 # define ASM_PN_FORMAT "__%s_%lu"
71 #endif /* ! ASM_PN_FORMAT */
73 #ifndef ASM_FORMAT_PRIVATE_NAME
74 # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
75 do { const char *const name_ = (NAME); \
76 char *const output_ = (OUTPUT) = (char *) alloca (strlen (name_) + 32);\
77 sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
82 #define ASM_STABD_OP "\t.stabd\t"
85 /* This is how to output an element of a case-vector that is absolute.
86 Some targets don't use this, but we have to define it anyway. */
88 #ifndef ASM_OUTPUT_ADDR_VEC_ELT
89 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
90 do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
91 (*targetm.asm_out.internal_label) (FILE, "L", (VALUE)); \
96 /* choose a reasonable default for ASM_OUTPUT_ASCII. */
98 #ifndef ASM_OUTPUT_ASCII
99 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
101 FILE *_hide_asm_out_file = (MYFILE); \
102 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
103 int _hide_thissize = (MYLENGTH); \
105 FILE *asm_out_file = _hide_asm_out_file; \
106 const unsigned char *p = _hide_p; \
107 int thissize = _hide_thissize; \
109 fprintf (asm_out_file, "\t.ascii \""); \
111 for (i = 0; i < thissize; i++) \
114 if (c == '\"' || c == '\\') \
115 putc ('\\', asm_out_file); \
117 putc (c, asm_out_file); \
120 fprintf (asm_out_file, "\\%o", c); \
121 /* After an octal-escape, if a digit follows, \
122 terminate one string constant and start another. \
123 The VAX assembler fails to stop reading the escape \
124 after three digits, so this is the only way we \
125 can get it to parse the data properly. */ \
126 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
127 fprintf (asm_out_file, "\"\n\t.ascii \""); \
130 fprintf (asm_out_file, "\"\n"); \
136 /* This is how we tell the assembler to equate two values. */
138 #ifndef ASM_OUTPUT_DEF
139 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
140 do { fprintf ((FILE), "%s", SET_ASM_OP); \
141 assemble_name (FILE, LABEL1); \
142 fprintf (FILE, ","); \
143 assemble_name (FILE, LABEL2); \
144 fprintf (FILE, "\n"); \
149 /* This is how to output the definition of a user-level label named
150 NAME, such as the label on a static function or variable NAME. */
152 #ifndef ASM_OUTPUT_LABEL
153 #define ASM_OUTPUT_LABEL(FILE,NAME) \
154 do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
157 /* This is how to output a reference to a user-level label named NAME. */
159 #ifndef ASM_OUTPUT_LABELREF
160 #define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
163 /* Allow target to print debug info labels specially. This is useful for
164 VLIW targets, since debug info labels should go into the middle of
165 instruction bundles instead of breaking them. */
167 #ifndef ASM_OUTPUT_DEBUG_LABEL
168 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
169 (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM)
172 /* This is how we tell the assembler that a symbol is weak. */
173 #ifndef ASM_OUTPUT_WEAK_ALIAS
174 #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
175 #define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \
178 ASM_WEAKEN_LABEL (STREAM, NAME); \
180 ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \
186 /* How to emit a .type directive. */
187 #ifndef ASM_OUTPUT_TYPE_DIRECTIVE
188 #if defined TYPE_ASM_OP && defined TYPE_OPERAND_FMT
189 #define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) \
192 fputs (TYPE_ASM_OP, STREAM); \
193 assemble_name (STREAM, NAME); \
194 fputs (", ", STREAM); \
195 fprintf (STREAM, TYPE_OPERAND_FMT, TYPE); \
196 putc ('\n', STREAM); \
202 /* How to emit a .size directive. */
203 #ifndef ASM_OUTPUT_SIZE_DIRECTIVE
205 #define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE) \
208 HOST_WIDE_INT size_ = (SIZE); \
209 fputs (SIZE_ASM_OP, STREAM); \
210 assemble_name (STREAM, NAME); \
211 fputs (", ", STREAM); \
212 fprintf (STREAM, HOST_WIDE_INT_PRINT_DEC, size_); \
213 putc ('\n', STREAM); \
217 #define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME) \
220 fputs (SIZE_ASM_OP, STREAM); \
221 assemble_name (STREAM, NAME); \
222 fputs (", .-", STREAM); \
223 assemble_name (STREAM, NAME); \
224 putc ('\n', STREAM); \
231 /* This determines whether or not we support weak symbols. */
232 #ifndef SUPPORTS_WEAK
233 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
234 #define SUPPORTS_WEAK 1
236 #define SUPPORTS_WEAK 0
240 /* This determines whether or not we support link-once semantics. */
241 #ifndef SUPPORTS_ONE_ONLY
242 #ifdef MAKE_DECL_ONE_ONLY
243 #define SUPPORTS_ONE_ONLY 1
245 #define SUPPORTS_ONE_ONLY 0
249 /* By default, there is no prefix on user-defined symbols. */
250 #ifndef USER_LABEL_PREFIX
251 #define USER_LABEL_PREFIX ""
254 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
255 provide a weak attribute. Else define it to nothing.
257 This would normally belong in ansidecl.h, but SUPPORTS_WEAK is
258 not available at that time.
260 Note, this is only for use by target files which we know are to be
262 #ifndef TARGET_ATTRIBUTE_WEAK
264 # define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
266 # define TARGET_ATTRIBUTE_WEAK
270 /* If the target supports init_priority C++ attribute, give
271 SUPPORTS_INIT_PRIORITY a nonzero value. */
272 #ifndef SUPPORTS_INIT_PRIORITY
273 #define SUPPORTS_INIT_PRIORITY 1
274 #endif /* SUPPORTS_INIT_PRIORITY */
276 /* If duplicate library search directories can be removed from a
277 linker command without changing the linker's semantics, give this
279 #ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
280 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
281 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
283 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
284 the rest of the DWARF 2 frame unwind support is also provided. */
285 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
286 #define DWARF2_UNWIND_INFO 1
289 /* If we have named sections, and we're using crtstuff to run ctors,
290 use them for registering eh frame information. */
291 #if defined (TARGET_ASM_NAMED_SECTION) && DWARF2_UNWIND_INFO \
292 && !defined(EH_FRAME_IN_DATA_SECTION)
293 #ifndef EH_FRAME_SECTION_NAME
294 #define EH_FRAME_SECTION_NAME ".eh_frame"
298 /* If we have named section and we support weak symbols, then use the
299 .jcr section for recording java classes which need to be registered
300 at program start-up time. */
301 #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
302 #ifndef JCR_SECTION_NAME
303 #define JCR_SECTION_NAME ".jcr"
307 /* By default, we generate a label at the beginning and end of the
308 text section, and compute the size of the text section by
309 subtracting the two. However, on some platforms that doesn't
310 work, and we use the section itself, rather than a label at the
311 beginning of it, to indicate the start of the section. On such
312 platforms, define this to zero. */
313 #ifndef DWARF2_GENERATE_TEXT_SECTION_LABEL
314 #define DWARF2_GENERATE_TEXT_SECTION_LABEL 1
317 /* Supply a default definition for PROMOTE_PROTOTYPES. */
318 #ifndef PROMOTE_PROTOTYPES
319 #define PROMOTE_PROTOTYPES 0
322 /* Number of hardware registers that go into the DWARF-2 unwind info.
323 If not defined, equals FIRST_PSEUDO_REGISTER */
325 #ifndef DWARF_FRAME_REGISTERS
326 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
329 /* How to renumber registers for dbx and gdb. If not defined, assume
330 no renumbering is necessary. */
332 #ifndef DBX_REGISTER_NUMBER
333 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
336 /* Default sizes for base C types. If the sizes are different for
337 your target, you should override these values by defining the
338 appropriate symbols in your tm.h file. */
340 #ifndef BITS_PER_UNIT
341 #define BITS_PER_UNIT 8
344 #ifndef BITS_PER_WORD
345 #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
348 #ifndef CHAR_TYPE_SIZE
349 #define CHAR_TYPE_SIZE BITS_PER_UNIT
352 #ifndef BOOL_TYPE_SIZE
353 /* `bool' has size and alignment `1', on almost all platforms. */
354 #define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
357 #ifndef SHORT_TYPE_SIZE
358 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
361 #ifndef INT_TYPE_SIZE
362 #define INT_TYPE_SIZE BITS_PER_WORD
365 #ifndef LONG_TYPE_SIZE
366 #define LONG_TYPE_SIZE BITS_PER_WORD
369 #ifndef LONG_LONG_TYPE_SIZE
370 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
373 #ifndef WCHAR_TYPE_SIZE
374 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
377 #ifndef FLOAT_TYPE_SIZE
378 #define FLOAT_TYPE_SIZE BITS_PER_WORD
381 #ifndef DOUBLE_TYPE_SIZE
382 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
385 #ifndef LONG_DOUBLE_TYPE_SIZE
386 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
389 /* Width in bits of a pointer. Mind the value of the macro `Pmode'. */
391 #define POINTER_SIZE BITS_PER_WORD
394 #ifndef BUILD_VA_LIST_TYPE
395 #define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node)
398 #ifndef PIC_OFFSET_TABLE_REGNUM
399 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
402 /* Type used by GCOV counters. Use 64bit data type if target supports
404 #if LONG_TYPE_SIZE >= 64
405 #define GCOV_TYPE_SIZE LONG_TYPE_SIZE
407 #define GCOV_TYPE_SIZE LONG_LONG_TYPE_SIZE
411 /* By default, the preprocessor should be invoked the same way in C++
413 #ifndef CPLUSPLUS_CPP_SPEC
415 #define CPLUSPLUS_CPP_SPEC CPP_SPEC
419 #ifndef ACCUMULATE_OUTGOING_ARGS
420 #define ACCUMULATE_OUTGOING_ARGS 0
423 /* Supply a default definition for PUSH_ARGS. */
426 #define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
432 /* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY.
433 STACK_BOUNDARY is required. */
434 #ifndef PREFERRED_STACK_BOUNDARY
435 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
438 /* By default, the C++ compiler will use function addresses in the
439 vtable entries. Setting this nonzero tells the compiler to use
440 function descriptors instead. The value of this macro says how
441 many words wide the descriptor is (normally 2). It is assumed
442 that the address of a function descriptor may be treated as a
443 pointer to a function. */
444 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
445 #define TARGET_VTABLE_USES_DESCRIPTORS 0
448 /* By default, the vtable entries are void pointers, the so the alignment
449 is the same as pointer alignment. The value of this macro specifies
450 the alignment of the vtable entry in bits. It should be defined only
451 when special alignment is necessary. */
452 #ifndef TARGET_VTABLE_ENTRY_ALIGN
453 #define TARGET_VTABLE_ENTRY_ALIGN POINTER_SIZE
456 /* There are a few non-descriptor entries in the vtable at offsets below
457 zero. If these entries must be padded (say, to preserve the alignment
458 specified by TARGET_VTABLE_ENTRY_ALIGN), set this to the number of
459 words in each data entry. */
460 #ifndef TARGET_VTABLE_DATA_ENTRY_DISTANCE
461 #define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1
464 /* Select a format to encode pointers in exception handling data. We
465 prefer those that result in fewer dynamic relocations. Assume no
466 special support here and encode direct references. */
467 #ifndef ASM_PREFERRED_EH_DATA_FORMAT
468 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) DW_EH_PE_absptr
471 /* By default, the C++ compiler will use the lowest bit of the pointer
472 to function to indicate a pointer-to-member-function points to a
473 virtual member function. However, if FUNCTION_BOUNDARY indicates
474 function addresses aren't always even, the lowest bit of the delta
475 field will be used. */
476 #ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION
477 #define TARGET_PTRMEMFUNC_VBIT_LOCATION \
478 (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \
479 ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta)
482 #ifndef DEFAULT_GDB_EXTENSIONS
483 #define DEFAULT_GDB_EXTENSIONS 1
486 /* If more than one debugging type is supported, you must define
487 PREFERRED_DEBUGGING_TYPE to choose a format in a system-dependent way.
489 This is one long line cause VAXC can't handle a \-newline. */
490 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) + defined (VMS_DEBUGGING_INFO))
491 #ifndef PREFERRED_DEBUGGING_TYPE
492 You Lose
! You must define PREFERRED_DEBUGGING_TYPE
!
493 #endif /* no PREFERRED_DEBUGGING_TYPE */
494 #else /* Only one debugging format supported. Define PREFERRED_DEBUGGING_TYPE
495 so other code needn't care. */
496 #ifdef DBX_DEBUGGING_INFO
497 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
499 #ifdef SDB_DEBUGGING_INFO
500 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
502 #ifdef DWARF_DEBUGGING_INFO
503 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
505 #ifdef DWARF2_DEBUGGING_INFO
506 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
508 #ifdef VMS_DEBUGGING_INFO
509 #define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
511 #ifdef XCOFF_DEBUGGING_INFO
512 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
514 #endif /* More than one debugger format enabled. */
516 /* If still not defined, must have been because no debugging formats
518 #ifndef PREFERRED_DEBUGGING_TYPE
519 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
522 /* Define codes for all the float formats that we know of. */
523 #define UNKNOWN_FLOAT_FORMAT 0
524 #define IEEE_FLOAT_FORMAT 1
525 #define VAX_FLOAT_FORMAT 2
526 #define IBM_FLOAT_FORMAT 3
527 #define C4X_FLOAT_FORMAT 4
529 /* Default to IEEE float if not specified. Nearly all machines use it. */
530 #ifndef TARGET_FLOAT_FORMAT
531 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
534 /* Determine the register class for registers suitable to be the base
535 address register in a MEM. Allow the choice to be dependent upon
536 the mode of the memory access. */
537 #ifndef MODE_BASE_REG_CLASS
538 #define MODE_BASE_REG_CLASS(MODE) BASE_REG_CLASS
541 #ifndef LARGEST_EXPONENT_IS_NORMAL
542 #define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
545 #ifndef ROUND_TOWARDS_ZERO
546 #define ROUND_TOWARDS_ZERO 0
549 #ifndef MODE_HAS_NANS
550 #define MODE_HAS_NANS(MODE) \
551 (FLOAT_MODE_P (MODE) \
552 && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
553 && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
556 #ifndef MODE_HAS_INFINITIES
557 #define MODE_HAS_INFINITIES(MODE) \
558 (FLOAT_MODE_P (MODE) \
559 && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
560 && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
563 #ifndef MODE_HAS_SIGNED_ZEROS
564 #define MODE_HAS_SIGNED_ZEROS(MODE) \
565 (FLOAT_MODE_P (MODE) && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
568 #ifndef MODE_HAS_SIGN_DEPENDENT_ROUNDING
569 #define MODE_HAS_SIGN_DEPENDENT_ROUNDING(MODE) \
570 (FLOAT_MODE_P (MODE) \
571 && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
572 && !ROUND_TOWARDS_ZERO)
575 /* If FLOAT_WORDS_BIG_ENDIAN and HOST_FLOAT_WORDS_BIG_ENDIAN are not defined
576 in the header files, then this implies the word-endianness is the same as
578 #ifndef FLOAT_WORDS_BIG_ENDIAN
579 #define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
582 #ifndef TARGET_FLT_EVAL_METHOD
583 #define TARGET_FLT_EVAL_METHOD 0
586 #ifndef HOT_TEXT_SECTION_NAME
587 #define HOT_TEXT_SECTION_NAME "text.hot"
590 #ifndef UNLIKELY_EXECUTED_TEXT_SECTION_NAME
591 #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME "text.unlikely"
594 #ifndef VECTOR_MODE_SUPPORTED_P
595 #define VECTOR_MODE_SUPPORTED_P(MODE) 0
598 /* Determine whether __cxa_atexit, rather than atexit, is used to
599 register C++ destructors for local statics and global objects. */
600 #ifndef DEFAULT_USE_CXA_ATEXIT
601 #define DEFAULT_USE_CXA_ATEXIT 0
604 /* Determine whether extra constraint letter should be handled
605 via address reload (like 'o'). */
606 #ifndef EXTRA_MEMORY_CONSTRAINT
607 #define EXTRA_MEMORY_CONSTRAINT(C) 0
610 /* Determine whether extra constraint letter should be handled
611 as an address (like 'p'). */
612 #ifndef EXTRA_ADDRESS_CONSTRAINT
613 #define EXTRA_ADDRESS_CONSTRAINT(C) 0
616 #endif /* ! GCC_DEFAULTS_H */