--- gcc/gcc.texinfo 2018/04/24 16:52:39 1.1.1.8 +++ gcc/gcc.texinfo 2018/04/24 17:02:43 1.1.1.14 @@ -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 19 Sep 1992 @sp 1 -@center for version 1.36 +@center for version 1.42 @page @vskip 0pt plus 1filll -Copyright @copyright{} 1988, 1989 Free Software Foundation, Inc. +Copyright @copyright{} 1988, 1989, 1990, 1991, 1992 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: @@ -1742,12 +1959,23 @@ make install @end example @noindent -This copies the files @file{cc1}, @file{cpp} and @file{gnulib} to -files @file{gcc-cc1}, @file{gcc-cpp} and @file{gcc-gnulib} in -directory @file{/usr/local/lib}, which is where the compiler driver -program looks for them. It also copies the driver program @file{gcc} -into the directory @file{/usr/local/bin}, so that it appears in typical -execution search paths.@refill +On some machines, you will find that starts to recompile the @file{.c} +files, due to a bug in Make. If that happens, cancel it and try again +specifying the same values for Make variables that you used in the last +compilation; that may not prevent the spurious recompilation, but will +at least do it properly. For example: + +@example +make CC=stage2/gcc CFLAGS="-g -O -Bstage2/" install +@end example + +@noindent +The @samp{install} target copies the files @file{cc1}, @file{cpp} and +@file{gnulib} to files @file{gcc-cc1}, @file{gcc-cpp} and +@file{gcc-gnulib} in directory @file{/usr/local/lib}, which is where the +compiler driver program looks for them. It also copies the driver +program @file{gcc} into the directory @file{/usr/local/bin}, so that it +appears in typical execution search paths.@refill @strong{Warning: there is a bug in @code{alloca} in the Sun library. To avoid this bug, install the binaries of GNU CC that were compiled @@ -1774,6 +2002,27 @@ 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. + +@strong{Warning:} @file{fixincludes} does not work on many MIPS systems, +because those systems come with circular symbolic links which cause +@samp{ls -lR} to go into an infinite loop. The same problem may occur +on some versions of SunOS. If you encounter this problem, try using +@file{fixinc.new} instead opf @code{fixincludes}. @end enumerate If you cannot install the compiler's passes and run-time support in @@ -1843,18 +2092,34 @@ To avoid this bug, install the binaries GNU CC. They use @code{alloca} as a built-in function and never the one in the library. -Some versions of the Sun compiler crash when compiling GNU CC. -The problem is a segmentation fault in cpp. - -This problem seems to be due to the bulk of data in the environment -variables. You may be able to avoid it by using the following -command to compile GNU CC with Sun CC: +Some versions of the Sun compiler crash when compiling GNU CC, with a +segmentation fault in cpp. This can sometimes be due to the bulk of +data in the environment variables. You may be able to avoid it by using +the following command to compile GNU CC with Sun CC: @example make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc" @end example -@node 3b1 Install, VMS Install, Sun Install, Installation +Another problem that often happens on Suns is that you get a crash when +building stage 2, when @code{genflags} is run. + +One reason for such as crash is if you configured GNU CC for the wrong +version of SunOS. Starting with version 1.38, configurations @code{sun3} +and @code{sun4} are for SunOS 4, so this problem should no longer happen. + +Another cause of the same symptom is having installed the GNU linker +with an earlier version of SunOS. The version that worked before +stopped working due to a change in the format of executables in SunOS +4.1. Many sites have installed the GNU linker as +@file{/usr/local/lib/gcc-ld}, often as part of installing GNU C++. So +if you get such crashes and you have used the proper configuration, try +deleting @file{/usr/local/lib/gcc-ld}. + +The current version of the GNU linker, found in the current binutils +release, does work with SunOS 4.1. + +@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 +2144,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 +2158,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}. + +You should also edit @file{Makefile} to enable the lines that set +@code{CLIB} to @code{-lPW}, and the ones specifically labeled as being +for SCO, that set @code{RANLIB}, and that set @code{CC} and @code{OLDCC} +to @samp{rcc -Di386 -DM_UNIX -DM_I386 -DM_SYSV -DM_COFF}. + +Also, edit the definition of @code{USER_H} to remove the file @file{limits.h}. + +Then you can run @samp{config.gcc i386-sco} and finish building GNU CC +normally. + +Note that the function @code{memmove} is broken in 3.2v2; it clobbers +register @code{%ebx}. See the file @file{sco-memmove.s}. + +The same recipe should work on ESIX, but use @samp{config.gcc i386-esix} +instead. + +@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 +2285,140 @@ 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. +Due to the differences between the filesystems of Unix and VMS, the +preprocessor attempts to translate the names of include files into +something that VMS will understand. The basic strategy is to prepend a +prefix to the specification of the include file, convert the whole +filename to a VMS filename, and then try to open the file. The +preprocessor tries various prefixes until one of them succeeds. + +The first prefix is the @samp{GNU_CC_INCLUDE:} logical name: this is +where GNU_C header files are traditionally stored. If a header file is +not found there, @samp{SYS$SYSROOT:[SYSLIB.]} is tried next. If the +preprocessor is still unable to locate the file, it then assumes that +the include file specification is a valid VMS filename all by itself, +and it uses this filename to attempt to open the include file. If none +of these strategies succeeds, the preprocessor reports an error. + +If you wish to store header files in non-standard locations, then you +can assign the logical @samp{GNU_CC_INCLUDE} to be a search list, where +each element of the list is suitable for use with a rooted logical. + +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. + +Due to an assembler bug, offsets to static constants are sometimes +incorrectly evaluated. This bug is present in GAS 1.38.1, and should be +fixed in the next version. + +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}. The @file{qsort} routine supplied with @file{VAXCRTL} +has a bug which can cause a compiler crash. + +Similarly, the preprocessor should not be linked to the sharable +@file{VAXCRTL}. The @code{strncat} routine supplied with @file{VAXCRTL} has a +bug which can cause the preprocessor to go into an infinite loop. + +It should be pointed out that if you attempt to link to the sharable +@file{VAXCRTL}, the VMS linker will strongly resist any effort to force +it to use the @code{qsort} and @code{strncat} routines from +@file{gcclib}. Until the bugs in @file{VAXCRTL} have been fixed, +linking any of the compiler components to the sharable VAXCRTL is not +recommended. (These routines can be bypassed by placing duplicate copies +of @code{qsort} and @code{strncat} in @file{gcclib} under different +names, and patching the compiler sources to use these routines). Both +of the bugs in @file{VAXCRTL} are still present in VMS version 5.4-1, +which is the most recent version as of this writing. + +The executables that are generated by @file{make-cc1.com} and +@file{make-cccp.com} use the non-shared version of @file{VAXCRTL} (and +thus use the @code{qsort} and @code{strncat} routines 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. + +The VMS linker does not distinguish between upper and lower case letters +in function and variable names. However, usual practice in C is to +distinguish case. Normally GNU C (by means of the assembler GAS) +implements usual C behavior by augmenting each name that is not all +lower-case. A name is augmented by truncating it to at most 23 +characters and then adding more characters at the end which encode the +case pattern the rest. + +Name augmentation yields bad results for programs that use precompiled +libraries (such as Xlib) which were generated by another compiler. Use +the compiler option @samp{/NOCASE_HACK} to inhibits augmentation; it +makes external C functions and variables case-independent as is usual on +VMS. Alternatively, you could write all references to the functions and +variables in such libraries using lower case; this will work on VMS, but +is not portable to other systems. In cases where you need to +selectively inhibit augmentation, you can define a macro for each mixed +case symbol for which you wish to inhibit augmentation, where the macro +expands into the lower case equivalent of the name. + +@node HPUX Install, Tower 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}. + +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 Tower Install,, HPUX Install, Installation +@section Installing GNU CC on an NCR Tower + +On an NCR Tower model 4x0 or 6x0, you may have trouble because the +default maximum virtual address size of a process is just 1 Mb. Most +often you will find this problem while compiling GNU CC with itself. + +The only way to solve the problem is to reconfigure the kernel. +Add a line such as this to the configuration file: + +@example +MAXUMEM = 4096 +@end example + +@noindent +and then relink the kernel and reboot the machine. + -@node Trouble, Incompatibilities, Installation, Top -@chapter Known Causes of Trouble with GNU CC. +@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. @@ -2030,12 +2450,6 @@ as @code{REAL_VALUE_TYPE}. But doing so work for each target machine. @xref{Cross-compilation}. @item -DBX rejects some files produced by GNU CC, though it accepts similar -constructs in output from PCC. Until someone can supply a coherent -description of what is valid DBX input and what is not, there is -nothing I can do about these problems. You are on your own. - -@item Users often think it is a bug when GNU CC reports an error for code like this: @@ -2085,15 +2499,33 @@ the definition of @code{struct mumble} a think it's worth being incompatible for. @end itemize -@node Incompatibilities, Extensions, Trouble, Top +Additional problems are described in @ref{Incompatibilities}. + +@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{help-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 @@ -2242,18 +2674,83 @@ method is not used in GNU CC because it You can tell GNU CC to use the PCC convention with the option @samp{-fpcc-struct-return}. +@end itemize + +There are also system-specific incompatibilities. +@itemize @bullet @item On the Sparc, GNU CC uses an incompatible calling convention for -structures. It passes them by including their contents in the argument -list, whereas the standard compiler passes them effectively by -reference. +structures and unions. It passes them by including their contents in +the argument list, whereas the standard compiler passes them effectively +by reference. + +This is hard to fix in GCC version 1. GNU CC version 2 will use a +compatible calling convention. + +The convention for structure or union returning is also incompatible, +and @samp{-fpcc-struct-return} does not help. + +System functions which can't be called properly from code compiled with +GCC include @code{fetch}, @code{store}, @code{delete}, @code{firstkey}, +@code{nextkey}, @code{inet_makeaddr}, @code{inet_lnaof}, +@code{inet_netof}, @code{inet_ntoa}, @code{mallinfo}, +@code{pmap_rmtcall}, @code{clnt_call}, @code{clntudp_bufcreate} and +@code{clntudp_create}. + +@item +One consequence of the unusual calling convention used on the Sparc +is that structures with less than word alignment do not work right +when passed as arguments to varargs functions. + +It's not easy to fix this problem. In any case, it will be gone in +version 2 as a result of the changed calling convention. + +@item +The Sparc version of @code{setjmp} interacts badly with unexpected stack +adjustments. With rare exceptions, you cannot use @code{setjmp} in a +function which moves the stack pointer. + +In the current version of GNU CC, there are three ways that the stack +pointer can change value: (1) calls to @code{alloca}, (2) use of +variable-sized objects, and (3) calls to functions with parameters that +do not all fit in the argument-passing registers (e.g., more than 6 +parameters). You should avoid all three in functions that call +@code{setjmp}. + +The cause of the problem is the way that Sun implemented register +windows. The 64 bytes at addresses @code{%sp} through @code{%sp+63} +correspond to the register window save area. When a register window +must be spilled, its stack pointer is located, and the registers are +dumped starting at that address. Similarly, when a register window must +be restored, its stack pointer is located, and the registers are +restored from that address. + +When @code{setjmp} is called, the current register window's registers +are saved into the register save area, and when @code{longjmp} is +called, they are restored (actually, @emph{all} register windows are +restored from all valid register windows at the time @code{longjmp} is +called). If there is a change in the value of the stack pointer bewteen +the @code{setjmp} and @code{longjmp} calls, when the registers are +restored, they are restored with random values. + +@item +On Ultrix, the Fortran compiler expects registers 2 through 5 to be saved +by function calls. However, the C compiler uses conventions compatible +with BSD Unix: registers 2 through 5 may be clobbered by function calls. -This really ought to be fixed, but such calling conventions are not -yet supported in GNU CC, so it isn't straightforward to fix it. +GNU CC uses the same convention as the Ultrix C compiler. You can use +these options to produce code compatible with the Fortran compiler: -The convention for structure returning is also incompatible, and -@samp{-fpcc-struct-return} does not help. +@example +-fcall-saved-r2 -fcall-saved-r3 -fcall-saved-r4 -fcall-saved-r5 +@end example + +@item +DBX rejects some files produced by GNU CC, though it accepts similar +constructs in output from PCC. Until someone can supply a coherent +description of what is valid DBX input and what is not, there is +nothing I can do about these problems. You are on your own. @end itemize @node Extensions, Bugs, Incompatibilities, Top @@ -2268,24 +2765,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 @@ -2482,27 +2979,17 @@ expressions are equivalent: (a ? b = 5 : (c = 5)) @end example -A cast is a valid lvalue if its operand is valid. Taking the address of -the cast is the same as taking the address without a cast, except for the -type of the result. For example, these two expressions are equivalent (but -the second may be valid when the type of @code{a} does not permit a cast to -@code{int *}). - -@example -&(int *)a -(int **)&a -@end example - -A simple assignment whose left-hand side is a cast works by converting the -right-hand side first to the specified type, then to the type of the inner -left-hand side expression. After this is stored, the value is converter -back to the specified type to become the value of the assignment. Thus, if -@code{a} has type @code{char *}, the following two expressions are -equivalent: +A cast is a valid lvalue if its operand is an lvalue. A simple +assignment whose left-hand side is a cast works by converting the +right-hand side first to the specified type, then to the type of the +inner left-hand side expression. After this is stored, the value is +converted back to the specified type to become the value of the +assignment. Thus, if @code{a} has type @code{char *}, the following two +expressions are equivalent: @example (int)a = 5 -(int)(a = (char *)5) +(int)(a = (char *)(int)5) @end example An assignment-with-arithmetic operation such as @samp{+=} applied to a cast @@ -2512,9 +2999,26 @@ equivalent: @example (int)a += 5 -(int)(a = (char *) ((int)a + 5)) +(int)(a = (char *)(int) ((int)a + 5)) +@end example + +You cannot take the address of an lvalue cast, because the use of its +address would not work out coherently. Suppose that @code{&(int)f} were +permitted, where @code{f} has type @code{float}. Then the following +statement would try to store an integer bit-pattern where a floating +point number belongs: + +@example +*&(int)f = 1; @end example +This is quite different from what @code{(int)f = 1} would do---that +would convert 1 to floating point and store it. Rather than cause this +inconsistancy, we think it is better to prohibit use of @samp{&} on a cast. + +If you really do want an @code{int *} pointer with the address of +@code{f}, you can simply write @code{(int *)&f}. + @node Conditionals, Zero-Length, Lvalues, Extensions @section Conditional Expressions with Omitted Middle-Operands @@ -2738,7 +3242,7 @@ arithmetic operator would be. These fun @code{const}. For example, @example -extern const void square (); +extern const int square (); @end example @noindent @@ -2747,7 +3251,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 +3275,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 +3702,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 +3713,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 +3743,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 @@ -3274,10 +3782,16 @@ macros to replace them with the customar Your bug reports play an essential role in making GNU CC reliable. -Reporting a bug may help you by bringing a solution to your problem, or it -may not. But in any case the important function of a bug report is to help -the entire community by making the next version of GNU CC work better. Bug -reports are your contribution to the maintenance of GNU CC. +When you encounter a problem, the first thing to do is to see if it is +already known. @xref{Trouble}. Also look in @ref{Incompatibilities}. +If it isn't known, then you should report the problem. + +Reporting a bug may help you by bringing a solution to your problem, or +it may not. (If it does not, look in the service directory; see +@ref{Service}.) In any case, the principal function of a bug report +is to help the entire community by making the next version of GNU CC +work better. Bug reports are your contribution to the maintenance of +GNU CC. In order for a bug report to serve its purpose, you must include the information that makes for fixing the bug. @@ -3372,8 +3886,8 @@ bug-gcc@@prep.ai.mit.edu @{ucbvax|mit-eddie|uunet@}!prep.ai.mit.edu!bug-gcc @end example -@strong{Do not send bug reports to @samp{info-gcc}, or to the newsgroup -@samp{gnu.gcc}.} Most users of GNU CC do not want to receive bug +@strong{Do not send bug reports to @samp{help-gcc}, or to the newsgroup +@samp{gnu.gcc.help}.} Most users of GNU CC do not want to receive bug reports. Those that do, have asked to be on @samp{bug-gcc}. The mailing list @samp{bug-gcc} has a newsgroup which serves as a @@ -3389,7 +3903,8 @@ As a last resort, send bug reports on pa @example GNU Compiler Bugs -545 Tech Sq +Free Software Foundation +675 Mass Ave Cambridge, MA 02139 @end example @@ -4022,9 +4537,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 +4696,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 +4760,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 +4769,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 +5138,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 +5175,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 +5323,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 +5333,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 +5404,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 +5663,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 +5864,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 +5928,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 +6085,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 +6262,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 @@ -6047,7 +6594,7 @@ a pattern could use @code{which_alternat @example (define_insn "" - [(set (match_operand:SI 0 "general_operand" "r,m") + [(set (match_operand:SI 0 "general_operand" "=r,m") (const_int 0))] "" "* @@ -6175,12 +6722,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} @@ -6229,7 +6776,7 @@ Contrast, therefore, the two instruction @example (define_insn "" - [(set (match_operand:SI 0 "general_operand" "r") + [(set (match_operand:SI 0 "general_operand" "=r") (plus:SI (match_dup 0) (match_operand:SI 1 "general_operand" "r")))] "" @@ -6241,7 +6788,7 @@ which has two operands, one of which mus @example (define_insn "" - [(set (match_operand:SI 0 "general_operand" "r") + [(set (match_operand:SI 0 "general_operand" "=r") (plus:SI (match_operand:SI 1 "general_operand" "0") (match_operand:SI 2 "general_operand" "r")))] "" @@ -6344,17 +6891,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. @@ -6386,7 +6933,7 @@ the first, 1 for the second alternative, @example (define_insn "" - [(set (match_operand:SI 0 "general_operand" "r,m") + [(set (match_operand:SI 0 "general_operand" "=r,m") (const_int 0))] "" "* @@ -6559,9 +7106,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} @@ -6569,6 +7130,12 @@ with mode @var{m} of a register whose na the @samp{movstrict@var{m}} instruction is guaranteed not to alter any of the register except the part which belongs to mode @var{m}. +@item @samp{movsi_unaligned} +Like @samp{movsi} except that the memory reference will not trap +if loading or storing into unaligned memory. You must define this +pattern if you can pass structures or unions in registers when they +have less than a full word of alignment. + @item @samp{add@var{m}3} Add operand 2 and operand 1, storing the result in operand 0. All operands must have mode @var{m}. This can be used even on two-address machines, by @@ -6602,15 +7169,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 +7243,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 +7295,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 +7412,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 @@ -7165,7 +7729,7 @@ Here is an example, taken from the 68000 @example (define_peephole [(set (reg:SI 15) (plus:SI (reg:SI 15) (const_int 4))) - (set (match_operand:DF 0 "register_operand" "f") + (set (match_operand:DF 0 "register_operand" "=f") (match_operand:DF 1 "register_operand" "ad"))] "FP_REG_P (operands[0]) && ! FP_REG_P (operands[1])" "* @@ -7430,18 +7994,18 @@ 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. * Stack Layout:: Defining which way the stack grows and by how much. -* Library Names:: Specifying names of subroutines to call automatically. +* Library Calls:: Specifying how to call certain library routines. * Addressing Modes:: Defining addressing modes valid for memory operands. * Delayed Branch:: Do branches execute the following instruction? * Condition Code:: Defining how insns update the condition code. -* Assembler Format:: Defining how to write insns and pseudo-ops to output. * Cross-compilation:: Handling floating point for cross-compilers. * Misc:: Everything else. +* Assembler Format:: Defining how to write insns and pseudo-ops to output. @end menu @node Run-time Target, Storage Layout, Machine Macros, Machine Macros @@ -7642,6 +8206,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 +8345,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 +8389,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 +8437,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 @@ -8169,7 +8731,7 @@ so, 0 otherwise. If @var{c} is not one be 0 regardless of @var{value}. @end table -@node Stack Layout, Library Names, Register Classes, Machine Macros +@node Stack Layout, Library Calls, Register Classes, Machine Macros @section Describing Stack Layout @table @code @@ -8235,6 +8797,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 +8854,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 +9055,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 +9064,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 +9118,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 +9127,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 @@ -8624,8 +9193,8 @@ from the stack frames, rather than from across a call to @code{setjmp} on such machines. @end table -@node Library Names, Addressing Modes, Stack Layout, Machine Macros -@section Library Subroutine Names +@node Library Calls, Addressing Modes, Stack Layout, Machine Macros +@section Implicit Use of Library Routines @table @code @item MULSI3_LIBCALL @@ -8668,9 +9237,17 @@ not define this macro, the default name Define this macro if GNU CC should generate calls to the System V (and ANSI C) library functions @code{memcpy} and @code{memset} rather than the BSD functions @code{bcopy} and @code{bzero}. + +@item GNULIB_NEEDS_DOUBLE +Define this macro if only @code{float} arguments cannot be passed to +library routines (so they must be converted to @code{double}). This +macro affects both how library calls are generated and how the library +routines in @file{gnulib.c} accept their arguments. It is useful on +machines where floating and fixed point arguments are passed +differently, such as the i860. @end table -@node Addressing Modes, Delayed Branch, Library Names, Machine Macros +@node Addressing Modes, Delayed Branch, Library Calls, Machine Macros @section Addressing Modes @table @code @@ -8694,7 +9271,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 +9451,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 +9470,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 +9508,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 +9742,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 +9793,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 @@ -9266,6 +9822,14 @@ command given to the linker. If this macro is not defined, a default is provided that loads the standard C library from the usual place. See @file{gcc.c}. +@item LIBG_SPEC +Another C string constant used much like @code{LINK_SPEC}. +This controls whether to link @file{libg.a} when debugging. +Some systems expect this; others do not have any @file{libg.a}. + +If this macro is not defined, a default is provided that loads the +@file{libg.a} provided @samp{-g} is specified. See @file{gcc.c}. + @item STARTFILE_SPEC Another C string constant used much like @code{LINK_SPEC}. The difference between the two is that @code{STARTFILE_SPEC} is used at @@ -9416,7 +9980,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 +10181,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 +10391,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},