--- gcc/gcc.texinfo 2018/04/24 16:52:39 1.1.1.8 +++ gcc/gcc.texinfo 2018/04/24 16:55:26 1.1.1.10 @@ -6,7 +6,7 @@ @ifinfo This file documents the use and the internals of the GNU compiler. -Copyright (C) 1988, 1989 Free Software Foundation, Inc. +Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -21,15 +21,18 @@ notice identical to this one except for @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the -section entitled ``GNU General Public License'' is included exactly as -in the original, and provided that the entire resulting derived work is -distributed under the terms of a permission notice identical to this one. +sections entitled ``GNU General Public License'' and ``Protect Your +Freedom---Fight `Look And Feel'@w{}'' are included exactly as in the +original, and provided that the entire resulting derived work is +distributed under the terms of a permission notice identical to this +one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, -except that the section entitled ``GNU General Public License'' and -this permission notice may be included in translations approved by the -Free Software Foundation instead of in the original English. +except that the sections entitled ``GNU General Public License'' and +``Protect Your Freedom---Fight `Look And Feel'@w{}'' and this permission +notice may be included in translations approved by the Free Software +Foundation instead of in the original English. @end ifinfo @setchapternewpage odd @@ -39,12 +42,12 @@ Free Software Foundation instead of in t @sp 2 @center Richard M. Stallman @sp 3 -@center last updated 12 September 1989 +@center last updated 4 December 1990 @sp 1 -@center for version 1.36 +@center for version 1.38 @page @vskip 0pt plus 1filll -Copyright @copyright{} 1988, 1989 Free Software Foundation, Inc. +Copyright @copyright{} 1988, 1989, 1990 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -52,15 +55,18 @@ are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the -section entitled ``GNU General Public License'' is included exactly as -in the original, and provided that the entire resulting derived work is -distributed under the terms of a permission notice identical to this one. +sections entitled ``GNU General Public License'' and ``Protect Your +Freedom---Fight `Look And Feel'@w{}'' are included exactly as in the +original, and provided that the entire resulting derived work is +distributed under the terms of a permission notice identical to this +one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, - foo1 -tail +10 stage2/$file > foo2 +tail +10c $file > foo1 +tail +10c stage2/$file > foo2 cmp foo1 foo2 done @end example +On MIPS machines, you should use the shell script @file{ecoff-cmp} +to compare two object files. + @item Install the compiler driver, the compiler's passes and run-time support. You can use the following command: @@ -1774,6 +1958,21 @@ installs modified, corrected copies of t GNU CC will normally look for them. This script will work on various systems because it chooses the files by searching all the system headers for the problem cases that we know about. + +Use the following command to do this: + +@example +make includes +@end example + +@noindent +If you selected a different directory for GNU CC installation when you +installed it, by specifying the Make variable @code{prefix} or +@code{libdir}, specify it the same way in this command. + +Note that some systems are starting to come with ANSI C system header +files. On these systems, don't run @file{fixincludes}; it may not work, +and is certainly not necessary. @end enumerate If you cannot install the compiler's passes and run-time support in @@ -1854,7 +2053,7 @@ command to compile GNU CC with Sun CC: make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc" @end example -@node 3b1 Install, VMS Install, Sun Install, Installation +@node 3b1 Install, SCO Install, Sun Install, Installation @section Installing GNU CC on the 3b1 Installing GNU CC on the 3b1 is difficult if you do not already have @@ -1879,7 +2078,7 @@ and do @samp{make cpp} again. Copy this final version of GNU cpp into @file{/lib/cpp}. @item -Replace every occurance of @code{obstack_free} in @file{tree.c} +Replace every occurrence of @code{obstack_free} in @file{tree.c} with @code{_obstack_free}. @item @@ -1893,7 +2092,40 @@ Now you can compile GNU CC with itself a fashion. @end enumerate -@node VMS Install,, 3B1 Install, Installation +If you have installed an earlier version of GCC, you can compile the +newer version with that. However, you will run into trouble compiling +@file{gnulib}, since that is normally compiled with CC. To solve the +problem, uncomment this line in @file{Makefile}: + +@example +CCLIBFLAGS = -B/usr/local/lib/gcc- -tp -Wp,-traditional +@end example + +@node SCO Install, VMS Install, 3B1 Install, Installation +@section Installing GNU CC on SCO System V 3.2 +@cindex Installation on SCO systems + +The compiler that comes with this system does not work properly with +@samp{-O}. Therefore, you should redefine the Make variable +@code{CCLIBFLAGS} not to use @samp{-O}. + +In addition, the compiler produces incorrect output when compiling parts +of GNU CC; the resulting executable @file{cc1} does not work properly +when it is used with @samp{-O}. + +Therefore, what you must do after building the first stage +is use GNU CC to compile itself without optimization. Here is how: + +@example +make -k cc1 CC="./gcc -B./" +@end example + +You can think of this as ``stage 1.1'' of the installation process. +However, using this command has the effect of discarding the faulty +stage 1 executable for @file{cc1} and replacing it with stage 1.1. You +can then proceed with @samp{make stage1} and the rest of installation. + +@node VMS Install, HPUX Install, SCO Install, Installation @section Installing GNU CC on VMS The VMS version of GNU CC is distributed in a backup saveset containing @@ -1987,18 +2219,74 @@ requires editing all the @code{gcc} comm have a working 1.33 or newer GNU CC, you can change this file back. @end enumerate -There is a known problem on VMS: @code{const} global variables don't -work compatibly with the VMS C compiler; we don't know a way to get -them to the linker properly. - -Note that GNU CC on VMS does not generate debugging information to -describe the program's symbols. It is not straightforward to implement -this, and we have no time to spend on it, but we might consent to -install a very modular implementation if you write it. You will -probably have to modify GAS as well as GNU CC. +With this version of GNU CC, @code{const} global variables now work +properly. Unless, however, the @code{const} modifier is also specified +in every external declaration of the variable in all of the source files +that use that variable, the linker will issue warnings about conflicting +attributes for the variable, since the linker does not know if the +variable should be read-only. The program will still work, but the +variable will be placed in writable storage. + +Under previous versions of GNU CC, the generated code would occasionally +give strange results when linked to the sharable @file{VAXCRTL} library. +Now this should work. + +Even with this version, however, GNU CC itself should not be linked to +the sharable @file{VAXCRTL}, unless you force the linker to use the +@code{qsort} routine from @file{gcclib.olb}. The @file{qsort} routine +supplied with @file{VAXCRTL} has a bug which causes a compiler crash. +The executable that is generated by @file{make-cc1.com} uses the +non-shared version of @file{VAXCRTL} (and thus the @file{qsort} routine +from @file{gcclib.olb}). + +Note that GNU CC on VMS now generates debugging information to describe +the programs symbols to the VMS debugger. However, you need version 1.37 +or later of GAS in order to output them properly in the object file. + +@node HPUX Install, MIPS Install, VMS Install, Installation +@section Installing GNU CC on HPUX + +To install GNU CC on HPUX, you must start by editing the file +@file{Makefile}. Search for the string @samp{HPUX} to find comments +saying what to change. You need to change some variable definitions and +(if you are using GAS) some lines in the rule for the target +@samp{gnulib}. -@node Trouble, Incompatibilities, Installation, Top -@chapter Known Causes of Trouble with GNU CC. +To avoid errors when linking programs with @samp{-g}, create an empty +library named @file{libg.a}. An easy way to do this is: + +@example +ar rc /usr/local/lib/libg.a +@end example + +To compile with the HPUX C compiler, you must specify get the file +@file{alloca.c} from GNU Emacs. Then, when you run @code{make}, use +this argument: + +@example +make ALLOCA=alloca.o +@end example + +When recompiling GNU CC with itself, do not define @code{ALLOCA}. +Instead, an @samp{-I} option needs to be added to @code{CFLAGS} as +follows: + +@example +make CC=stage1/gcc CFLAGS="-g -O -Bstage1/ -I../binutils/hp-include" +@end example + +@node MIPS Install,, HPUX Install, Installation +@section Installing GNU CC on MIPS + +To avoid errors when linking programs with @samp{-g}, create an empty +library named @file{libg.a}. An easy way to do this is: + +@example +ar rc /usr/local/lib/libg.a +@end example + +@node Trouble, Service, Installation, Top +@chapter Known Causes of Trouble with GNU CC Here are some of the things that have caused trouble for people installing or using GNU CC. @@ -2085,15 +2373,32 @@ the definition of @code{struct mumble} a think it's worth being incompatible for. @end itemize -@node Incompatibilities, Extensions, Trouble, Top + +@node Service, Incompatibilities, Trouble, Top +@chapter How To Get Help with GNU CC + +If you need help installing, using or changing GNU CC, there are two +ways to find it: + +@itemize @bullet +@item +Send a message to a suitable network mailing list. First try +@code{bug-gcc@@prep.ai.mit.edu}, and if that brings no response, try +@code{info-gcc@@prep.ai.mit.edu}. + +@item +Look in the service directory for someone who might help you for a fee. +The service directory is found in the file named @file{SERVICE} in the +GNU CC distribution. +@end itemize + +@node Incompatibilities, Extensions, Service, Top @chapter Incompatibilities of GNU CC There are several noteworthy incompatibilities between GNU C and most -existing (non-ANSI) versions of C. - -Ultimately our intention is that the @samp{-traditional} option will -eliminate most of these incompatibilities by telling GNU C to behave -like the other C compilers. +existing (non-ANSI) versions of C. The @samp{-traditional} option +eliminates most of these incompatibilities, @emph{but not all}, by +telling GNU C to behave like older C compilers. @itemize @bullet @item @@ -2254,6 +2559,21 @@ yet supported in GNU CC, so it isn't str The convention for structure returning is also incompatible, and @samp{-fpcc-struct-return} does not help. + +@item +On Ultrix, the Fortran compiler expects registers 2 through 5 to be saved +by function calls. We have not been able to tell whether the C compiler +agrees with the Fortran compiler. Currently, GNU CC treats these registers +as temporaries on the Vax, which is compatible with BSD Unix. + +If we learn for certain that Ultrix has departed from the traditional +BSD calling convention, we will change GNU CC for Ultrix to fit. In the +mean time, you can use these options to produce code compatible with the +Fortran compiler: + +@example +-fcall-saved-r2 -fcall-saved-r3 -fcall-saved-r4 -fcall-saved-r5 +@end example @end itemize @node Extensions, Bugs, Incompatibilities, Top @@ -2268,24 +2588,24 @@ features in conditional compilation, che @menu * Statement Exprs:: Putting statements and declarations inside expressions. * Naming Types:: Giving a name to the type of some expression. -* Typeof:: @code{typeof}: referring to the type of an expression. -* Lvalues:: Using @samp{?:}, @samp{,} and casts in lvalues. -* Conditionals:: Omitting the middle operand of a @samp{?:} expression. -* Zero-Length:: Zero-length arrays. -* Variable-Length:: Arrays whose length is computed at run time. -* Subscripting:: Any array can be subscripted, even if not an lvalue. -* Pointer Arith:: Arithmetic on @code{void}-pointers and function pointers. -* Initializers:: Non-constant initializers. -* Constructors:: Constructor expressions give structures, unions - or arrays as values. +* Typeof:: @code{typeof}: referring to the type of an expression. +* Lvalues:: Using @samp{?:}, @samp{,} and casts in lvalues. +* Conditionals:: Omitting the middle operand of a @samp{?:} expression. +* Zero-Length:: Zero-length arrays. +* Variable-Length:: Arrays whose length is computed at run time. +* Subscripting:: Any array can be subscripted, even if not an lvalue. +* Pointer Arith:: Arithmetic on @code{void}-pointers and function pointers. +* Initializers:: Non-constant initializers. +* Constructors:: Constructor expressions give structures, unions + or arrays as values. * Function Attributes:: Declaring that functions have no side effects, - or that they can never return. + or that they can never return. * Dollar Signs:: Dollar sign is allowed in identifiers. * Alignment:: Inquiring about the alignment of a type or variable. * Inline:: Defining inline functions (as fast as macros). -* Extended Asm:: Assembler instructions with C expressions as operands. - (With them you can define ``built-in'' functions.) -* Asm Labels:: Specifying the assembler name to use for a C symbol. +* Extended Asm:: Assembler instructions with C expressions as operands. + (With them you can define ``built-in'' functions.) +* Asm Labels:: Specifying the assembler name to use for a C symbol. * Explicit Reg Vars:: Defining variables residing in specified registers. * Alternate Keywords:: @code{__const__}, @code{__asm__}, etc., for header files. @end menu @@ -2747,7 +3067,7 @@ fewer times than the program says. Note that a function that has pointer arguments and examines the data pointed to must @emph{not} be declared @code{const}. Likewise, a -function that calls a non-@code{const} function must not be +function that calls a non-@code{const} function usually must not be @code{const}. Some people object to this feature, claiming that ANSI C's @code{#pragma} @@ -2771,6 +3091,10 @@ I can see, @code{#pragma} is never usefu In GNU C, you may use dollar signs in identifier names. This is because many traditional C implementations allow such identifiers. +Dollar signs are allowed if you specify @samp{-traditional}; they are +not allowed if you specify @samp{-ansi}. Whether they are allowed by +default depends on the target machine; usually, they are not. + @node Alignment, Inline, Dollar Signs, Extensions @section Inquiring about the Alignment of a Type or Variable @@ -3194,7 +3518,7 @@ variable the value it had at the time of machines, however, @code{longjmp} will not change the value of global register variables. To be portable, the function that called @code{setjmp} should make other arrangements to save the values of the global register -variables, and to restore them if a @code{longjmp}. This way, the the same +variables, and to restore them in a @code{longjmp}. This way, the same thing will happen regardless of what @code{longjmp} does. All global register variable declarations must precede all function @@ -3205,7 +3529,7 @@ being used for other purposes in the pre Global register variables may not have initial values, because an executable file has no means to supply initial contents for a register. -@node Local Reg Vars,, Local Reg Vars, Explicit Reg Vars +@node Local Reg Vars,, Global Reg Vars, Explicit Reg Vars @subsection Specifying Registers for Local Variables You can define a local register variable with a specified register @@ -3235,10 +3559,10 @@ automatically, but first we need to figu how to enable you to guide the choice. No solution is evident. Defining such a register variable does not reserve the register; it -remains available for other uses in places where flow control -determines the variable's value is not live. However, these registers -made unavailable for use in the reload pass. I would not be surprised -if excessive use of this feature leaves the compiler too few available +remains available for other uses in places where flow control determines +the variable's value is not live. However, these registers are made +unavailable for use in the reload pass. I would not be surprised if +excessive use of this feature leaves the compiler too few available registers to compile certain functions. @node Alternate Keywords,, Explicit Reg Vars, Extensions @@ -3285,6 +3609,8 @@ information that makes for fixing the bu @menu * Criteria: Bug Criteria. Have you really found a bug? * Reporting: Bug Reporting. How to report a bug effectively. +* Known: Trouble. A list of known problems. +* Help: Service. How to get help. @end menu @node Bug Criteria, Bug Reporting, Bugs, Bugs @@ -4022,9 +4348,9 @@ form uses nested parentheses to indicate * RTL Declarations:: Declaring volatility, constancy, etc. * Side Effects:: Expressions for storing in registers, etc. * Incdec:: Embedded side-effects for autoincrement addressing. -* Assembler:: Representing @code{asm} with operands. +* Assembler:: Representing @code{asm} with operands. * Insns:: Expression types for entire insns. -* Calls:: RTL representation of function call insns. +* Calls:: RTL representation of function call insns. * Sharing:: Some expressions are unique; others *must* be copied. @end menu @@ -4181,6 +4507,11 @@ in certain types of expression. Most of following macros: @table @code +@item EXTERNAL_SYMBOL_P (@var{x}) +In a @code{symbol_ref} expression, nonzero if it corresponds to a variable +declared extern in the users code. Zero for all other variables. Stored in +the @code{volatil} field and printed as @samp{/v}. + @item MEM_VOLATILE_P (@var{x}) In @code{mem} expressions, nonzero for volatile memory references. Stored in the @code{volatil} field and printed as @samp{/v}. @@ -4240,8 +4571,8 @@ Expressions that appear more than once a rules for shared structure (@pxref{Sharing}). @item volatil -This flag is used in @code{mem} and @code{reg} expressions and in insns. -In RTL dump files, it is printed as @samp{/v}. +This flag is used in @code{mem},@code{symbol_ref} and @code{reg} expressions +and in insns. In RTL dump files, it is printed as @samp{/v}. In a @code{mem} expression, it is 1 if the memory reference is volatile. Volatile memory references may not be deleted, reordered or combined. @@ -4249,6 +4580,9 @@ Volatile memory references may not be de In a @code{reg} expression, it is 1 if the value is a user-level variable. 0 indicates an internal compiler temporary. +In a @code{symbol_ref} expression, it is 1 if the symbol is declared +@code{extern}. + In an insn, 1 means the insn has been deleted. @item in_struct @@ -4615,11 +4949,28 @@ floating value. @item (cc0) This refers to the machine's condition code register. It has no -operands and may not have a machine mode. It may be validly used in -only two contexts: as the destination of an assignment (in test and -compare instructions) and in comparison operators comparing against -zero (@code{const_int} with value zero; that is to say, -@code{const0_rtx}). +operands and may not have a machine mode. There are two ways to use it: + +@itemize @bullet +@item +To stand for a complete set of condition code flags. This is best on +most machines, where each comparison sets the entire series of flags. + +With this technique, @code{(cc0)} may be validly used in only two +contexts: as the destination of an assignment (in test and compare +instructions) and in comparison operators comparing against zero +(@code{const_int} with value zero; that is to say, @code{const0_rtx}). + +@item +To stand for a single flag that is the result of a single condition. +This is useful on machines that have only a single flag bit, and in +which comparison instructions must specify the condition to test. + +With this technique, @code{(cc0)} may be validly used in only two +contexts: as the destination of an assignment (in test and compare +instructions) where the source is a comparison operator, and as the +first operand of @code{if_then_else} (in a conditional branch). +@end itemize There is only one expression object of code @code{cc0}; it is the value of the variable @code{cc0_rtx}. Any attempt to create an @@ -4635,6 +4986,11 @@ the macro @code{NOTICE_UPDATE_CC}). Onl purpose is to set the condition code, and instructions that use the condition code, need mention @code{(cc0)}. +In some cases, better code may result from recognizing combinations or +peepholes that include instructions that set the condition codes, even +in cases where some reloading is inevitable. For examples, search for +@samp{addcc} and @samp{andcc} in @file{sparc.md}. + @item (pc) This represents the machine's program counter. It has no operands and may not have a machine mode. @code{(pc)} may be validly used only in @@ -4778,7 +5134,7 @@ Represents the square root of @var{x}, c a floating point mode. @item (ffs:@var{m} @var{x}) -Represents the one plus the index of the least significant 1-bit in +Represents one plus the index of the least significant 1-bit in @var{x}, represented as an integer of mode @var{m}. (The value is zero if @var{x} is zero.) The mode of @var{x} need not be @var{m}; depending on the target machine, various mode combinations may be @@ -4788,12 +5144,13 @@ valid. @node Comparisons, Bit Fields, Arithmetic, RTL @section Comparison Operations -Comparison operators test a relation on two operands and are considered to -represent the value 1 if the relation holds, or zero if it does not. The -mode of the comparison is determined by the operands; they must both be -valid for a common machine mode. A comparison with both operands constant -would be invalid as the machine mode could not be deduced from it, but such -a comparison should never exist in RTL due to constant folding. +Comparison operators test a relation on two operands and are considered +to represent a machine-dependent nonzero value (@code{STORE_FLAG_VALUE}) +if the relation holds, or zero if it does not. The mode of the +comparison is determined by the operands; they must both be valid for a +common machine mode. A comparison with both operands constant would be +invalid as the machine mode could not be deduced from it, but such a +comparison should never exist in RTL due to constant folding. Inequality comparisons come in two flavors, signed and unsigned. Thus, there are distinct expression codes @code{gt} and @code{gtu} for signed and @@ -4858,7 +5215,7 @@ to express conditional jumps. Special expression codes exist to represent bit-field instructions. These types of expressions are lvalues in RTL; they may appear -on the left side of a assignment, indicating insertion of a value +on the left side of an assignment, indicating insertion of a value into the specified bit field. @table @code @@ -5117,10 +5474,10 @@ instruction this way: @example (parallel [(set (cc0) (reg:SI 34)) - (set (pc) (if_then_else - (eq (cc0) (const_int 0)) - (label_ref @dots{}) - (pc)))]) + (set (pc) (if_then_else + (eq (cc0) (const_int 0)) + (label_ref @dots{}) + (pc)))]) @end example @noindent @@ -5318,7 +5675,8 @@ These four are described in a table belo The expression code @code{jump_insn} is used for instructions that may jump (or, more generally, may contain @code{label_ref} expressions). @code{jump_insn} insns have the same extra fields as @code{insn} insns, -accessed in the same way. +accessed in the same way. If there is an instruction to return from the +current function, it is recorded as a @code{jump_insn}. @item call_insn The expression code @code{call_insn} is used for instructions that may do @@ -5381,7 +5739,7 @@ optimization. @item NOTE_INSN_SETJMP Appears following each call to @code{setjmp} or a related function. -@item NOTE_INSN_LOOP_BEG +@item NOTE_INSN_LOOP_CONT Appears at the place in a loop that @code{continue} statements jump to. @end table @@ -5538,7 +5896,7 @@ the value is returned in a hard register @example (set (reg:@var{m} @var{r}) - (call @var{nbytes} (mem:@var{fm} @var{addr}))) + (call (mem:@var{fm} @var{addr}) @var{nbytes})) @end example @noindent @@ -5715,10 +6073,10 @@ like. It is incomplete because it may c and @code{match_dup} expressions that stand for operands of the instruction. -If the vector has only one element, that element is what the -instruction should look like. If the vector has multiple elements, -then the instruction looks like a @code{parallel} expression -containing that many elements as described. +If the vector has only one element, that element is the template for the +instruction pattern. If the vector has multiple elements, then the +instruction pattern is a @code{parallel} expression containing the +elements described. @item A condition. This is a string which contains a C expression that is @@ -6175,12 +6533,12 @@ value. So why use @samp{s} instead of @ better code to be generated. For example, on the 68000 in a fullword instruction it is possible to -use an immediate operand; but if the immediate value is between -32 -and 31, better code results from loading the value into a register and +use an immediate operand; but if the immediate value is between -128 +and 127, better code results from loading the value into a register and using the register. This is because the load into the register can be done with a @samp{moveq} instruction. We arrange for this to happen by defining the letter @samp{K} to mean ``any integer outside the -range -32 to 31'', and then specifying @samp{Ks} in the operand +range -128 to 127'', and then specifying @samp{Ks} in the operand constraints. @item @samp{g} @@ -6344,17 +6702,17 @@ Here is how it is done for fullword logi @example (define_insn "iorsi3" - [(set (match_operand:SI 0 "general_operand" "=%m,d") - (ior:SI (match_operand:SI 1 "general_operand" "0,0") + [(set (match_operand:SI 0 "general_operand" "=m,d") + (ior:SI (match_operand:SI 1 "general_operand" "%0,0") (match_operand:SI 2 "general_operand" "dKs,dmKs")))] @dots{}) @end example The first alternative has @samp{m} (memory) for operand 0, @samp{0} for -operand 1 (meaning it must match operand 0), and @samp{dKs} for operand 2. -The second alternative has @samp{d} (data register) for operand 0, @samp{0} -for operand 1, and @samp{dmKs} for operand 2. The @samp{=} and @samp{%} in -the constraint for operand 0 are not part of any alternative; their meaning +operand 1 (meaning it must match operand 0), and @samp{dKs} for operand +2. The second alternative has @samp{d} (data register) for operand 0, +@samp{0} for operand 1, and @samp{dmKs} for operand 2. The @samp{=} and +@samp{%} in the constraints apply to all the alternatives; their meaning is explained in the next section. If all the operands fit any one alternative, the instruction is valid. @@ -6559,9 +6917,23 @@ machine description, but typically on a pseudo registers that did not get hard registers, while on other machines explicit memory references will get optional reloads. -In addition, the constraints must allow any hard register to be moved -to any other hard register (provided that @code{HARD_REGNO_MODE_OK} -permits mode @var{m} in each of the registers). +The constraints on a @samp{move@var{m}} must allow any hard register to +be moved to any other hard register (provided that +@code{HARD_REGNO_MODE_OK} permits mode @var{m} in both registers). + +It is obligatory to support floating point @samp{move@var{m}} +instructions into and out of any registers that can hold fixed point +values, because unions and structures (which have modes @code{SImode} or +@code{DImode}) can be in those registers and they may have floating +point members. + +There may also be a need to support fixed point @samp{move@var{m}} +instructions in and out of floating point registers. Unfortunately, I +have forgotten why this was so, and I don't know whether it is still +true. If @code{HARD_REGNO_MODE_OK} rejects fixed point values in +floating point registers, then the constraints of the fixed point +@samp{move@var{m}} instructions must be designed to avoid ever trying to +reload into a floating point register. @item @samp{movstrict@var{m}} Like @samp{mov@var{m}} except that if operand 0 is a @code{subreg} @@ -6602,15 +6974,6 @@ in operand 0 and a remainder stored in o @item @samp{udivmod@var{m}4} Similar, but does unsigned division. -@item @samp{divmod@var{m}@var{n}4} -Like @samp{divmod@var{m}4} except that only the dividend has mode -@var{m}; the divisor, quotient and remainder have mode @var{n}. -For example, the Vax has a @samp{divmoddisi4} instruction -(but it is omitted from the machine description, because it -is so slow that it is faster to compute remainders by the -circumlocution that the compiler will use if this instruction is -not available). - @item @samp{ashl@var{m}3} Arithmetic-shift operand 1 left by a number of bits specified by operand 2, and store the result in operand 0. Operand 2 has @@ -6685,8 +7048,14 @@ in lexicographic order. The effect of t the condition codes. @item @samp{float@var{m}@var{n}2} -Convert operand 1 (valid for fixed point mode @var{m}) to floating -point mode @var{n} and store in operand 0 (which has mode @var{n}). +Convert signed integer operand 1 (valid for fixed point mode @var{m}) to +floating point mode @var{n} and store in operand 0 (which has mode +@var{n}). + +@item @samp{floatuns@var{m}@var{n}2} +Convert unsigned integer operand 1 (valid for fixed point mode @var{m}) +to floating point mode @var{n} and store in operand 0 (which has mode +@var{n}). @item @samp{fix@var{m}@var{n}2} Convert operand 1 (valid for floating point mode @var{m}) to fixed @@ -6731,7 +7100,7 @@ point. @item @samp{extv} Extract a bit-field from operand 1 (a register or memory operand), where operand 2 specifies the width in bits and operand 3 the starting -bit, and store it in operand 0. Operand 0 must have @code{Simode}. +bit, and store it in operand 0. Operand 0 must have @code{SImode}. Operand 1 may have mode @code{QImode} or @code{SImode}; often @code{SImode} is allowed only for registers. Operands 2 and 3 must be valid for @code{SImode}. @@ -6848,8 +7217,8 @@ is no @samp{casesi} pattern. This pattern requires two operands: the address or offset, and a label which should immediately precede the jump table. If the macro @code{CASE_VECTOR_PC_RELATIVE} is defined then the first operand is an -absolute address to jump to; otherwise, it is an offset which counts -from the address of the table. +offset that counts from the address of the table; otherwise, it is an +absolute address to jump to. The @samp{tablejump} insn is always the last insn before the jump table it uses. Its assembler code normally has no need to use the @@ -7430,7 +7799,7 @@ link to it. The header file @file{confi compiler source files include @file{config.h}. @menu -* Run-time Target:: Defining -m options like -m68000 and -m68020. +* Run-time Target:: Defining @samp{-m} options like @samp{-m68000} and @samp{-m68020}. * Storage Layout:: Defining sizes and alignments of data types. * Registers:: Naming and describing the hardware registers. * Register Classes:: Defining the classes of hardware registers. @@ -7642,6 +8011,9 @@ of some instances of PCC: a bit field wh @code{int} has the same effect on the size and alignment of a structure as an actual @code{int} would have. +If the macro is defined, then its definition should be a C expression; +a nonzero value for the expression enables PCC-compatible behavior. + 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. @@ -7778,7 +8150,7 @@ stack.) If this macro is not defined, it means that no death notes need to be preserved. This is the usual situation. -@item HARD_REGNO_REGS (@var{regno}, @var{mode}) +@item HARD_REGNO_NREGS (@var{regno}, @var{mode}) A C expression for the number of consecutive hard registers, starting at register number @var{regno}, required to hold a value of mode @var{mode}. @@ -7822,34 +8194,27 @@ can hold integers can safely @emph{hold} mode, whether or not floating arithmetic can be done on it in those registers. -The true significance of special floating registers is rather that -non-floating-point machine modes @emph{may not} go in those registers. -This is true if the floating registers normalize any value stored in -them, because storing a non-floating value there would garble it. If -the floating registers do not automatically normalize, if you can -store any bit pattern in one and retrieve it unchanged without a trap, -then any machine mode may go in a floating register and this macro -should say so. - -Sometimes there are floating registers that are especially slow to -access, so that it is better to store a value in a stack frame than in -such a register if floating point arithmetic is not being done. As long -as the floating registers are not in class @code{GENERAL_REGS}, they -will not be used unless some insn's constraint asks for one. - -It is obligatory to support floating point `move' instructions into -and out of any registers that can hold fixed point values, because -unions and structures (which have modes @code{SImode} or -@code{DImode}) can be in those registers and they may have floating -point members. - -There may also be a need to support fixed point `move' instructions in -and out of floating point registers. Unfortunately, I have forgotten -why this was so, and I don't know whether it is still true. If -@code{HARD_REGNO_MODE_OK} rejects fixed point values in floating point -registers, then the constraints of the fixed point `move' instructions -must be designed to avoid ever trying to reload into a floating point -register. +On some machines, though, the converse is true: fixed-point machine +modes may not go in floating registers. This is true if the floating +registers normalize any value stored in them, because storing a +non-floating value there would garble it. In this case, +@code{HARD_REGNO_MODE_OK} should reject fixed-point machine modes in +floating registers. But if the floating registers do not automatically +normalize, if you can store any bit pattern in one and retrieve it +unchanged without a trap, then any machine mode may go in a floating +register and this macro should say so. + +The primary significance of special floating registers is rather that +they are the registers acceptable in floating point arithmetic +instructions. However, this is of no concern to +@code{HARD_REGNO_MODE_OK}. You handle it by writing the proper +constraints for those instructions. + +On some machines, the floating registers are especially slow to access, +so that it is better to store a value in a stack frame than in such a +register if floating point arithmetic is not being done. As long as the +floating registers are not in class @code{GENERAL_REGS}, they will not +be used unless some insn's constraint asks for one. @item MODES_TIEABLE_P (@var{mode1}, @var{mode2}) A C expression that is nonzero if it is desirable to choose register @@ -7877,14 +8242,16 @@ hardware determines which register this can choose any register you wish for this purpose. @item FRAME_POINTER_REQUIRED -A C expression which is nonzero if a function must have and use a -frame pointer. This expression is evaluated in the reload pass, in -the function @code{reload}, and it can in principle examine the -current function and decide according to the facts, but on most -machines the constant 0 or the constant 1 suffices. Use 0 when the -machine allows code to be generated with no frame pointer, and doing -so saves some time or space. Use 1 when there is no possible -advantage to avoiding a frame pointer. +A C expression which is nonzero if a function must have and use a frame +pointer. This expression is evaluated twice: at the beginning of +generating RTL, and in the reload pass. If its value is nonzero at +either time, then the function will have a frame pointer. + +The expression can in principle examine the current function and decide +according to the facts, but on most machines the constant 0 or the +constant 1 suffices. Use 0 when the machine allows code to be generated +with no frame pointer, and doing so saves some time or space. Use 1 +when there is no possible advantage to avoiding a frame pointer. In certain cases, the compiler does not know how to produce valid code without a frame pointer. The compiler recognizes those cases and @@ -8235,6 +8602,15 @@ of the first parameter's shadow location pointer value. (That value is itself computed by adding the value of @code{STACK_POINTER_OFFSET} to the stack pointer register.) +@item REG_PARM_STACK_SPACE +Define this macro if functions should assume that stack space has been +allocated for arguments even when their values are passed in +registers. + +The actual allocation of such space would be done either by +the call instruction or by the function prologue, or by +defining @code{FIRST_PARM_CALLER_OFFSET}. + @item STACK_ARGS_ADJUST (@var{size}) Define this macro if the machine requires padding on the stack for certain function calls. This is padding on a per-function-call basis, @@ -8283,6 +8659,9 @@ nothing (the caller pops all). When thi @var{funtype} is examined to determine whether a function takes a fixed number of arguments. +When this macro returns nonzero, the macro @code{FRAME_POINTER_REQUIRED} +must also return nonzero for proper operation. + @item FUNCTION_VALUE (@var{valtype}, @var{func}) A C expression to create an RTX representing the place where a function returns a value of data type @var{valtype}. @var{valtype} is @@ -8481,8 +8860,8 @@ frame pointer is in wanted, the macro ca @code{frame_pointer_needed}. The variable's value will be 1 at run time in a function that needs a frame pointer. -On machines where arguments may be passed in registers, and not have -stack space allocated, this macro must examine the variable +On machines where an argument may be passed partly in registers and +partly in memory, this macro must examine the variable @code{current_function_pretend_args_size}, and allocate that many bytes of uninitialized space on the stack just underneath the first argument arriving on the stack. (This may not be at the very end of the stack, @@ -8490,11 +8869,6 @@ if the calling sequence has pushed anyth arguments. But usually, on such machines, nothing else has been pushed yet, because the function prologue itself does all the pushing.) -This ``pretend argument'' space is allocated in functions that use the -ANSI library @file{stdarg.h} to accept anonymous arguments of -unspecified types; the last named argument is copied into the space, so -that the anonymous arguments follow it consecutively. - @item FUNCTION_PROFILER (@var{file}, @var{labelno}) A C statement or compound statement to output to @var{file} some assembler code to call the profiling subroutine @code{mcount}. @@ -8549,7 +8923,7 @@ Of course, since you are writing the def can take a short cut in the definition of this macro and use the name that you know will result. -@item EXIT_IGNORES_STACK +@item EXIT_IGNORE_STACK Define this macro as a C expression that is nonzero if the return instruction or the function epilogue ignores the value of the stack pointer; in other words, if it is safe to delete an instruction to @@ -8558,7 +8932,7 @@ adjust the stack pointer before a return Note that this macro's value is relevant only for functions for which frame pointers are maintained. It is never safe to delete a final stack adjustment in a function that has no frame pointer, and the -compiler knows this regardless of @code{EXIT_IGNORES_STACK}. +compiler knows this regardless of @code{EXIT_IGNORE_STACK}. @item FUNCTION_EPILOGUE (@var{file}, @var{size}) A C compound statement that outputs the assembler code for exit from a @@ -8694,7 +9068,9 @@ are supported. @item MAX_REGS_PER_ADDRESS A number, the maximum number of registers that can appear in a valid -memory address. +memory address. Note that it is up to you to specify a value equal to +the maximum number that @code{go_if_legitimate_address} would ever +accept. @item GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label}) A C compound statement with a conditional @code{goto @var{label};} @@ -8872,7 +9248,7 @@ processing a sequence, otherwise it cont being output. @end table -@node Condition Code, Misc, Delayed Branch, Machine Macros +@node Condition Code, Cross-compilation, Delayed Branch, Machine Macros @section Condition Code Information The file @file{conditions.h} defines a variable @code{cc_status} to @@ -8891,8 +9267,10 @@ C code for a data type which is used for component of @code{cc_status}. It defaults to @code{int}. @item CC_STATUS_MDEP_INIT -A C expression for the initial value of the @code{mdep} field. It -defaults to 0. +A C expression to initialize the @code{mdep} field to ``empty''. +The default definition does nothing, since most machines don't use +the field anyway. If you want to use the field, you should probably +define this macro to initialize it. @item NOTICE_UPDATE_CC (@var{exp}, @var{insn}) A C compound statement to set the components of @code{cc_status} @@ -8927,7 +9305,7 @@ insns is not sufficient to indicate what @node Cross-compilation, Misc, Condition Code, Machine Macros @section Cross Compilation and Floating-Point Format -While all modern machines use 2's compliment representation for integers, +While all modern machines use 2's complement representation for integers, there are a variety of representations for floating point numbers. This means that in a cross-compiler the representation of floating point numbers in the compiled program may be different from that used in the machine @@ -9161,7 +9539,7 @@ mismatch, it also makes for better code @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 --1; it is required to be an odd number. +-1; it is required to be an odd number or a negative number. Do not define @code{STORE_FLAG_VALUE} if the machine has no store-flag instructions. @@ -9212,31 +9590,6 @@ obtained with @code{GET_CODE (@var{x})}. @item DOLLARS_IN_IDENTIFIERS Define this to be nonzero if the character @samp{$} should be allowed by default in identifier names. - -@item USE_C_ALLOCA -Define this macro to indicate that the compiler is running with the -@code{alloca} implemented in C. This version of @code{alloca} can be -found in the file @file{alloca.c}; to use it, you must also edit the -@file{Makefile}. - -This macro, unlike most, describes the machine that the compiler is -running on, rather than the one the compiler is compiling for. -Therefore, it should be set in the @file{xm-@var{machine}.h} file -rather than in the @file{tm-@var{machine}.h} file. - -If you do define this macro, you should probably do it as follows: - -@example -#ifndef __GNUC__ -#define USE_C_ALLOCA -#else -#define alloca __builtin_alloca -#endif -@end example - -@noindent -so that when the compiler is compiled with GNU CC it uses the more -efficient built-in @code{alloca} function. @end table @node Assembler Format,, Misc, Machine Macros @@ -9416,7 +9769,7 @@ 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. +more information. @item DBX_NO_XREFS Define this macro if DBX on your system does not support the construct @@ -9617,10 +9970,10 @@ instruction to assemble a @code{float} c @itemx ASM_OUTPUT_CHAR (@var{stream}, @var{exp}) A C statement to output to the stdio stream @var{stream} an assembler instruction to assemble a @code{int}, @code{short} or @code{char} -constant whose value is @var{value}. The argument @var{exp} will be -an RTL expression which represents a constant value. Use -@samp{output_addr_const (@var{exp})} to output this value as an -assembler expression.@refill +constant whose value is @var{value}. The argument @var{exp} will be an +RTL expression which represents a constant value. Use +@samp{output_addr_const (@var{stream}, @var{exp})} to output this value +as an assembler expression.@refill @item ASM_OUTPUT_DOUBLE_INT (@var{stream}, @var{exp}) A C statement to output to the stdio stream @var{stream} an assembler @@ -9827,6 +10180,31 @@ exits after serious errors. @item SUCCESS_EXIT_CODE A C expression for the status code to be returned when the compiler exits without serious errors. + +@item USE_C_ALLOCA +Define this macro to indicate that the compiler is running with the +@code{alloca} implemented in C. This version of @code{alloca} can be +found in the file @file{alloca.c}; to use it, you must also alter the +@file{Makefile} variable @code{ALLOCA}. + +This macro, unlike most, describes the machine that the compiler is +running on, rather than the one the compiler is compiling for. +Therefore, it should be set in the @file{xm-@var{machine}.h} file +rather than in the @file{tm-@var{machine}.h} file. + +If you do define this macro, you should probably do it as follows: + +@example +#ifndef __GNUC__ +#define USE_C_ALLOCA +#else +#define alloca __builtin_alloca +#endif +@end example + +@noindent +so that when the compiler is compiled with GNU CC it uses the more +efficient built-in @code{alloca} function. @end table In addition, configuration files for system V define @code{bcopy},