--- gcc/internals.texinfo 2018/04/24 16:40:12 1.1.1.4 +++ gcc/internals.texinfo 2018/04/24 16:42:03 1.1.1.6 @@ -278,7 +278,7 @@ Charles LaBrec contributed the support f Michael Tiemann of MCC wrote the description of the National Semiconductor 32000 series cpu, with some contributions from Jan Stein of the Chalmers Computer Club. Tiemann also wrote the code for inline -function integration and for the SPARC cpu. +function integration and for the SPARC cpu and Motorola 88000 cpu. @item Robert Brown implemented the support for Encore 32000 systems. @@ -292,6 +292,9 @@ Alex Crain provided changes for the 3b1. @item Greg Satz and Chris Hanson assisted in making GNU CC work on HP-UX for the 9000 series 300. + +@item +William Schelter did most of the work on the Intel 80386 support. @end itemize @node Options, Installation, Contributors, Top @@ -417,6 +420,9 @@ Integer types @code{unsigned short} and to @code{unsigned int}. @item +Out-of-range floating point literals are not an error. + +@item In the preprocessor, comments convert to nothing at all, rather than to a space. This allows traditional token concatenation. @@ -965,10 +971,11 @@ config file for the machine you are usin file is responsible for defining information about the host machine. It includes @file{tm.h}. -The file's name should be @file{config-@var{machine}.h}. On VMS, -use @file{config-vms.h} rather than @file{config-vax.h}. On the -HP 9000 series 300, use @file{config-hp9k3.h} rather than -@file{config-m68k.h}. +The file's name should be @file{config-@var{machine}.h}. On VMS, use +@file{config-vms.h} rather than @file{config-vax.h}. On the HP 9000 +series 300, use @file{config-hp9k3.h} rather than +@file{config-m68k.h}. On Suns (model 3 or 4) running system version +4, use @file{config-sun4.h}.@refill If your system does not support symbolic links, you might want to set up @file{config.h} to contain a @samp{#include} command which @@ -995,10 +1002,19 @@ with compilation. Not all of the pieces this mode of operation are as yet in distribution; full instructions will appear here in the future.@refill -For the vax, use @file{tm-vax.h} on Unix, or @file{tm-vms.h} on -VMS.@refill +For the vax, use @file{tm-vax.h} on BSD Unix, @file{tm-vaxv.h} on +system V, or @file{tm-vms.h} on VMS.@refill + +For the SPARC, use @file{tm-sparc.h}. -For the sparc, use @file{tm-sparc.h}. +For the Motorola 88000, use @file{tm-m88k.h}. The support for the +88000 has a few unfinished spots because there was no way to run the +output. Bugs are suspected in handling of branch-tables and in +the function prologue and epilogue. + +For the 80386, don't use @file{tm-i386.h} directly. Use @file{tm-i386v.h} +if the target machine is running system V, or @file{tm-compaq.h} for a +Compaq. For the 32000, use @file{tm-sequent.h} if you are using a Sequent machine, or @file{tm-encore.h} for an Encore machine; otherwise, @@ -1079,7 +1095,7 @@ time, do this: @example make stage2 -make CC=stage2/gcc CFLAGS="-g -O -Bstage2/" +Make CC=stage2/gcc CFLAGS="-g -O -Bstage2/" foreach file (*.o) cmp $file stage2/$file end @@ -1091,6 +1107,9 @@ that the stage 2 compiler has compiled G therefore a potentially serious bug which you should investigate and report (@pxref{Bugs}). +Aside from the @samp{-B} option, the options should be the same as +when you made stage 2. + @item Install the compiler driver, the compiler's passes and run-time support. You can use the following command: @@ -1122,12 +1141,12 @@ the system's own C preprocessor. To do Alternatively, on Sun systems and 4.3BSD at least, you can correct the include files by running the shell script @file{fixincludes}. This -installs modified, corrected copies of the files @file{ioctl.h} and -@file{ttychars.h} in a special directory where only GNU CC will -normally look for them. +installs modified, corrected copies of the files @file{ioctl.h}, +@file{ttychars.h} and many others, in a special directory where only +GNU CC will normally look for them. -The file @file{/usr/include/vaxuba/qvioctl.h} used in the X window -system needs a similar correction. +See the file @file{fixincludes} for a list of all the files we know to +require correction. @end enumerate If you cannot install the compiler's passes and run-time support in @@ -1331,6 +1350,12 @@ by Bison grammar rules rather than C cod flag cannot alter it. @item +When compiling functions that return @code{float}, PCC converts it to +a double. GNU CC actually returns a @code{float}. If you are concerned +with PCC compatibility, you should declare your functions to return +@code{double}; you might as well say what you mean. + +@item When compiling functions that return structures or unions, GNU CC output code uses a method different from that used on most versions of Unix. As a result, code compiled with GNU CC cannot call a @@ -1665,7 +1690,7 @@ struct line @{ @{ struct line *thisline = (struct line *) malloc (sizeof (struct line) + this_length); - thisline->length = thislength; + thisline->length = this_length; @} @end example @@ -1940,20 +1965,23 @@ from the first input, if any. Commas se inputs. The number of operands is limited to the maximum number of operands in any instruction pattern in the machine description. -Output operand expressions must be lvalues, and there must be at least one -of them. The compiler can check this. The input operands need not be -lvalues, and there need not be any. The compiler cannot check whether the -operands have data types that are reasonable for the instruction being +Output operand expressions must be lvalues; the compiler can check this. +The input operands need not be lvalues. The compiler cannot check whether +the operands have data types that are reasonable for the instruction being executed. +If there are no output operands, and there are input operands, then you +should write two colons in a row where the output operands would go. + The output operands must be write-only; GNU CC will assume that the values in these operands before the instruction are dead and need not be -generated. For an operand that is read-write, you must logically split its -function into two separate operands, one input operand and one write-only -output operand. The connection between them is expressed by constraints -which say they need to be in the same location when the instruction -executes. You can use the same C expression for both operands, or -different expressions. For example, here we write the (fictitious) +generated. For an operand that is read-write, or in which not all bits are +written and the other bits contain useful information, you must logically +split its function into two separate operands, one input operand and one +write-only output operand. The connection between them is expressed by +constraints which say they need to be in the same location when the +instruction executes. You can use the same C expression for both operands, +or different expressions. For example, here we write the (fictitious) @samp{combine} instruction with @code{bar} as its read-only source operand and @code{foo} as its read-write destination: @@ -1963,8 +1991,14 @@ asm ("combine %2,%0" : "=r" (foo) : "0" @noindent The constraint @samp{"0"} for operand 1 says that it must occupy the same -location as operand 0. Therefore it is not necessary to substitute operand -1 into the assembler code output. +location as operand 0. + +Unless an output operand has the @samp{&} constraint modifier, GNU CC may +allocate it in the same register as an unrelated input operand, on the +assumption that the inputs are consumed before the outputs are produced. +This assumption may be false if the assembler code actually consists of +more than one instruction. In such a case, use @samp{&} for each output +operand that may not overlap an input. @xref{Modifiers}. Usually the most convenient way to use these @code{asm} instructions is to encapsulate them in macros that look like functions. For example, @@ -2363,7 +2397,7 @@ and unions of other sizes are returned b passed by the caller in a register. This method is faster than the one normally used by PCC and is also reentrant. The register used for passing the address is specified by the machine-description macro -@code{STRUCT_VALUE_REGNUM}. +@code{STRUCT_VALUE}. GNU CC always passes arguments on the stack. At some point it will be extended to pass arguments in registers, for machines which use that as @@ -2897,6 +2931,16 @@ that the value of the expression never c current function). In an RTL dump, this flag is represented as @samp{/u}. + +@item integrated +In some kinds of expressions, including insns, this flag means the +rtl was produced by procedure integration. + +In a @samp{reg} expression, this flag indicates the register +containing the value to be returned by the current function. On +machines that pass parameters in registers, the same register number +may be used for parameters as well, but this flag is not set on such +uses. @end table @node Machine Modes, Constants, Flags, RTL @@ -5773,6 +5817,16 @@ Define this if instructions will fail to on the nominal alignment. If instructions will merely go slower in that case, do not define this macro. +@item PCC_BITFIELD_TYPE_MATTERS +Define this if you wish to imitate a certain bizarre behavior pattern +of some instances of PCC: a bit field whose declared type is +@code{int} has the same effect on the size and alignment of a +structure as an actual @code{int} would have. + +Just what effect that is in GNU CC depends on other parameters, but on +most machines it would force the structure's alignment and size to a +multiple of 32 or @code{BIGGEST_ALIGNMENT} bits. + @item CHECK_FLOAT_VALUE (@var{mode}, @var{value}) A C statement to validate the value @var{value} (or type @code{double}) for mode @var{mode}. This means that you check whether @@ -6001,8 +6055,48 @@ The static chain register need not be a When a function's value's mode is @code{BLKmode}, the value is not returned according to @code{FUNCTION_VALUE}. Instead, the caller passes the address of a block of memory in which the value should be -stored. @code{STRUCT_VALUE_REGNUM} is the register in which this -address is passed. +stored. + +If this value is passed in a register, then @code{STRUCT_VALUE_REGNUM} +should be the number of that register. + +@item STRUCT_VALUE +If the structure value address is not passed in a register, define +@code{STRUCT_VALUE} as an expression returning an RTX for the place +where the address is passed. If it returns a @samp{mem} RTX, the +address is passed as an ``invisible'' first argument. + +@item STRUCT_VALUE_INCOMING_REGNUM +On some architectures the place where the structure value address +is found by the called function is not the same place that the +caller put it. This can be due to register windows, or it could +be because the function prologue moves it to a different place. + +If the incoming location of the structure value address is in a +register, define this macro as the register number. + +@item STRUCT_VALUE_INCOMING +If the incoming location is not a register, define +@code{STRUCT_VALUE_INCOMING} as an expression for an RTX for where the +called function should find the value. If it should find the value on +the stack, define this to create a @samp{mem} which refers to the +frame pointer. If the value is a @samp{mem}, the compiler assumes it +is for an invisible first argument, and leaves space for it when +finding the first real argument. + +@item REG_ALLOC_ORDER +If defined, an initializer for a vector of integers, containing the +numbers of hard registers in the order in which the GNU CC should +prefer to use them (from most preferred to least). + +If this macro is not defined, registers are used lowest numbered first +(all else being equal). + +One use of this macro is on the 360, where the highest numbered +registers must always be saved and the save-multiple-registers +instruction supports only sequences of consecutive registers. This +macro is defined to cause the highest numbered allocatable registers +to be used first. @end table @node Register Classes, Stack Layout, Registers, Machine Macros @@ -6127,6 +6221,11 @@ the value of this macro is always @code{ @var{class} includes the data registers. Requiring a data register guarantees that a @samp{moveq} will be used. +If @var{x} is a @samp{const_double}, by returning @code{NO_REGS} +you can force @var{x} into a memory constant. This is useful on +certain machines where immediate floating values cannot be loaded into +certain kinds of registers. + @item CLASS_MAX_NREGS (@var{class}, @var{mode}) A C expression for the maximum number of consecutive registers of class @var{class} needed to hold a value of mode @var{mode}. @@ -6283,7 +6382,7 @@ compiled. @item FUNCTION_VALUE_REGNO_P (@var{regno}) A C expression that is nonzero if @var{regno} is the number of a hard -register in which function values are sometimes returned. +register in which the values of called function may come back. A register whose use for returning values is limited to serving as the second of a pair (for a value of type @code{double}, say) need not be @@ -6294,6 +6393,10 @@ suffices: #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) @end example +If the machine has register windows, so that the caller and the called +function use different registers for the return value, this macro +should recognize only the caller's register numbers. + @item FUNCTION_ARG (@var{cum}, @var{mode}, @var{type}, @var{named}) A C expression that controls whether a function argument is passed in a register, and which register. @@ -6371,6 +6474,24 @@ the structure-value address. On many ma used for this purpose since all function arguments are pushed on the stack. +@item FUNCTION_ARG_PADDING (@var{mode}, @var{size}) +If defined, a C expression which determines whether, and in which direction, +to pad out an argument with extra space. The value should be of type +@code{enum direction}: either @code{upward} to pad above the argument, +@code{downward} to pad below, or @code{none} to inhibit padding. + +The argument @var{size} is an RTX which describes the size of the +argument, in bytes. It should be used only if @var{mode} is +@code{BLKmode}. Otherwise, @var{size} is 0. + +This macro does not control the @emph{amount} of padding; that is +always just enough to reach the next multiple of @code{PARM_BOUNDARY}. + +This macro has a default definition which is right for most systems. +For little-endian machines, the default is to pad upward. For +big-endian machines, the default is to pad downward for an argument of +constant size shorter than an @code{int}, and upward otherwise. + @item FUNCTION_PROLOGUE (@var{file}, @var{size}) A C compound statement that outputs the assembler code for entry to a function. The prologue is responsible for setting up the stack frame, @@ -6693,6 +6814,12 @@ On many machines, this expression can be Define this macro if it is as good or better to call a constant function address than to call an address kept in a register. +@item PROMOTE_PROTOTYPES +Define this macro if an argument declared as @code{char} or +@code{short} in a prototype should actually be passed as an +@code{int}. In addition to avoiding errors in certain cases of +mismatch, it also makes for better code on certain machines. + @item STORE_FLAG_VALUE A C expression for the value stored by a store-flag instruction (@code{s@var{cond}}) when the condition is true. This is usually 1 or @@ -6850,6 +6977,17 @@ in response to the @samp{-g} option. Define this macro if GNU CC should produce debugging output for SDB in response to the @samp{-g} option. +@item PUT_SDB_@var{op} +Define these macros to override the assembler syntax for the special +SDB assembler directives. See @file{sdbout.c} for a list of these +macros and their arguments. If the standard syntax is used, you need +not define them yourself. + +@item SDB_GENERATE_FAKE +Define this macro to override the usual method of constructing a dummy +name for anonymous structure and union types. See @file{sdbout.c} for +more infomation. + @item DBX_NO_XREFS Define this macro if DBX on your system does not support the construct @samp{xs@var{tagname}}. On some systems, this construct is used to