OSDN Git Service

* rtl.h (MEM_ALIAS_SET): Update documentation.
[pf3gnuchains/gcc-fork.git] / gcc / doc / extend.texi
index be49067..7a6c112 100644 (file)
@@ -1,4 +1,5 @@
-@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001,2002 Free Software Foundation, Inc.
+@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001,2002, 2003,
+@c 2003 Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 
@@ -35,6 +36,8 @@ along with the section number from the ISO/IEC 9899:1999 standard.
 @item
 @cite{How a diagnostic is identified (3.10, 5.1.1.3).}
 
+Diagnostics consist of all the output sent to stderr by GCC.
+
 @item
 @cite{Whether each nonempty sequence of white-space characters other than
 new-line is retained or replaced by one space character in translation
@@ -58,6 +61,11 @@ and their correspondence to universal character names (6.4.2).}
 @item
 @cite{The number of significant initial characters in an identifier
 (5.2.4.1, 6.4.2).}
+
+For internal names, all characters are significant.  For external names,
+the number of significant characters are defined by the linker; for
+almost all targets, all characters are significant.
+
 @end itemize
 
 @node Characters implementation
@@ -123,6 +131,9 @@ sequence not represented in the execution character set (6.4.5).}
 two's complement, or one's complement, and whether the extraordinary value
 is a trap representation or an ordinary value (6.2.6.2).}
 
+GCC supports only two's complement integer types, and all bit patterns
+are ordinary values.
+
 @item
 @cite{The rank of any extended integer type relative to another extended
 integer type with the same precision (6.3.1.1).}
@@ -238,10 +249,36 @@ of the same array (6.5.6).}
 @cite{The extent to which suggestions made by using the @code{register}
 storage-class specifier are effective (6.7.1).}
 
+The @code{register} specifier affects code generation only in these ways:
+
+@itemize @bullet
+@item
+When used as part of the register variable extension, see 
+@ref{Explicit Reg Vars}.
+
+@item
+When @option{-O0} is in use, the compiler allocates distinct stack
+memory for all variables that do not have the @code{register}
+storage-class specifier; if @code{register} is specified, the variable
+may have a shorter lifespan than the code would indicate and may never
+be placed in memory.
+
+@item
+On some rare x86 targets, @code{setjmp} doesn't save the registers in
+all circumstances.  In those cases, GCC doesn't allocate any variables
+in registers unless they are marked @code{register}.
+
+@end itemize
+
 @item
 @cite{The extent to which suggestions made by using the inline function
 specifier are effective (6.7.4).}
 
+GCC will not inline any functions if the @option{-fno-inline} option is
+used or if @option{-O0} is used.  Otherwise, GCC may still be unable to
+inline a function for many reasons; the @option{-Winline} option may be
+used to determine if a function has not been inlined and why not.
+
 @end itemize
 
 @node Structures unions enumerations and bit-fields implementation
@@ -315,6 +352,8 @@ name (6.10.2).}
 @item
 @cite{The nesting limit for @code{#include} processing (6.10.2).}
 
+GCC imposes a limit of 200 nested @code{#include}s.
+
 @item
 @cite{Whether the @samp{#} operator inserts a @samp{\} character before
 the @samp{\} character that begins a universal character name in a
@@ -328,6 +367,10 @@ directive (6.10.6).}
 @cite{The definitions for @code{__DATE__} and @code{__TIME__} when
 respectively, the date and time of translation are not available (6.10.8).}
 
+If the date and time are not available, @code{__DATE__} expands to
+@code{@w{"??? ?? ????"}} and @code{__TIME__} expands to
+@code{"??:??:??"}.
+
 @end itemize
 
 @node Library functions implementation
@@ -385,7 +428,6 @@ extensions, accepted by GCC in C89 mode and in C++.
 * Labels as Values::    Getting pointers to labels, and computed gotos.
 * Nested Functions::    As in Algol and Pascal, lexical scoping of functions.
 * Constructing Calls:: Dispatching a call to another function.
-* 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.
@@ -394,6 +436,7 @@ extensions, accepted by GCC in C89 mode and in C++.
 * Hex Floats::          Hexadecimal floating-point constants.
 * Zero Length::         Zero-length arrays.
 * Variable Length::     Arrays whose length is computed at run time.
+* Empty Structures::    Structures with no members.
 * Variadic Macros::    Macros with a variable number of arguments.
 * Escaped Newlines::    Slightly looser rules for escaped newlines.
 * Multi-line Strings::  String literals with embedded newlines.
@@ -444,7 +487,6 @@ extensions, accepted by GCC in C89 mode and in C++.
 
 @c the above section title wrapped and causes an underfull hbox.. i
 @c changed it from "within" to "in". --mew 4feb93
-
 A compound statement enclosed in parentheses may appear as an expression
 in GNU C@.  This allows you to use loops, switches, and local variables
 within an expression.
@@ -496,8 +538,7 @@ the value of an enumeration constant, the width of a bit-field, or
 the initial value of a static variable.
 
 If you don't know the type of the operand, you can still do this, but you
-must use @code{typeof} (@pxref{Typeof}) or type naming (@pxref{Naming
-Types}).
+must use @code{typeof} (@pxref{Typeof}).
 
 Statement expressions are not supported fully in G++, and their fate
 there is unclear.  (It is possible that they will become fully supported
@@ -740,7 +781,7 @@ GCC implements taking the address of a nested function using a technique
 called @dfn{trampolines}.  A paper describing them is available as
 
 @noindent
-@uref{http://people.debian.org/~karlheg/Usenix88-lexic.pdf}.
+@uref{http://people.debian.org/~aaronl/Usenix88-lexic.pdf}.
 
 A nested function can jump to a label inherited from a containing
 function, provided the label was explicitly declared in the containing
@@ -846,42 +887,6 @@ the containing function.  You should specify, for @var{result}, a value
 returned by @code{__builtin_apply}.
 @end deftypefn
 
-@node Naming Types
-@section Naming an Expression's Type
-@cindex naming types
-
-You can give a name to the type of an expression using a @code{typedef}
-declaration with an initializer.  Here is how to define @var{name} as a
-type name for the type of @var{exp}:
-
-@example
-typedef @var{name} = @var{exp};
-@end example
-
-This is useful in conjunction with the statements-within-expressions
-feature.  Here is how the two together can be used to define a safe
-``maximum'' macro that operates on any arithmetic type:
-
-@example
-#define max(a,b) \
-  (@{typedef _ta = (a), _tb = (b);  \
-    _ta _a = (a); _tb _b = (b);     \
-    _a > _b ? _a : _b; @})
-@end example
-
-@cindex underscores in variables in macros
-@cindex @samp{_} in variables in macros
-@cindex local variables in macros
-@cindex variables, local, in macros
-@cindex macros, local variables in
-
-The reason for using names that start with underscores for the local
-variables is to avoid conflicts with variable names that occur within the
-expressions that are substituted for @code{a} and @code{b}.  Eventually we
-hope to design a new form of declaration syntax that allows you to declare
-variables whose scopes start only after their initializers; this will be a
-more reliable way to prevent such conflicts.
-
 @node Typeof
 @section Referring to a Type with @code{typeof}
 @findex typeof
@@ -920,6 +925,34 @@ A @code{typeof}-construct can be used anywhere a typedef name could be
 used.  For example, you can use it in a declaration, in a cast, or inside
 of @code{sizeof} or @code{typeof}.
 
+@code{typeof} is often useful in conjunction with the
+statements-within-expressions feature.  Here is how the two together can
+be used to define a safe ``maximum'' macro that operates on any
+arithmetic type and evaluates each of its arguments exactly once:
+
+@example
+#define max(a,b) \
+  (@{ typeof (a) _a = (a); \
+      typeof (b) _b = (b); \
+    _a > _b ? _a : _b; @})
+@end example
+
+@cindex underscores in variables in macros
+@cindex @samp{_} in variables in macros
+@cindex local variables in macros
+@cindex variables, local, in macros
+@cindex macros, local variables in
+
+The reason for using names that start with underscores for the local
+variables is to avoid conflicts with variable names that occur within the
+expressions that are substituted for @code{a} and @code{b}.  Eventually we
+hope to design a new form of declaration syntax that allows you to declare
+variables whose scopes start only after their initializers; this will be a
+more reliable way to prevent such conflicts.
+
+@noindent
+Some more examples of the use of @code{typeof}:
+
 @itemize @bullet
 @item
 This declares @code{y} with the type of what @code{x} points to.
@@ -969,6 +1002,26 @@ Thus, @code{array (pointer (char), 4)} is the type of arrays of 4
 pointers to @code{char}.
 @end itemize
 
+@emph{Compatibility Note:} In addition to @code{typeof}, GCC 2 supported
+a more limited extension which permitted one to write
+
+@example
+typedef @var{T} = @var{expr};
+@end example
+
+@noindent
+with the effect of declaring @var{T} to have the type of the expression
+@var{expr}.  This extension does not work with GCC 3 (versions between
+3.0 and 3.2 will crash; 3.2.1 and later give an error).  Code which
+relies on it should be rewritten to use @code{typeof}:
+
+@example
+typedef typeof(@var{expr}) @var{T};
+@end example
+
+@noindent
+This will work with all versions of GCC@.
+
 @node Lvalues
 @section Generalized Lvalues
 @cindex compound expressions as lvalues
@@ -980,6 +1033,7 @@ pointers to @code{char}.
 @cindex lvalues, generalized
 @cindex extensions, @code{?:}
 @cindex @code{?:} extensions
+
 Compound expressions, conditional expressions and casts are allowed as
 lvalues provided their operands are lvalues.  This means that you can take
 their addresses or store values into them.
@@ -1172,17 +1226,14 @@ provided as built-in functions by GCC@.
 
 GCC can allocate complex automatic variables in a noncontiguous
 fashion; it's even possible for the real part to be in a register while
-the imaginary part is on the stack (or vice-versa).  None of the
-supported debugging info formats has a way to represent noncontiguous
-allocation like this, so GCC describes a noncontiguous complex
-variable as if it were two separate variables of noncomplex type.
+the imaginary part is on the stack (or vice-versa).  Only the DWARF2
+debug info format can represent this, so use of DWARF2 is recommended.
+If you are using the stabs debug info format, GCC describes a noncontiguous
+complex variable as if it were two separate variables of noncomplex type.
 If the variable's actual name is @code{foo}, the two fictitious
 variables are named @code{foo$real} and @code{foo$imag}.  You can
 examine and set these two fictitious variables with your debugger.
 
-A future version of GDB will know how to recognize such pairs and treat
-them as a single variable with a complex type.
-
 @node Hex Floats
 @section Hex Floats
 @cindex hex floats
@@ -1232,7 +1283,7 @@ struct line *thisline = (struct line *)
 thisline->length = this_length;
 @end example
 
-In ISO C89, you would have to give @code{contents} a length of 1, which
+In ISO C90, you would have to give @code{contents} a length of 1, which
 means either you waste space or complicate the argument to @code{malloc}.
 
 In ISO C99, you would use a @dfn{flexible array member}, which is
@@ -1251,6 +1302,12 @@ of zero-length arrays, @code{sizeof} evaluates to zero.
 @item
 Flexible array members may only appear as the last member of a
 @code{struct} that is otherwise non-empty.
+
+@item
+A structure containing a flexible array member, or a union containing
+such a structure (possibly recursively), may not be a member of a
+structure or an element of an array.  (However, these uses are
+permitted by GCC as extensions.)
 @end itemize
 
 GCC versions before 3.0 allowed zero-length arrays to be statically
@@ -1302,6 +1359,22 @@ struct bar c = @{ @{ 1, @{ @} @} @};            // @r{Valid.}
 struct foo d[1] = @{ @{ 1 @{ 2, 3, 4 @} @} @};  // @r{Invalid.}
 @end example
 
+@node Empty Structures
+@section Structures With No Members
+@cindex empty structures
+@cindex zero-size structures
+
+GCC permits a C structure to have no members:
+
+@example
+struct empty @{
+@};
+@end example
+
+The structure will have size zero.  In C++, empty structures are part
+of the language.  G++ treats empty structures as if they had a single
+member of type @code{char}.
+
 @node Variable Length
 @section Arrays of Variable Length
 @cindex variable-length arrays
@@ -1397,9 +1470,9 @@ variable number of arguments much as a function can.  The syntax for
 defining the macro is similar to that of a function.  Here is an
 example:
 
-@example
+@smallexample
 #define debug(format, ...) fprintf (stderr, format, __VA_ARGS__)
-@end example
+@end smallexample
 
 Here @samp{@dots{}} is a @dfn{variable argument}.  In the invocation of
 such a macro, it represents the zero or more tokens until the closing
@@ -1438,9 +1511,9 @@ string.
 To help solve this problem, CPP behaves specially for variable arguments
 used with the token paste operator, @samp{##}.  If instead you write
 
-@example
+@smallexample
 #define debug(format, ...) fprintf (stderr, format, ## __VA_ARGS__)
-@end example
+@end smallexample
 
 and if the variable arguments are omitted or empty, the @samp{##}
 operator causes the preprocessor to remove the comma before it.  If you
@@ -1750,9 +1823,9 @@ nested subobject to initialize; the list is taken relative to the
 subobject corresponding to the closest surrounding brace pair.  For
 example, with the @samp{struct point} declaration above:
 
-@example
+@smallexample
 struct point ptarray[10] = @{ [2].y = yv2, [2].x = xv2, [0].x = xv0 @};
-@end example
+@end smallexample
 
 @noindent
 If the same field is initialized multiple times, it will have value from
@@ -2046,6 +2119,9 @@ functions where the arguments are not available to be checked (such as
 @code{vprintf}), specify the third parameter as zero.  In this case the
 compiler only checks the format string for consistency.  For
 @code{strftime} formats, the third parameter is required to be zero.
+Since non-static C++ methods have an implicit @code{this} argument, the
+arguments of such methods should be counted from two, not one, when
+giving values for @var{string-index} and @var{first-to-check}.
 
 In the example above, the format string (@code{my_format}) is the second
 argument of the function @code{my_print}, and the arguments to check
@@ -2098,7 +2174,9 @@ string argument is not constant; this would generate a warning when
 without the attribute.
 
 The parameter @var{string-index} specifies which argument is the format
-string argument (starting from 1).
+string argument (starting from one).  Since non-static C++ methods have
+an implicit @code{this} argument, the arguments of such methods should
+be counted from two.
 
 The @code{format-arg} attribute allows you to identify your own
 functions which modify format strings, so that GCC can check the
@@ -2249,7 +2327,7 @@ Not all target machines support this attribute.
 @item visibility ("@var{visibility_type}")
 @cindex @code{visibility} attribute
 The @code{visibility} attribute on ELF targets causes the declaration
-to be emitted with hidden, protected or internal visibility.
+to be emitted with default, hidden, protected or internal visibility.
 
 @smallexample
 void __attribute__ ((visibility ("protected")))
@@ -2260,6 +2338,11 @@ int i __attribute__ ((visibility ("hidden")));
 See the ELF gABI for complete details, but the short story is
 
 @table @dfn
+@item default
+Default visibility is the normal case for ELF.  This value is 
+available for the visibility attribute to override other options
+that may change the assumed visibility of symbols.
+
 @item hidden
 Hidden visibility indicates that the symbol will not be placed into
 the dynamic symbol table, so no other @dfn{module} (executable or
@@ -2284,6 +2367,15 @@ since it is known that the calling function loaded the correct value.
 
 Not all ELF targets support this attribute.
 
+@item tls_model ("@var{tls_model}")
+@cindex @code{tls_model} attribute
+The @code{tls_model} attribute sets thread-local storage model
+(@pxref{Thread-Local}) of a particular @code{__thread} variable,
+overriding @code{-ftls-model=} command line switch on a per-variable
+basis.
+The @var{tls_model} argument should be one of @code{global-dynamic},
+@code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
+
 @item regparm (@var{number})
 @cindex functions that are passed arguments in registers on the 386
 On the Intel 386, the @code{regparm} attribute causes the compiler to
@@ -2298,8 +2390,13 @@ On the Intel 386, the @code{stdcall} attribute causes the compiler to
 assume that the called function will pop off the stack space used to
 pass arguments, unless it takes a variable number of arguments.
 
-The PowerPC compiler for Windows NT currently ignores the @code{stdcall}
-attribute.
+@item fastcall
+@cindex functions that pop the argument stack on the 386
+On the Intel 386, the @code{fastcall} attribute causes the compiler to
+pass the first two arguments in the registers ECX and EDX. Subsequent
+arguments are passed on the stack. The called function will pop the 
+arguments off the stack. If the number of arguments is variable all
+arguments are pushed on the stack.
 
 @item cdecl
 @cindex functions that do pop the argument stack on the 386
@@ -2309,9 +2406,6 @@ assume that the calling function will pop off the stack space used to
 pass arguments.  This is
 useful to override the effects of the @option{-mrtd} switch.
 
-The PowerPC compiler for Windows NT currently ignores the @code{cdecl}
-attribute.
-
 @item longcall/shortcall
 @cindex functions called via pointer on the RS/6000 and PowerPC
 On the RS/6000 and PowerPC, the @code{longcall} attribute causes the
@@ -2335,31 +2429,6 @@ contents of that register.   The @code{short_call} attribute always places
 the offset to the function from the call site into the @samp{BL}
 instruction directly.
 
-@item dllimport
-@cindex functions which are imported from a dll on PowerPC Windows NT
-On the PowerPC running Windows NT, the @code{dllimport} attribute causes
-the compiler to call the function via a global pointer to the function
-pointer that is set up by the Windows NT dll library.  The pointer name
-is formed by combining @code{__imp_} and the function name.
-
-@item dllexport
-@cindex functions which are exported from a dll on PowerPC Windows NT
-On the PowerPC running Windows NT, the @code{dllexport} attribute causes
-the compiler to provide a global pointer to the function pointer, so
-that it can be called with the @code{dllimport} attribute.  The pointer
-name is formed by combining @code{__imp_} and the function name.
-
-@item exception (@var{except-func} [, @var{except-arg}])
-@cindex functions which specify exception handling on PowerPC Windows NT
-On the PowerPC running Windows NT, the @code{exception} attribute causes
-the compiler to modify the structured exception table entry it emits for
-the declared function.  The string or identifier @var{except-func} is
-placed in the third entry of the structured exception table.  It
-represents a function, which is called by the exception handling
-mechanism if an exception occurs.  If it was specified, the string or
-identifier @var{except-arg} is placed in the fourth entry of the
-structured exception table.
-
 @item function_vector
 @cindex calling functions through the function vector on the H8/300 processors
 Use this attribute on the H8/300 and H8/300H to indicate that the specified
@@ -2373,7 +2442,7 @@ this attribute to work correctly.
 
 @item interrupt
 @cindex interrupt handler functions
-Use this attribute on the ARM, AVR, M32R/D and Xstormy16 ports to indicate
+Use this attribute on the ARM, AVR, C4x, M32R/D and Xstormy16 ports to indicate
 that the specified function is an interrupt handler.  The compiler will
 generate function entry and exit sequences suitable for use in an
 interrupt handler when this attribute is present.
@@ -2444,9 +2513,9 @@ attribute is present.  Interrupts will be disabled inside function.
 
 @item naked
 @cindex function without a prologue/epilogue code
-Use this attribute on the ARM or AVR ports to indicate that the specified
-function do not need prologue/epilogue sequences generated by the
-compiler.  It is up to the programmer to provide these sequences.
+Use this attribute on the ARM, AVR, C4x and IP2K ports to indicate that the
+specified function do not need prologue/epilogue sequences generated by
+the compiler.  It is up to the programmer to provide these sequences.
 
 @item model (@var{model-name})
 @cindex function addressability on the M32R/D
@@ -3135,6 +3204,26 @@ Medium and large model objects may live anywhere in the 32-bit address space
 (the compiler will generate @code{seth/add3} instructions to load their
 addresses).
 
+@subsection i386 Variable Attributes
+
+Two attributes are currently defined for i386 configurations:
+@code{ms_struct} and @code{gcc_struct}
+
+@item ms_struct
+@itemx gcc_struct
+@cindex @code{ms_struct}
+@cindex @code{gcc_struct}
+
+If @code{packed} is used on a structure, or if bit-fields are used
+it may be that the Microsoft ABI packs them differently
+than GCC would normally pack them.  Particularly when moving packed
+data between functions compiled with GCC and the native Microsoft compiler
+(either via function call or as data in a file), it may be necessary to access
+either format.
+
+Currently @option{-m[no-]ms-bitfields} is provided for the Windows X86
+compilers to match the native Microsoft compiler.
+
 @end table
 
 To specify multiple attributes, separate them by commas within the
@@ -3187,7 +3276,7 @@ typedef int more_aligned_int __attribute__ ((aligned (8)));
 @noindent
 force the compiler to insure (as far as it can) that each variable whose
 type is @code{struct S} or @code{more_aligned_int} will be allocated and
-aligned @emph{at least} on a 8-byte boundary.  On a Sparc, having all
+aligned @emph{at least} on a 8-byte boundary.  On a SPARC, having all
 variables of type @code{struct S} aligned to 8-byte boundaries allows
 the compiler to use the @code{ldd} and @code{std} (doubleword load and
 store) instructions when copying one variable of type @code{struct S} to
@@ -3372,7 +3461,7 @@ any other type of objects, just like the @code{char} type.  See
 
 Example of use:
 
-@example
+@smallexample
 typedef short __attribute__((__may_alias__)) short_a;
 
 int
@@ -3388,12 +3477,32 @@ main (void)
 
   exit(0);
 @}
-@end example
+@end smallexample
 
 If you replaced @code{short_a} with @code{short} in the variable
 declaration, the above program would abort when compiled with
 @option{-fstrict-aliasing}, which is on by default at @option{-O2} or
 above in recent GCC versions.
+
+@subsection i386 Type Attributes
+
+Two attributes are currently defined for i386 configurations:
+@code{ms_struct} and @code{gcc_struct}
+
+@item ms_struct
+@itemx gcc_struct
+@cindex @code{ms_struct}
+@cindex @code{gcc_struct}
+
+If @code{packed} is used on a structure, or if bit-fields are used
+it may be that the Microsoft ABI packs them differently
+than GCC would normally pack them.  Particularly when moving packed
+data between functions compiled with GCC and the native Microsoft compiler
+(either via function call or as data in a file), it may be necessary to access
+either format.
+
+Currently @option{-m[no-]ms-bitfields} is provided for the Windows X86
+compilers to match the native Microsoft compiler.
 @end table
 
 To specify multiple attributes, separate them by commas within the
@@ -3652,7 +3761,10 @@ asm volatile ("movc3 %0,%1,%2"
 You may not write a clobber description in a way that overlaps with an
 input or output operand.  For example, you may not have an operand
 describing a register class with one member if you mention that register
-in the clobber list.  There is no way for you to specify that an input
+in the clobber list.  Variables declared to live in specific registers
+(@pxref{Explicit Reg Vars}), and used as asm input or output operands must
+have no part mentioned in the clobber description.
+There is no way for you to specify that an input
 operand is modified without also specifying it as an output
 operand.  Note that if all the output operands you specify are for this
 purpose (and hence unused), you will then also need to specify
@@ -4092,7 +4204,7 @@ being used for other purposes in the preceding functions.
 Global register variables may not have initial values, because an
 executable file has no means to supply initial contents for a register.
 
-On the Sparc, there are reports that g3 @dots{} g7 are suitable
+On the SPARC, there are reports that g3 @dots{} g7 are suitable
 registers, but certain library functions, such as @code{getwd}, as well
 as the subroutines for division and remainder, modify g3 and g4.  g1 and
 g2 are local temporaries.
@@ -4221,7 +4333,7 @@ extern int printf (char *, ...);
 
 class a @{
  public:
-  sub (int i)
+  void sub (int i)
     @{
       printf ("__FUNCTION__ = %s\n", __FUNCTION__);
       printf ("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__);
@@ -4373,9 +4485,6 @@ A floating point value, as wide as a SI mode integer, usually 32 bits.
 A floating point value, as wide as a DI mode integer, usually 64 bits.
 @end table
 
-There are no @code{V1xx} vector modes - they would be identical to the
-corresponding base mode.
-
 Specifying a combination that is not valid for the current architecture
 will cause gcc to synthesize the instructions using a narrower mode.
 For example, if you specify a variable of type @code{V4SI} and your
@@ -4413,7 +4522,7 @@ provided they are of the same size (in fact, you can also cast vectors
 to and from other datatypes of the same size).
 
 You cannot operate between vectors of different lengths or different
-signness without a cast.
+signedness without a cast.
 
 A port that supports hardware vector operations, usually provides a set
 of built-in functions that can be used to operate on vectors.  For
@@ -4441,8 +4550,15 @@ v4si f (v4si a, v4si b, v4si c)
 @findex abort
 @findex abs
 @findex alloca
+@findex atan2
+@findex atan2f
+@findex atan2l
 @findex bcmp
 @findex bzero
+@findex calloc
+@findex ceil
+@findex ceilf
+@findex ceill
 @findex cimag
 @findex cimagf
 @findex cimagl
@@ -4458,10 +4574,19 @@ v4si f (v4si a, v4si b, v4si c)
 @findex exit
 @findex _exit
 @findex _Exit
+@findex exp
+@findex expf
+@findex expl
 @findex fabs
 @findex fabsf
 @findex fabsl
 @findex ffs
+@findex floor
+@findex floorf
+@findex floorl
+@findex fmod
+@findex fmodf
+@findex fmodl
 @findex fprintf
 @findex fprintf_unlocked
 @findex fputs
@@ -4470,23 +4595,45 @@ v4si f (v4si a, v4si b, v4si c)
 @findex index
 @findex labs
 @findex llabs
+@findex log
+@findex logf
+@findex logl
+@findex malloc
 @findex memcmp
 @findex memcpy
+@findex mempcpy
 @findex memset
+@findex nearbyint
+@findex nearbyintf
+@findex nearbyintl
+@findex pow
+@findex powf
+@findex powl
 @findex printf
 @findex printf_unlocked
+@findex putchar
+@findex puts
 @findex rindex
+@findex round
+@findex roundf
+@findex roundl
+@findex scanf
 @findex sin
 @findex sinf
 @findex sinl
+@findex snprintf
+@findex sprintf
 @findex sqrt
 @findex sqrtf
 @findex sqrtl
+@findex sscanf
+@findex stpcpy
 @findex strcat
 @findex strchr
 @findex strcmp
 @findex strcpy
 @findex strcspn
+@findex strdup
 @findex strlen
 @findex strncat
 @findex strncmp
@@ -4495,6 +4642,14 @@ v4si f (v4si a, v4si b, v4si c)
 @findex strrchr
 @findex strspn
 @findex strstr
+@findex trunc
+@findex truncf
+@findex truncl
+@findex vprintf
+@findex vscanf
+@findex vsnprintf
+@findex vsprintf
+@findex vsscanf
 
 GCC provides a large number of built-in functions other than the ones
 mentioned above.  Some of these are for internal use in the processing
@@ -4515,39 +4670,51 @@ be emitted.
 
 @opindex ansi
 @opindex std
-The functions @code{abort}, @code{exit}, @code{_Exit} and @code{_exit}
-are recognized and presumed not to return, but otherwise are not built
-in.  @code{_exit} is not recognized in strict ISO C mode (@option{-ansi},
-@option{-std=c89} or @option{-std=c99}).  @code{_Exit} is not recognized in
-strict C89 mode (@option{-ansi} or @option{-std=c89}).
-
-Outside strict ISO C mode, the functions @code{alloca}, @code{bcmp},
-@code{bzero}, @code{index}, @code{rindex}, @code{ffs}, @code{fputs_unlocked},
-@code{printf_unlocked} and @code{fprintf_unlocked} may be handled as
-built-in functions.  All these functions have corresponding versions
+Outside strict ISO C mode (@option{-ansi}, @option{-std=c89} or
+@option{-std=c99}), the functions @code{alloca}, @code{bcmp},
+@code{bzero}, @code{_exit}, @code{ffs}, @code{fprintf_unlocked},
+@code{fputs_unlocked}, @code{index}, @code{mempcpy}, @code{printf_unlocked},
+@code{rindex}, @code{stpcpy} and @code{strdup} 
+may be handled as built-in functions.
+All these functions have corresponding versions
 prefixed with @code{__builtin_}, which may be used even in strict C89
 mode.
 
-The ISO C99 functions @code{conj}, @code{conjf}, @code{conjl},
-@code{creal}, @code{crealf}, @code{creall}, @code{cimag}, @code{cimagf},
-@code{cimagl}, @code{llabs} and @code{imaxabs} are handled as built-in
-functions except in strict ISO C89 mode.  There are also built-in
-versions of the ISO C99 functions @code{cosf}, @code{cosl},
-@code{fabsf}, @code{fabsl}, @code{sinf}, @code{sinl}, @code{sqrtf}, and
-@code{sqrtl}, that are recognized in any mode since ISO C89 reserves
-these names for the purpose to which ISO C99 puts them.  All these
-functions have corresponding versions prefixed with @code{__builtin_}.
-
-The ISO C89 functions @code{abs}, @code{cos}, @code{fabs},
-@code{fprintf}, @code{fputs}, @code{labs}, @code{memcmp}, @code{memcpy},
-@code{memset}, @code{printf}, @code{sin}, @code{sqrt}, @code{strcat},
-@code{strchr}, @code{strcmp}, @code{strcpy}, @code{strcspn},
-@code{strlen}, @code{strncat}, @code{strncmp}, @code{strncpy},
-@code{strpbrk}, @code{strrchr}, @code{strspn}, and @code{strstr} are all
-recognized as built-in functions unless @option{-fno-builtin} is
-specified (or @option{-fno-builtin-@var{function}} is specified for an
-individual function).  All of these functions have corresponding
-versions prefixed with @code{__builtin_}.
+The ISO C99 functions @code{conj}, @code{conjf}, @code{conjl}, @code{creal},
+@code{crealf}, @code{creall}, @code{cimag}, @code{cimagf}, @code{cimagl},
+@code{_Exit}, @code{imaxabs}, @code{llabs},
+@code{nearbyint}, @code{nearbyintf}, @code{nearbyintl},
+@code{round}, @code{roundf}, @code{roundl}, @code{snprintf},
+@code{trunc}, @code{truncf}, @code{truncl},
+@code{vscanf}, @code{vsnprintf} and @code{vsscanf}
+are handled as built-in functions
+except in strict ISO C90 mode (@option{-ansi} or @option{-std=c89}).
+
+There are also built-in versions of the ISO C99 functions @code{atan2f},
+@code{atan2l}, @code{ceilf}, @code{ceill}, @code{cosf}, @code{cosl},
+@code{expf}, @code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf},
+@code{floorl}, @code{fmodf}, @code{fmodl},
+@code{logf}, @code{logl}, @code{powf}, @code{powl},
+@code{sinf}, @code{sinl}, @code{sqrtf} and @code{sqrtl}
+that are recognized in any mode since ISO C90 reserves these names for
+the purpose to which ISO C99 puts them.  All these functions have
+corresponding versions prefixed with @code{__builtin_}.
+
+The ISO C90 functions @code{abort}, @code{abs}, @code{atan2},
+@code{calloc}, @code{ceil}, @code{cos}, @code{exit},
+@code{exp}, @code{fabs}, @code{floor}, @code{fmod},
+@code{fprintf}, @code{fputs}, @code{labs}, @code{log}, @code{malloc},
+@code{memcmp}, @code{memcpy}, @code{memset}, @code{pow}, @code{printf},
+@code{putchar}, @code{puts}, @code{scanf}, @code{sin}, @code{snprintf},
+@code{sprintf}, @code{sqrt}, @code{sscanf},
+@code{strcat}, @code{strchr}, @code{strcmp},
+@code{strcpy}, @code{strcspn}, @code{strlen}, @code{strncat}, @code{strncmp},
+@code{strncpy}, @code{strpbrk}, @code{strrchr}, @code{strspn}, @code{strstr},
+@code{vprintf} and @code{vsprintf}
+are all recognized as built-in functions unless
+@option{-fno-builtin} is specified (or @option{-fno-builtin-@var{function}}
+is specified for an individual function).  All of these functions have
+corresponding versions prefixed with @code{__builtin_}.
 
 GCC provides built-in versions of the ISO C99 floating point comparison
 macros that avoid raising exceptions for unordered operands.  They have
@@ -4630,13 +4797,15 @@ as @var{exp2}.
 Example:
 
 @smallexample
-#define foo(x)                                                               \
-  __builtin_choose_expr (__builtin_types_compatible_p (typeof (x), double),  \
-    foo_double (x),                                                          \
-    __builtin_choose_expr (__builtin_types_compatible_p (typeof (x), float), \
-      foo_float (x),                                                         \
-      /* @r{The void expression results in a compile-time error}             \
-         @r{when assigning the result to something.}  */                     \
+#define foo(x)                                                    \
+  __builtin_choose_expr (                                         \
+    __builtin_types_compatible_p (typeof (x), double),            \
+    foo_double (x),                                               \
+    __builtin_choose_expr (                                       \
+      __builtin_types_compatible_p (typeof (x), float),           \
+      foo_float (x),                                              \
+      /* @r{The void expression results in a compile-time error}  \
+         @r{when assigning the result to something.}  */          \
       (void)0))
 @end smallexample
 
@@ -4773,6 +4942,149 @@ is evaluated if it includes side effects but no other code is generated
 and GCC does not issue a warning.
 @end deftypefn
 
+@deftypefn {Built-in Function} double __builtin_huge_val (void)
+Returns a positive infinity, if supported by the floating-point format,
+else @code{DBL_MAX}.  This function is suitable for implementing the
+ISO C macro @code{HUGE_VAL}.
+@end deftypefn
+
+@deftypefn {Built-in Function} float __builtin_huge_valf (void)
+Similar to @code{__builtin_huge_val}, except the return type is @code{float}.
+@end deftypefn
+
+@deftypefn {Built-in Function} long double __builtin_huge_vall (void)
+Similar to @code{__builtin_huge_val}, except the return
+type is @code{long double}.
+@end deftypefn
+
+@deftypefn {Built-in Function} double __builtin_inf (void)
+Similar to @code{__builtin_huge_val}, except a warning is generated
+if the target floating-point format does not support infinities.
+This function is suitable for implementing the ISO C99 macro @code{INFINITY}.
+@end deftypefn
+
+@deftypefn {Built-in Function} float __builtin_inff (void)
+Similar to @code{__builtin_inf}, except the return type is @code{float}.
+@end deftypefn
+
+@deftypefn {Built-in Function} long double __builtin_infl (void)
+Similar to @code{__builtin_inf}, except the return
+type is @code{long double}.
+@end deftypefn
+
+@deftypefn {Built-in Function} double __builtin_nan (const char *str)
+This is an implementation of the ISO C99 function @code{nan}.
+
+Since ISO C99 defines this function in terms of @code{strtod}, which we
+do not implement, a description of the parsing is in order.  The string
+is parsed as by @code{strtol}; that is, the base is recognized by
+leading @samp{0} or @samp{0x} prefixes.  The number parsed is placed
+in the significand such that the least significant bit of the number
+is at the least significant bit of the significand.  The number is 
+truncated to fit the significand field provided.  The significand is
+forced to be a quiet NaN.
+
+This function, if given a string literal, is evaluated early enough
+that it is considered a compile-time constant.
+@end deftypefn
+
+@deftypefn {Built-in Function} float __builtin_nanf (const char *str)
+Similar to @code{__builtin_nan}, except the return type is @code{float}.
+@end deftypefn
+
+@deftypefn {Built-in Function} long double __builtin_nanl (const char *str)
+Similar to @code{__builtin_nan}, except the return type is @code{long double}.
+@end deftypefn
+
+@deftypefn {Built-in Function} double __builtin_nans (const char *str)
+Similar to @code{__builtin_nan}, except the significand is forced 
+to be a signaling NaN.  The @code{nans} function is proposed by
+@uref{http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n965.htm,,WG14 N965}.
+@end deftypefn
+
+@deftypefn {Built-in Function} float __builtin_nansf (const char *str)
+Similar to @code{__builtin_nans}, except the return type is @code{float}.
+@end deftypefn
+
+@deftypefn {Built-in Function} long double __builtin_nansl (const char *str)
+Similar to @code{__builtin_nans}, except the return type is @code{long double}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_ffs (unsigned int x)
+Returns one plus the index of the least significant 1-bit of @var{x}, or
+if @var{x} is zero, returns zero.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_clz (unsigned int x)
+Returns the number of leading 0-bits in @var{x}, starting at the most
+significant bit position.  If @var{x} is 0, the result is undefined.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_ctz (unsigned int x)
+Returns the number of trailing 0-bits in @var{x}, starting at the least
+significant bit position.  If @var{x} is 0, the result is undefined.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_popcount (unsigned int x)
+Returns the number of 1-bits in @var{x}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_parity (unsigned int x)
+Returns the parity of @var{x}, i.@:e. the number of 1-bits in @var{x}
+modulo 2.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_ffsl (unsigned long)
+Similar to @code{__builtin_ffs}, except the argument type is
+@code{unsigned long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_clzl (unsigned long)
+Similar to @code{__builtin_clz}, except the argument type is
+@code{unsigned long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_ctzl (unsigned long)
+Similar to @code{__builtin_ctz}, except the argument type is
+@code{unsigned long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_popcountl (unsigned long)
+Similar to @code{__builtin_popcount}, except the argument type is
+@code{unsigned long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_parityl (unsigned long)
+Similar to @code{__builtin_parity}, except the argument type is
+@code{unsigned long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_ffsll (unsigned long long)
+Similar to @code{__builtin_ffs}, except the argument type is
+@code{unsigned long long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_clzll (unsigned long long)
+Similar to @code{__builtin_clz}, except the argument type is
+@code{unsigned long long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_ctzll (unsigned long long)
+Similar to @code{__builtin_ctz}, except the argument type is
+@code{unsigned long long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_popcountll (unsigned long long)
+Similar to @code{__builtin_popcount}, except the argument type is
+@code{unsigned long long}.
+@end deftypefn
+
+@deftypefn {Built-in Function} int __builtin_parityll (unsigned long long)
+Similar to @code{__builtin_parity}, except the argument type is
+@code{unsigned long long}.
+@end deftypefn
+
+
 @node Target Builtins
 @section Built-in Functions Specific to Particular Target Machines
 
@@ -4991,14 +5303,10 @@ v4si __builtin_ia32_cmpordps (v4sf, v4sf)
 v4si __builtin_ia32_cmpeqss (v4sf, v4sf)
 v4si __builtin_ia32_cmpltss (v4sf, v4sf)
 v4si __builtin_ia32_cmpless (v4sf, v4sf)
-v4si __builtin_ia32_cmpgtss (v4sf, v4sf)
-v4si __builtin_ia32_cmpgess (v4sf, v4sf)
 v4si __builtin_ia32_cmpunordss (v4sf, v4sf)
 v4si __builtin_ia32_cmpneqss (v4sf, v4sf)
 v4si __builtin_ia32_cmpnlts (v4sf, v4sf)
 v4si __builtin_ia32_cmpnless (v4sf, v4sf)
-v4si __builtin_ia32_cmpngtss (v4sf, v4sf)
-v4si __builtin_ia32_cmpngess (v4sf, v4sf)
 v4si __builtin_ia32_cmpordss (v4sf, v4sf)
 v4sf __builtin_ia32_maxps (v4sf, v4sf)
 v4sf __builtin_ia32_maxss (v4sf, v4sf)
@@ -5118,11 +5426,11 @@ constant is of the same type as the variable it is initializing.  The
 @code{vector bool} type is deprecated and will be discontinued in
 further revisions.  Use @code{vector signed} instead.  If @code{signed}
 or @code{unsigned} is omitted, the vector type will default to
-@{signed}.  Lastly, all overloaded functions are implemented with macros
+@code{signed}.  Lastly, all overloaded functions are implemented with macros
 for the C implementation.  So code the following example will not work:
 
 @smallexample
-  vec_add ((vector signed int){1, 2, 3, 4}, foo);
+  vec_add ((vector signed int)@{1, 2, 3, 4@}, foo);
 @end smallexample
 
 Since vec_add is a macro, the vector constant in the above example will
@@ -6258,7 +6566,7 @@ declarations.
 
 The following pragmas are available for all architectures running the
 Darwin operating system.  These are useful for compatibility with other
-MacOS compilers.
+Mac OS compilers.
 
 @table @code
 @item mark @var{tokens}@dots{}
@@ -6320,7 +6628,8 @@ empty string.
 This pragma is similar in intent to to the asm labels extension
 (@pxref{Asm Labels}) in that the system programmer wants to change
 the assembly-level ABI without changing the source-level API.  The
-preprocessor defines @code{__EXTERN_PREFIX} if the pragma is available.
+preprocessor defines @code{__PRAGMA_EXTERN_PREFIX} if the pragma is
+available.
 @end table
 
 @node Unnamed Fields
@@ -6493,6 +6802,7 @@ The following are a set of changes to ISO/IEC 14882:1998 (aka C++98)
 that document the exact semantics of the language extension.
 
 @itemize @bullet
+@item
 @b{[intro.execution]}
 
 New text after paragraph 4
@@ -6537,7 +6847,7 @@ Add after paragraph 4
 
 @quotation
 The storage for an object of thread storage duration shall be
-staticly initialized before the first statement of the thread startup
+statically initialized before the first statement of the thread startup
 function.  An object of thread storage duration shall not require
 dynamic initialization.
 @end quotation
@@ -6687,12 +6997,12 @@ the minimum value of variables @var{i} and @var{j}.
 
 However, side effects in @code{X} or @code{Y} may cause unintended
 behavior.  For example, @code{MIN (i++, j++)} will fail, incrementing
-the smaller counter twice.  A GNU C extension allows you to write safe
-macros that avoid this kind of problem (@pxref{Naming Types,,Naming an
-Expression's Type}).  However, writing @code{MIN} and @code{MAX} as
-macros also forces you to use function-call notation for a
-fundamental arithmetic operation.  Using GNU C++ extensions, you can
-write @w{@samp{int min = i <? j;}} instead.
+the smaller counter twice.  The GNU C @code{typeof} extension allows you
+to write safe macros that avoid this kind of problem (@pxref{Typeof}).
+However, writing @code{MIN} and @code{MAX} as macros also forces you to
+use function-call notation for a fundamental arithmetic operation.
+Using GNU C++ extensions, you can write @w{@samp{int min = i <? j;}}
+instead.
 
 Since @code{<?} and @code{>?} are built into the compiler, they properly
 handle expressions with side-effects;  @w{@samp{int min = i++ <? j++;}}
@@ -7022,7 +7332,6 @@ If any calls were not inlined, you will get linker errors.
 
 @node Template Instantiation
 @section Where's the Template?
-
 @cindex template instantiation
 
 C++ templates are the first language feature to require more
@@ -7141,8 +7450,8 @@ compile it without @option{-fno-implicit-templates} so you get all of the
 instances required by your explicit instantiations (but not by any
 other files) without having to specify them as well.
 
-g++ has extended the template instantiation syntax outlined in the
-Working Paper to allow forward declaration of explicit instantiations
+g++ has extended the template instantiation syntax given in the ISO
+standard to allow forward declaration of explicit instantiations
 (with @code{extern}), instantiation of the compiler support data for a
 template class (i.e.@: the vtable) without instantiating any of its
 members (with @code{inline}), and instantiation of only the static data
@@ -7162,48 +7471,12 @@ each translation unit will contain instances of each of the templates it
 uses.  In a large program, this can lead to an unacceptable amount of code
 duplication.
 
-@item
-@opindex fexternal-templates
-Add @samp{#pragma interface} to all files containing template
-definitions.  For each of these files, add @samp{#pragma implementation
-"@var{filename}"} to the top of some @samp{.C} file which
-@samp{#include}s it.  Then compile everything with
-@option{-fexternal-templates}.  The templates will then only be expanded
-in the translation unit which implements them (i.e.@: has a @samp{#pragma
-implementation} line for the file where they live); all other files will
-use external references.  If you're lucky, everything should work
-properly.  If you get undefined symbol errors, you need to make sure
-that each template instance which is used in the program is used in the
-file which implements that template.  If you don't have any use for a
-particular instance in that file, you can just instantiate it
-explicitly, using the syntax from the latest C++ working paper:
-
-@example
-template class A<int>;
-template ostream& operator << (ostream&, const A<int>&);
-@end example
-
-This strategy will work with code written for either model.  If you are
-using code written for the Cfront model, the file containing a class
-template and the file containing its member templates should be
-implemented in the same translation unit.
-
-@item
-@opindex falt-external-templates
-A slight variation on this approach is to use the flag
-@option{-falt-external-templates} instead.  This flag causes template
-instances to be emitted in the translation unit that implements the
-header where they are first instantiated, rather than the one which
-implements the file where the templates are defined.  This header must
-be the same in all translation units, or things are likely to break.
-
 @xref{C++ Interface,,Declarations and Definitions in One Header}, for
 more discussion of these pragmas.
 @end enumerate
 
 @node Bound member functions
 @section Extracting the function pointer from a bound pointer to member function
-
 @cindex pmf
 @cindex pointer to member function
 @cindex bound pointer to member function
@@ -7266,10 +7539,10 @@ inclusive.  Lower numbers indicate a higher priority.
 In the following example, @code{A} would normally be created before
 @code{B}, but the @code{init_priority} attribute has reversed that order:
 
-@example
+@smallexample
 Some_Class  A  __attribute__ ((init_priority (2000)));
 Some_Class  B  __attribute__ ((init_priority (543)));
-@end example
+@end smallexample
 
 @noindent
 Note that the particular values of @var{priority} do not matter; only their
@@ -7295,7 +7568,7 @@ appropriately.  However, if C++ code only needs to execute destructors
 when Java exceptions are thrown through it, GCC will guess incorrectly.
 Sample problematic code is:
 
-@example
+@smallexample
   struct S @{ ~S(); @};
   extern void bar();    // is written in Java, and may throw exceptions
   void foo()
@@ -7303,7 +7576,7 @@ Sample problematic code is:
     S s;
     bar();
   @}
-@end example
+@end smallexample
 
 @noindent
 The usual effect of an incorrect guess is a link failure, complaining of
@@ -7360,7 +7633,7 @@ Floating and complex non-type template parameters have been deprecated,
 and are now removed from g++.
 
 The implicit typename extension has been deprecated and will be removed
-from g++ at some point.  In some cases g++ determines that a dependant
+from g++ at some point.  In some cases g++ determines that a dependent
 type such as @code{TPL<T>::X} is a type without needing a
 @code{typename} keyword, contrary to the standard.