diff options
Diffstat (limited to 'gcc/tm.texi')
-rw-r--r-- | gcc/tm.texi | 235 |
1 files changed, 207 insertions, 28 deletions
diff --git a/gcc/tm.texi b/gcc/tm.texi index 83d51bb..7f66487 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -1,4 +1,4 @@ -@c Copyright (C) 1988,89,92,93,94,96 Free Software Foundation, Inc. +@c Copyright (C) 1988,89,92,93,94,96,1997 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -764,6 +764,13 @@ Alignment required for a function entry point, in bits. @item BIGGEST_ALIGNMENT Biggest alignment that any data type can require on this machine, in bits. +@findex MINIMUM_ATOMIC_ALIGNMENT +@item MINIMUM_ATOMIC_ALIGNMENT +If defined, the smallest alignment, in bits, that can be given to an +object that can be referenced in one operation, without disturbing any +nearby object. Normally, this is @code{BITS_PER_UNIT}, but may be larger +on machines that don't have byte or half-word store operations. + @findex BIGGEST_FIELD_ALIGNMENT @item BIGGEST_FIELD_ALIGNMENT Biggest alignment that any structure field can require on this machine, @@ -1720,6 +1727,15 @@ suitable for use as a base register in operand addresses. It may be either a suitable hard register or a pseudo register that has been allocated such a hard register. +@findex REGNO_MODE_OK_FOR_BASE_P +@item REGNO_MODE_OK_FOR_BASE_P (@var{num}, @var{mode}) +A C expression that is just like @code{REGNO_OK_FOR_BASE_P}, except that +that expression may examine the mode of the memory reference in +@var{mode}. You should define this macro if the mode of the memory +reference affects whether a register may be used as a base register. If +you define this macro, the compiler will use it instead of +@code{REGNO_OK_FOR_BASE_P}. + @findex REGNO_OK_FOR_INDEX_P @item REGNO_OK_FOR_INDEX_P (@var{num}) A C expression which is nonzero if register number @var{num} is @@ -1900,16 +1916,17 @@ some machines have so few registers of certain classes that there would not be enough registers to use as spill registers if this were done. -Define @code{SMALL_REGISTER_CLASSES} on these machines. When it is -defined, the compiler allows registers explicitly used in the rtl to be -used as spill registers but avoids extending the lifetime of these -registers. +Define @code{SMALL_REGISTER_CLASSES} to be an expression with a non-zero +value on these machines. When this macro has a non-zero value, the +compiler allows registers explicitly used in the rtl to be used as spill +registers but avoids extending the lifetime of these registers. -It is always safe to define this macro, but if you unnecessarily define -it, you will reduce the amount of optimizations that can be performed in -some cases. If you do not define this macro when it is required, the -compiler will run out of spill registers and print a fatal error -message. For most machines, you should not define this macro. +It is always safe to define this macro with a non-zero value, but if you +unnecessarily define it, you will reduce the amount of optimizations +that can be performed in some cases. If you do not define this macro +with a non-zero value when it is required, the compiler will run out of +spill registers and print a fatal error message. For most machines, you +should not define this macro at all. @findex CLASS_LIKELY_SPILLED_P @item CLASS_LIKELY_SPILLED_P (@var{class}) @@ -2011,6 +2028,7 @@ This describes the stack layout and calling conventions. @menu * Frame Layout:: +* Stack Checking:: * Frame Registers:: * Elimination:: * Stack Arguments:: @@ -2110,15 +2128,119 @@ This macro will seldom need to be defined. @findex RETURN_ADDR_RTX @item RETURN_ADDR_RTX (@var{count}, @var{frameaddr}) A C expression whose value is RTL representing the value of the return -address for the frame @var{count} steps up from the current frame. -@var{frameaddr} is the frame pointer of the @var{count} frame, or -the frame pointer of the @var{count} @minus{} 1 frame if +address for the frame @var{count} steps up from the current frame, after +the prologue. @var{frameaddr} is the frame pointer of the @var{count} +frame, or the frame pointer of the @var{count} @minus{} 1 frame if @code{RETURN_ADDR_IN_PREVIOUS_FRAME} is defined. @findex RETURN_ADDR_IN_PREVIOUS_FRAME @item RETURN_ADDR_IN_PREVIOUS_FRAME Define this if the return address of a particular stack frame is accessed from the frame pointer of the previous stack frame. + +@findex INCOMING_RETURN_ADDR_RTX +@item INCOMING_RETURN_ADDR_RTX +A C expression whose value is RTL representing the location of the +incoming return address at the beginning of any function, before the +prologue. This RTL is either a @code{REG}, indicating that the return +value is saved in @samp{REG}, or a @code{MEM} representing a location in +the stack. + +You only need to define this macro if you want to support call frame +debugging information like that provided by DWARF 2. + +@findex INCOMING_FRAME_SP_OFFSET +@item INCOMING_FRAME_SP_OFFSET +A C expression whose value is an integer giving the offset, in bytes, +from the value of the stack pointer register to the top of the stack +frame at the beginning of any function, before the prologue. The top of +the frame is defined to be the value of the stack pointer in the +previous frame, just before the call instruction. + +You only need to define this macro if you want to support call frame +debugging information like that provided by DWARF 2. +@end table + +@node Stack Checking +@subsection Specifying How Stack Checking is Done + +GNU CC will check that stack references are within the boundaries of +the stack, if the @samp{-fstack-check} is specified, in one of three ways: + +@enumerate +@item +If the value of the @code{STACK_CHECK_BUILTIN} macro is nonzero, GNU CC +will assume that you have arranged for stack checking to be done at +appropriate places in the configuration files, e.g., in +@code{FUNCTION_PROLOGUE}. GNU CC will do not other special processing. + +@item +If @code{STACK_CHECK_BUILTIN} is zero and you defined a named pattern +called @code{check_stack} in your @file{md} file, GNU CC will call that +pattern with one argument which is the address to compare the stack +value against. You must arrange for this pattern to report an error if +the stack pointer is out of range. + +@item +If neither of the above are true, GNU CC will generate code to periodically +``probe'' the stack pointer using the values of the macros defined below. +@end enumerate + +Normally, you will use the default values of these macros, so GNU CC +will use the third approach. + +@table @code +@findex STACK_CHECK_BUILTIN +@item STACK_CHECK_BUILTIN +A nonzero value if stack checking is done by the configuration files in a +machine-dependent manner. You should define this macro if stack checking +is require by the ABI of your machine or if you would like to have to stack +checking in some more efficient way than GNU CC's portable approach. +The default value of this macro is zero. + +@findex STACK_CHECK_PROBE_INTERVAL +@item STACK_CHECK_PROBE_INTERVAL +An integer representing the interval at which GNU CC must generate stack +probe instructions. You will normally define this macro to be no larger +than the size of the ``guard pages'' at the end of a stack area. The +default value of 4096 is suitable for most systems. + +@findex STACK_CHECK_PROBE_LOAD +@item STACK_CHECK_PROBE_LOAD +A integer which is nonzero if GNU CC should perform the stack probe +as a load instruction and zero if GNU CC should use a store instruction. +The default is zero, which is the most efficient choice on most systems. + +@findex STACK_CHECK_PROTECT +@item STACK_CHECK_PROTECT +The number of bytes of stack needed to recover from a stack overflow, +for languages where such a recovery is supported. The default value of +75 words should be adequate for most machines. + +@findex STACK_CHECK_MAX_FRAME_SIZE +@item STACK_CHECK_MAX_FRAME_SIZE +The maximum size of a stack frame, in bytes. GNU CC will generate probe +instructions in non-leaf functions to ensure at least this many bytes of +stack are available. If a stack frame is larger than this size, stack +checking will not be reliable and GNU CC will issue a warning. The +default is chosen so that GNU CC only generates one instruction on most +systems. You should normally not change the default value of this macro. + +@findex STACK_CHECK_FIXED_FRAME_SIZE +@item STACK_CHECK_FIXED_FRAME_SIZE +GNU CC uses this value to generate the above warning message. It +represents the amount of fixed frame used by a function, not including +space for any callee-saved registers, temporaries and user variables. +You need only specify an upper bound for this amount and will normally +use the default of four words. + +@findex STACK_CHECK_MAX_VAR_SIZE +@item STACK_CHECK_MAX_VAR_SIZE +The maximum size, in bytes, of an object that GNU CC will place in the +fixed area of the stack frame when the user specifies +@samp{-fstack-check}. +GNU CC computed the default from the values of the above macros and you will +normally not need to override that default. @end table @need 2000 @@ -2455,7 +2577,7 @@ describes the function in question. Normally it is a node of type From this it is possible to obtain the data types of the value and arguments (if known). -When a call to a library function is being considered, @var{funtype} +When a call to a library function is being considered, @var{fundecl} will contain an identifier node for the library function. Thus, if you need to distinguish among various library functions, you can do so by their names. Note that ``library function'' in this context means @@ -3130,12 +3252,10 @@ The @var{thunk_fndecl} is redundant. (@var{delta} and @var{function} have already been extracted from it.) It might possibly be useful on some targets, but probably not. -For many targets, the target-independent code in the C++ frontend will -be sufficient and you can leave this macro undefined. You need to -define this macro if the code generated by default would clobber any of -the incoming arguments; this is only likely if parameters can be passed -in registers. You should also define this macro if the default code is -sub-optimal. +If you do not define this macro, the target-independent code in the C++ +frontend will generate a less efficient heavyweight thunk that calls +@var{function} instead of jumping to it. The generic approach does +not support varargs. @end table @node Profiling @@ -3985,6 +4105,15 @@ controlled by @code{REG_OK_STRICT} as described above. This usually requires two variant definitions, of which @code{REG_OK_STRICT} controls the one actually used. +@findex REG_MODE_OK_FOR_BASE_P +@item REG_MODE_OK_FOR_BASE_P (@var{x}, @var{mode}) +A C expression that is just like @code{REG_OK_FOR_BASE_P}, except that +that expression may examine the mode of the memory reference in +@var{mode}. You should define this macro if the mode of the memory +reference affects whether a register may be used as a base register. If +you define this macro, the compiler will use it instead of +@code{REG_OK_FOR_BASE_P}. + @findex REG_OK_FOR_INDEX_P @item REG_OK_FOR_INDEX_P (@var{x}) A C expression that is nonzero if @var{x} (assumed to be a @code{reg} @@ -4549,13 +4678,21 @@ Decode @var{sym_name} and store the real name part in @var{var}, sans the characters that encode section info. Define this macro if @code{ENCODE_SECTION_INFO} alters the symbol's name string. +@findex UNIQUE_SECTION_P (@var{decl}) +@item UNIQUE_SECTION_P (@var{decl}) +A C expression which evaluates to true if @var{decl} should be placed +into a unique section for some target-specific reason. If you do not +define this macro, the default is @samp{0}. Note that the flag +@samp{-ffunction-sections} will also cause functions to be placed into +unique sections. + @findex UNIQUE_SECTION -@item UNIQUE_SECTION (@var{decl}) -For objects going into their own sections, a C expression of the name of the -section, expressed as a STRING_CST node, to put @var{decl} into. The -STRING_CST node must be allocated in the saveable obstack. Function -@code{build_string} can be used to do this. If you do not define this macro, -GNU CC will use the symbol name as the section name. +@item UNIQUE_SECTION (@var{decl}, @var{reloc}) +A C statement to build up a unique section name, expressed as a +STRING_CST node, and assign it to @samp{DECL_SECTION_NAME (@var{decl})}. +@var{reloc} indicates whether the initial value of @var{exp} requires +link-time relocations. If you do not define this macro, GNU CC will use +the symbol name prefixed by @samp{.} as the section name. @end table @node PIC @@ -4737,10 +4874,12 @@ A C statement to output something to the assembler file to handle a macro is not defined, nothing is output for a @samp{#ident} directive. @findex ASM_OUTPUT_SECTION_NAME -@item ASM_OUTPUT_SECTION_NAME (@var{stream}, @var{decl}, @var{name}) +@item ASM_OUTPUT_SECTION_NAME (@var{stream}, @var{decl}, @var{name}, @var{reloc}) A C statement to output something to the assembler file to switch to section @var{name} for object @var{decl} which is either a @code{FUNCTION_DECL}, a -@code{VAR_DECL} or @code{NULL_TREE}. Some target formats do not support +@code{VAR_DECL} or @code{NULL_TREE}. @var{reloc} +indicates whether the initial value of @var{exp} requires link-time +relocations. Some target formats do not support arbitrary sections. Do not define this macro in such cases. At present this macro is only used to support section attributes. @@ -4823,6 +4962,15 @@ If the assembler has a @code{.ascii} pseudo-op as found in the Berkeley Unix assembler, do not define the macro @code{ASM_OUTPUT_ASCII}. +@findex CONSTANT_POOL_BEFORE_FUNCTION +@item CONSTANT_POOL_BEFORE_FUNCTION +You may define this macro as a C expression. You should define the +expression to have a non-zero value if GNU CC should output the constant +pool for a function before the code for the function, or a zero value if +GNU CC should output the constant pool after the function. If you do +not define this macro, the usual case, GNU CC will output the constant +pool before the function. + @findex ASM_OUTPUT_POOL_PROLOGUE @item ASM_OUTPUT_POOL_PROLOGUE (@var{file} @var{funname} @var{fundecl} @var{size}) A C statement to output assembler commands to define the start of the @@ -4863,6 +5011,24 @@ entry from being output a second time in the usual manner. You need not define this macro if it would do nothing. +@findex CONSTANT_AFTER_FUNCTION_P +@item CONSTANT_AFTER_FUNCTION_P (@var{exp}) +Define this macro as a C expression which is nonzero if the constant +@var{exp}, of type @code{tree}, should be output after the code for a +function. The compiler will normally output all constants before the +function; you need not define this macro if this is OK. + +@findex ASM_OUTPUT_POOL_EPILOGUE +@item ASM_OUTPUT_POOL_EPILOGUE (@var{file} @var{funname} @var{fundecl} @var{size}) +A C statement to output assembler commands to at the end of the constant +pool for a function. @var{funname} is a string giving the name of the +function. Should the return type of the function be required, you can +obtain it via @var{fundecl}. @var{size} is the size, in bytes, of the +constant pool that GNU CC wrote immediately before this call. + +If no constant-pool epilogue is required, the usual case, you need not +define this macro. + @findex IS_ASM_LOGICAL_LINE_SEPARATOR @item IS_ASM_LOGICAL_LINE_SEPARATOR (@var{C}) Define this macro as a C expression which is nonzero if @var{C} is @@ -6274,6 +6440,12 @@ in response to the @samp{-g} option. Define this macro if GNU CC should produce dwarf version 2 format debugging output in response to the @samp{-g} option. +To support optional call frame debugging information, you must also +define @code{INCOMING_RETURN_ADDR_RTX} and either set +@code{RTX_FRAME_RELATED_P} on the prologue insns if you use RTL for the +prologue, or call @code{dwarf2out_def_cfa} and @code{dwarf2out_reg_save} +as appropriate from @code{FUNCTION_PROLOGUE} if you don't. + @findex PUT_SDB_@dots{} @item PUT_SDB_@dots{} Define these macros to override the assembler syntax for the special @@ -6906,6 +7078,13 @@ dependent processing between the second jump optimization pass and delayed branch scheduling. On those machines, define this macro as a C statement to act on the code starting at @var{insn}. +@findex MULTIPLE_SYMBOL_SPACES +@item MULTIPLE_SYMBOL_SPACES +Define this macro if in some cases global symbols from one translation +unit may not be bound to undefined symbols in another translation unit +without user intervention. For instance, under Microsoft Windows +symbols must be explicitly imported from shared libraries (DLLs). + @findex GIV_SORT_CRITERION @item GIV_SORT_CRITERION (@var{giv1}, @var{giv2}) In some cases, the strength reduction optimization pass can produce better |