avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] FW: [4.5 C] Provide <stdint.h> (bug 448)


From: Weddington, Eric
Subject: [avr-libc-dev] FW: [4.5 C] Provide <stdint.h> (bug 448)
Date: Fri, 7 Nov 2008 19:44:42 -0700

Hi All avr-libc developers,

The email below just came across the gcc-patches mailing list. It might have 
repercutions for us. But it's hard to figure out from the email below exactly 
what he's changing.

If you want to respond to the email below, please do so on the gcc-patches 
mailing list.

Eric Weddington

> -----Original Message-----
> From: Joseph S. Myers [mailto:address@hidden 
> Sent: Friday, November 07, 2008 5:10 PM
> To: address@hidden
> Cc: address@hidden
> Subject: [4.5 C] Provide <stdint.h> (bug 448)
> 
> [Bruce, note a fixincludes approval is requested below.]
> 
> This patch (for 4.5 Stage 1, and against c-4_5-branch but without any
> significant dependence on any other changes there) adds the
> infrastructure for GCC to provide <stdint.h> (bug 448) and know
> internally about the types used in that header.
> 
> The benefits of doing so (once the support has been filled out for all
> targets) include:
> 
> * The header is available for users on all targets, and they can use
>   it for freestanding compilations without possibly bringing in other
>   libc system headers unsuitable for such (e.g. kernel) compilations.
> 
> * The header is available for use in GCC's target libraries, some of
>   which presently create a substitute if the target lacks the header.
> 
> * The information is available in the compiler for use in Fortran's C
>   bindings that require information about these types.
> 
> * The header is available for use in the testsuite without needing any
>   effective-target checks or XFAILs.
> 
> Providing such a header where the system's libc also provides one runs
> into potential problems where other system headers rely on details of
> the particular header provided by libc and do not work with a GCC
> version.  (GCC allows duplicate typedefs in system headers for both C
> and C++ so this should not generally be a problem with the type
> definitions, but other issues may arise.)  To reduce such problems,
> for hosted compilations this patch follows Zack's advice in
> <http://gcc.gnu.org/ml/gcc/2004-11/msg00254.html> not to override a
> system copy of the header, while for freestanding compilations GCC's
> version is used.  If needed, feature test macros could easily be added
> to force use of the system version in freestanding mode or of GCC's
> version for hosted compiles, but I'd rather not add them without
> evidence first they are needed.
> 
> Now, preferring the system's header for hosted compiles does mean that
> bugs in that header need fixing with fixincludes.  This patch includes
> just such fixes for newlib's stdint.h; newlib_stdint_1 is written with
> "sed" fixes rather than "format" to avoid it expanding into a large
> pile of separate fix entries for all the buggy macro definitions.  (I
> also have a patch for newlib itself to avoid the need for these fixes,
> and to fix as much as possible for newlib without needing the compiler
> patch; I'll send that upstream once this patch is approved for 4.5.)
> 
> Providing <stdint.h>, or having the type information for Fortran
> bindings, requires GCC to know about all the <stdint.h> types
> internally - and about sig_atomic_t to provide the limits for that
> type.  This patch adds a batch of new target macros for targets to
> define all the relevant types.  In turn the compiler predefines macros
> for the types themselves and for their limits, for use in the header.
> (Macros for unsigned max values are provided because of the difficulty
> otherwise in determining the right unsigned type to use in arithmetic
> to get them from the signed max values - remember the macros must both
> have the right type and be usable in #if expressions.  Macros for min
> values of types that may be signed or unsigned are provided for the
> same reason.)
> 
> To facilitate the transition to having this information in GCC for all
> targets, the compiler supports not having these types defined, and not
> installing stdint.h if not ready to do so.  There are three options
> for stdint.h installation in config.gcc; by default, nothing is
> installed.  It can also be installed as a wrapper for the system's
> copy (falling back to that copy for hosted compilations), or provided
> unconditionally by GCC for a target that doesn't have a system copy;
> these options are only appropriate when GCC has been configured with
> the types for a target.  The approach of a wrapper using #include_next
> could run into trouble if more than one copy of this wrapper is in the
> include path before the system header (the only case I know where this
> should happen is "make check" when the compiler is also installed,
> setting GCC_EXEC_PREFIX), so the multiple-include macro is defined at
> the end rather than the start of the wrapper to allow such multiple
> copies to work.
> 
> I have included definitions of the types for glibc/uClibc, newlib and
> Solaris.  For Solaris, I have presumed that Solaris 9 is like Solaris
> 8 in not having a system <stdint.h> header (I only have access to 8
> and 10, not 9).  For newlib, a few specific targets need changes where
> the normal newlib defaults don't apply (there's a special case for SPU
> in newlib's <stdint.h>, and two targets don't necessarily have size_t
> the unsigned type corresponding to ptrdiff_t so need UINTPTR_TYPE
> defined in their target-specific configuration headers).
> 
> The glibc/uClibc definitions involve a lot of config.gcc changes to
> get a common header used for all relevant targets; most of the targets
> (including non-Linux ones) include config/linux.h, but those on Alpha
> and Power and some uClinux configurations do not.  The newlib
> definitions similarly involve a lot of such changes.  I've applied the
> newlib type definitions to all the "generic" *-*-elf and similar
> targets that don't specify an OS as well as to RTEMS targets; if a
> target uses a non-newlib library with different stdint.h definitions,
> the testcases added should detect this and the maintainers can fix it.
> 
> I expect the definitions for most target OSes to be reasonably simple,
> in terms of both config.gcc changes and config header changes, more
> like the Solaris definitions than the glibc/uClibc and newlib ones,
> since generally either an OS is only supported on one or a few targets
> or there is a convenient shared config header for the definitions to
> go in.  My proposal would be that once this is in trunk I (possibly
> fill in the definitions for more targets and) post a list of the OSes
> without these type definitions to the gcc list and people identified
> as likely to have access to the relevant OSes; if no-one responds
> about adding the definitions for an OS in a reasonable time and we
> wish to get the benefits of the header being guaranteed everywhere, we
> can consider deprecations.  I'd also encourage people to add this
> configuration for additional targets on c-4_5-branch before 4.4
> branches.
> 
> Bootstrapped with no regressions on i686-pc-linux-gnu.  I've also run
> gcc.dg tests for arm-none-eabi (both with and without my patches to
> fix newlib's header in newlib itself) and sparc-sun-solaris2.8, to
> verify the new tests are passing and the types are correct in those
> cases.  (Note that some u"" and U"" string tests will fail if GCC now
> knows that uint_least16_t or uint_least32_t are different from its
> default for char16_t and char32_t; this is fixed by my patch to make
> those tests consistently use __CHAR16_TYPE__ and __CHAR32_TYPE__,
> which will go on c-4_5-branch with my next merge from trunk.)  Are the
> non-C-front-end changes (target configuration, config.gcc,
> configure/build support for stdint.h installation, target-supports.exp
> changes, fixincludes changes) OK for 4.5?
> 
> fixincludes:
> 2008-11-08  Joseph Myers  <address@hidden>
> 
>       PR c/448
>       * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes.
>       * fixincl.x: Regenerate.
>       * tests/base/stdint.h: Update.
> 
> gcc:
> 2008-11-08  Joseph Myers  <address@hidden>
> 
>       PR c/448
>       * Makefile.in (USE_GCC_STDINT): Define.
>       (stmp-int-hdrs): Install stdint.h if applicable.
>       * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE
>       if known.
>       (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known.
>       (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE,
>       UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE,
>       INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
>       INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
>       UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
>       INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
>       UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
>       UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define.
>       (c_common_nodes_and_builtins): Initialize
>       underlying_wchar_type_node.  Do not initialize
>       signed_wchar_type_node or unsigned_wchar_type_node.  Initialize
>       nodes for new types.
>       (c_stddef_cpp_builtins): Define macros for new types.
>       * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE):
>       Remove.
>       (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE,
>       CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE,
>       CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE,
>       CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE,
>       CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, 
> CTI_UINT_LEAST16_TYPE,
>       CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, 
> CTI_INT_FAST8_TYPE,
>       CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE,
>       CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE,
>       CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, 
> CTI_UINTPTR_TYPE): Define.
>       (signed_wchar_type_node, unsigned_wchar_type_node): Remove.
>       (underlying_wchar_type_node, sig_atomic_type_node, 
> int8_type_node,
>       int16_type_node, int32_type_node, int64_type_node,
>       uint8_type_node, uint16_type_node, c_uint32_type_node,
>       c_uint64_type_node, int_least8_type_node, int_least16_type_node,
>       int_least32_type_node, int_least64_type_node,
>       uint_least8_type_node, uint_least16_type_node,
>       uint_least32_type_node, uint_least64_type_node,
>       int_fast8_type_node, int_fast16_type_node, int_fast32_type_node,
>       int_fast64_type_node, uint_fast8_type_node, 
> uint_fast16_type_node,
>       uint_fast32_type_node, uint_fast64_type_node, intptr_type_node,
>       uintptr_type_node): Define.
>       * c-cppbuiltin.c (builtin_define_constants,
>       builtin_define_type_minmax): New.
>       (builtin_define_stdint_macros): Define more macros.
>       (c_cpp_builtins): Define more limit macros.
>       (type_suffix): New.
>       (builtin_define_type_max): Define in terms of
>       builtin_define_type_minmax.  Remove is_long parameter.  All
>       callers changed.
>       * config.gcc (use_gcc_stdint): Define.
>       (tm_file): Add glibc-stdint.h for targets using glibc or uClibc.
>       Add newlib-stdint.h for generic targets.
>       * config/glibc-stdint.h, config/newlib-stdint.h,
>       ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New.
>       * config/m32c/m32c.h (UINTPTR_TYPE): Define.
>       * config/score/score.h (UINTPTR_TYPE): Define.
>       * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE,
>       INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE,
>       UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, 
> INT_LEAST32_TYPE,
>       INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
>       UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
>       INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
>       UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
>       UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define.
>       * config/spu/spu.h (STDINT_LONG32): Define.
>       * configure.ac (use_gcc_stdint): Substitute.
>       * configure: Regenerate.
>       * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__,
>       __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__,
>       __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__,
>       __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__,
>       __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, 
> __UINT_LEAST16_TYPE__,
>       __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__,
>       __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__,
>       __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__,
>       __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__,
>       __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__,
>       __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__,
>       __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__,
>       __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__,
>       __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__,
>       __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, 
> __UINT_LEAST64_MAX__,
>       __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__,
>       __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__,
>       __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__,
>       __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, 
> __SIG_ATOMIC_MIN__,
>       __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, 
> __UINT16_C,
>       __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document.
>       * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, 
> INT32_TYPE,
>       INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE,
>       INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE,
>       INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE,
>       UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE,
>       INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE,
>       UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE,
>       UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document.
> 
> gcc/testsuite:
> 2008-11-08  Joseph Myers  <address@hidden>
> 
>       PR c/448
>       * lib/target-supports.exp (check_effective_target_stdint_types):
>       Update comment.
>       (check_effective_target_inttypes_types): New.
>       * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c,
>       gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c,
>       gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests.
> 
> Index: gcc/doc/cpp.texi
> ===================================================================
> --- gcc/doc/cpp.texi  (revision 141680)
> +++ gcc/doc/cpp.texi  (working copy)
> @@ -2117,13 +2117,50 @@
>  @itemx __WINT_TYPE__
>  @itemx __INTMAX_TYPE__
>  @itemx __UINTMAX_TYPE__
> address@hidden __SIG_ATOMIC_TYPE__
> address@hidden __INT8_TYPE__
> address@hidden __INT16_TYPE__
> address@hidden __INT32_TYPE__
> address@hidden __INT64_TYPE__
> address@hidden __UINT8_TYPE__
> address@hidden __UINT16_TYPE__
> address@hidden __UINT32_TYPE__
> address@hidden __UINT64_TYPE__
> address@hidden __INT_LEAST8_TYPE__
> address@hidden __INT_LEAST16_TYPE__
> address@hidden __INT_LEAST32_TYPE__
> address@hidden __INT_LEAST64_TYPE__
> address@hidden __UINT_LEAST8_TYPE__
> address@hidden __UINT_LEAST16_TYPE__
> address@hidden __UINT_LEAST32_TYPE__
> address@hidden __UINT_LEAST64_TYPE__
> address@hidden __INT_FAST8_TYPE__
> address@hidden __INT_FAST16_TYPE__
> address@hidden __INT_FAST32_TYPE__
> address@hidden __INT_FAST64_TYPE__
> address@hidden __UINT_FAST8_TYPE__
> address@hidden __UINT_FAST16_TYPE__
> address@hidden __UINT_FAST32_TYPE__
> address@hidden __UINT_FAST64_TYPE__
> address@hidden __INTPTR_TYPE__
> address@hidden __UINTPTR_TYPE__
>  These macros are defined to the correct underlying types for the
>  @code{size_t}, @code{ptrdiff_t}, @code{wchar_t}, @code{wint_t},
> address@hidden, and @code{uintmax_t}
> -typedefs, respectively.  They exist to make the standard header files
> address@hidden and @file{wchar.h} work correctly.  You 
> should not use
> -these macros directly; instead, include the appropriate 
> headers and use
> -the typedefs.
> address@hidden, @code{uintmax_t}, @code{sig_atomic_t}, 
> @code{int8_t},
> address@hidden, @code{int32_t}, @code{int64_t}, @code{uint8_t},
> address@hidden, @code{uint32_t}, @code{uint64_t},
> address@hidden, @code{int_least16_t}, @code{int_least32_t},
> address@hidden, @code{uint_least8_t}, @code{uint_least16_t},
> address@hidden, @code{uint_least64_t}, @code{int_fast8_t},
> address@hidden, @code{int_fast32_t}, @code{int_fast64_t},
> address@hidden, @code{uint_fast16_t}, @code{uint_fast32_t},
> address@hidden, @code{intptr_t}, and @code{uintptr_t} typedefs,
> +respectively.  They exist to make the standard header files
> address@hidden, @file{stdint.h}, and @file{wchar.h} work correctly.
> +You should not use these macros directly; instead, include the
> +appropriate headers and use the typedefs.  Some of these macros may
> +not be defined on particular systems if GCC does not provide a
> address@hidden header on those systems.
>  
>  @item __CHAR_BIT__
>  Defined to the number of bits used in the representation of the
> @@ -2137,15 +2174,78 @@
>  @itemx __INT_MAX__
>  @itemx __LONG_MAX__
>  @itemx __LONG_LONG_MAX__
> address@hidden __WINT_MAX__
> address@hidden __SIZE_MAX__
> address@hidden __PTRDIFF_MAX__
>  @itemx __INTMAX_MAX__
> address@hidden __UINTMAX_MAX__
> address@hidden __SIG_ATOMIC_MAX__
> address@hidden __INT8_MAX__
> address@hidden __INT16_MAX__
> address@hidden __INT32_MAX__
> address@hidden __INT64_MAX__
> address@hidden __UINT8_MAX__
> address@hidden __UINT16_MAX__
> address@hidden __UINT32_MAX__
> address@hidden __UINT64_MAX__
> address@hidden __INT_LEAST8_MAX__
> address@hidden __INT_LEAST16_MAX__
> address@hidden __INT_LEAST32_MAX__
> address@hidden __INT_LEAST64_MAX__
> address@hidden __UINT_LEAST8_MAX__
> address@hidden __UINT_LEAST16_MAX__
> address@hidden __UINT_LEAST32_MAX__
> address@hidden __UINT_LEAST64_MAX__
> address@hidden __INT_FAST8_MAX__
> address@hidden __INT_FAST16_MAX__
> address@hidden __INT_FAST32_MAX__
> address@hidden __INT_FAST64_MAX__
> address@hidden __UINT_FAST8_MAX__
> address@hidden __UINT_FAST16_MAX__
> address@hidden __UINT_FAST32_MAX__
> address@hidden __UINT_FAST64_MAX__
> address@hidden __INTPTR_MAX__
> address@hidden __UINTPTR_MAX__
> address@hidden __WCHAR_MIN__
> address@hidden __WINT_MIN__
> address@hidden __SIG_ATOMIC_MIN__
>  Defined to the maximum value of the @code{signed char}, 
> @code{wchar_t},
>  @code{signed short},
> address@hidden int}, @code{signed long}, @code{signed long long}, and
> address@hidden types
> -respectively.  They exist to make the standard header given 
> numerical limits
> -work correctly.  You should not use these macros directly; 
> instead, include
> -the appropriate headers.
> address@hidden int}, @code{signed long}, @code{signed long long},
> address@hidden, @code{size_t}, @code{ptrdiff_t},
> address@hidden, @code{uintmax_t}, @code{sig_atomic_t}, 
> @code{int8_t},
> address@hidden, @code{int32_t}, @code{int64_t}, @code{uint8_t},
> address@hidden, @code{uint32_t}, @code{uint64_t},
> address@hidden, @code{int_least16_t}, @code{int_least32_t},
> address@hidden, @code{uint_least8_t}, @code{uint_least16_t},
> address@hidden, @code{uint_least64_t}, @code{int_fast8_t},
> address@hidden, @code{int_fast32_t}, @code{int_fast64_t},
> address@hidden, @code{uint_fast16_t}, @code{uint_fast32_t},
> address@hidden, @code{intptr_t}, and @code{uintptr_t} types and
> +to the minimum value of the @code{wchar_t}, @code{wint_t}, and
> address@hidden types respectively.  They exist to make the
> +standard header given numerical limits work correctly.  You 
> should not
> +use these macros directly; instead, include the appropriate headers.
> +Some of these macros may not be defined on particular systems if GCC
> +does not provide a @file{stdint.h} header on those systems.
>  
> address@hidden __INT8_C
> address@hidden __INT16_C
> address@hidden __INT32_C
> address@hidden __INT64_C
> address@hidden __UINT8_C
> address@hidden __UINT16_C
> address@hidden __UINT32_C
> address@hidden __UINT64_C
> address@hidden __INTMAX_C
> address@hidden __UINTMAX_C
> +Defined to implementations of the standard @file{stdint.h} 
> macros with
> +the same names without the leading @code{__}.  They exist 
> the make the
> +implementation of that header work correctly.  You should not use
> +these macros directly; instead, include the appropriate 
> headers.  Some
> +of these macros may not be defined on particular systems if GCC does
> +not provide a @file{stdint.h} header on those systems.
> +
>  @item __SIZEOF_INT__
>  @itemx __SIZEOF_LONG__
>  @itemx __SIZEOF_LONG_LONG__
> Index: gcc/doc/tm.texi
> ===================================================================
> --- gcc/doc/tm.texi   (revision 141680)
> +++ gcc/doc/tm.texi   (working copy)
> @@ -1764,6 +1764,51 @@
>  int}.
>  @end defmac
>  
> address@hidden SIG_ATOMIC_TYPE
> address@hidden INT8_TYPE
> address@hidden INT16_TYPE
> address@hidden INT32_TYPE
> address@hidden INT64_TYPE
> address@hidden UINT8_TYPE
> address@hidden UINT16_TYPE
> address@hidden UINT32_TYPE
> address@hidden UINT64_TYPE
> address@hidden INT_LEAST8_TYPE
> address@hidden INT_LEAST16_TYPE
> address@hidden INT_LEAST32_TYPE
> address@hidden INT_LEAST64_TYPE
> address@hidden UINT_LEAST8_TYPE
> address@hidden UINT_LEAST16_TYPE
> address@hidden UINT_LEAST32_TYPE
> address@hidden UINT_LEAST64_TYPE
> address@hidden INT_FAST8_TYPE
> address@hidden INT_FAST16_TYPE
> address@hidden INT_FAST32_TYPE
> address@hidden INT_FAST64_TYPE
> address@hidden UINT_FAST8_TYPE
> address@hidden UINT_FAST16_TYPE
> address@hidden UINT_FAST32_TYPE
> address@hidden UINT_FAST64_TYPE
> address@hidden INTPTR_TYPE
> address@hidden UINTPTR_TYPE
> +C expressions for the standard types @code{sig_atomic_t},
> address@hidden, @code{int16_t}, @code{int32_t}, @code{int64_t},
> address@hidden, @code{uint16_t}, @code{uint32_t}, @code{uint64_t},
> address@hidden, @code{int_least16_t}, @code{int_least32_t},
> address@hidden, @code{uint_least8_t}, @code{uint_least16_t},
> address@hidden, @code{uint_least64_t}, @code{int_fast8_t},
> address@hidden, @code{int_fast32_t}, @code{int_fast64_t},
> address@hidden, @code{uint_fast16_t}, @code{uint_fast32_t},
> address@hidden, @code{intptr_t}, and @code{uintptr_t}.  See
> address@hidden above for more information.
> +
> +If any of these macros evaluates to a null pointer, the corresponding
> +type is not supported; if GCC is configured to provide
> address@hidden<stdint.h>} in such a case, the header provided may not conform
> +to C99, depending on the type in question.  The defaults for all of
> +these macros are null pointers.
> address@hidden defmac
> +
>  @defmac TARGET_PTRMEMFUNC_VBIT_LOCATION
>  The C++ compiler represents a pointer-to-member-function 
> with a struct
>  that looks like:
> Index: gcc/ginclude/stdint-wrap.h
> ===================================================================
> --- gcc/ginclude/stdint-wrap.h        (revision 0)
> +++ gcc/ginclude/stdint-wrap.h        (revision 0)
> @@ -0,0 +1,8 @@
> +#ifndef _GCC_WRAP_STDINT_H
> +#if __STDC_HOSTED__
> +# include_next <stdint.h>
> +#else
> +# include "stdint-gcc.h"
> +#endif
> +#define _GCC_WRAP_STDINT_H
> +#endif
> Index: gcc/ginclude/stdint-gcc.h
> ===================================================================
> --- gcc/ginclude/stdint-gcc.h (revision 0)
> +++ gcc/ginclude/stdint-gcc.h (revision 0)
> @@ -0,0 +1,262 @@
> +/* Copyright (C) 2008 Free Software Foundation, Inc.
> +
> +This file is part of GCC.
> +
> +GCC is free software; you can redistribute it and/or modify
> +it under the terms of the GNU General Public License as published by
> +the Free Software Foundation; either version 2, or (at your option)
> +any later version.
> +
> +GCC is distributed in the hope that it will be useful,
> +but WITHOUT ANY WARRANTY; without even the implied warranty of
> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +GNU General Public License for more details.
> +
> +You should have received a copy of the GNU General Public License
> +along with GCC; see the file COPYING.  If not, write to
> +the Free Software Foundation, 51 Franklin Street, Fifth Floor,
> +Boston, MA 02110-1301, USA.  */
> +
> +/* As a special exception, if you include this header file 
> into source
> +   files compiled by GCC, this header file does not by itself cause
> +   the resulting executable to be covered by the GNU General Public
> +   License.  This exception does not however invalidate any other
> +   reasons why the executable file might be covered by the 
> GNU General
> +   Public License.  */
> +
> +/*
> + * ISO C Standard:  7.18  Integer types  <stdint.h>
> + */
> +
> +#ifndef _GCC_STDINT_H
> +#define _GCC_STDINT_H
> +
> +/* 7.8.1.1 Exact-width integer types */
> +
> +#ifdef __INT8_TYPE__
> +typedef __INT8_TYPE__ int8_t;
> +#endif
> +#ifdef __INT16_TYPE__
> +typedef __INT16_TYPE__ int16_t;
> +#endif
> +#ifdef __INT32_TYPE__
> +typedef __INT32_TYPE__ int32_t;
> +#endif
> +#ifdef __INT64_TYPE__
> +typedef __INT64_TYPE__ int64_t;
> +#endif
> +#ifdef __UINT8_TYPE__
> +typedef __UINT8_TYPE__ uint8_t;
> +#endif
> +#ifdef __UINT16_TYPE__
> +typedef __UINT16_TYPE__ uint16_t;
> +#endif
> +#ifdef __UINT32_TYPE__
> +typedef __UINT32_TYPE__ uint32_t;
> +#endif
> +#ifdef __UINT64_TYPE__
> +typedef __UINT64_TYPE__ uint64_t;
> +#endif
> +
> +/* 7.8.1.2 Minimum-width integer types */
> +
> +typedef __INT_LEAST8_TYPE__ int_least8_t;
> +typedef __INT_LEAST16_TYPE__ int_least16_t;
> +typedef __INT_LEAST32_TYPE__ int_least32_t;
> +typedef __INT_LEAST64_TYPE__ int_least64_t;
> +typedef __UINT_LEAST8_TYPE__ uint_least8_t;
> +typedef __UINT_LEAST16_TYPE__ uint_least16_t;
> +typedef __UINT_LEAST32_TYPE__ uint_least32_t;
> +typedef __UINT_LEAST64_TYPE__ uint_least64_t;
> +
> +/* 7.8.1.3 Fastest minimum-width integer types */
> +
> +typedef __INT_FAST8_TYPE__ int_fast8_t;
> +typedef __INT_FAST16_TYPE__ int_fast16_t;
> +typedef __INT_FAST32_TYPE__ int_fast32_t;
> +typedef __INT_FAST64_TYPE__ int_fast64_t;
> +typedef __UINT_FAST8_TYPE__ uint_fast8_t;
> +typedef __UINT_FAST16_TYPE__ uint_fast16_t;
> +typedef __UINT_FAST32_TYPE__ uint_fast32_t;
> +typedef __UINT_FAST64_TYPE__ uint_fast64_t;
> +
> +/* 7.8.1.4 Integer types capable of holding object pointers */
> +
> +#ifdef __INTPTR_TYPE__
> +typedef __INTPTR_TYPE__ intptr_t;
> +#endif
> +#ifdef __UINTPTR_TYPE__
> +typedef __UINTPTR_TYPE__ uintptr_t;
> +#endif
> +
> +/* 7.8.1.5 Greatest-width integer types */
> +
> +typedef __INTMAX_TYPE__ intmax_t;
> +typedef __UINTMAX_TYPE__ uintmax_t;
> +
> +#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
> +
> +/* 7.18.2 Limits of specified-width integer types */
> +
> +#ifdef __INT8_MAX__
> +# undef INT8_MAX
> +# define INT8_MAX __INT8_MAX__
> +# undef INT8_MIN
> +# define INT8_MIN (-INT8_MAX - 1)
> +#endif
> +#ifdef __UINT8_MAX__
> +# undef UINT8_MAX
> +# define UINT8_MAX __UINT8_MAX__
> +#endif
> +#ifdef __INT16_MAX__
> +# undef INT16_MAX
> +# define INT16_MAX __INT16_MAX__
> +# undef INT16_MIN
> +# define INT16_MIN (-INT16_MAX - 1)
> +#endif
> +#ifdef __UINT16_MAX__
> +# undef UINT16_MAX
> +# define UINT16_MAX __UINT16_MAX__
> +#endif
> +#ifdef __INT32_MAX__
> +# undef INT32_MAX
> +# define INT32_MAX __INT32_MAX__
> +# undef INT32_MIN
> +# define INT32_MIN (-INT32_MAX - 1)
> +#endif
> +#ifdef __UINT32_MAX__
> +# undef UINT32_MAX
> +# define UINT32_MAX __UINT32_MAX__
> +#endif
> +#ifdef __INT64_MAX__
> +# undef INT64_MAX
> +# define INT64_MAX __INT64_MAX__
> +# undef INT64_MIN
> +# define INT64_MIN (-INT64_MAX - 1)
> +#endif
> +#ifdef __UINT64_MAX__
> +# undef UINT64_MAX
> +# define UINT64_MAX __UINT64_MAX__
> +#endif
> +
> +#undef INT_LEAST8_MAX
> +#define INT_LEAST8_MAX __INT_LEAST8_MAX__
> +#undef INT_LEAST8_MIN
> +#define INT_LEAST8_MIN (-INT_LEAST8_MAX - 1)
> +#undef UINT_LEAST8_MAX
> +#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
> +#undef INT_LEAST16_MAX
> +#define INT_LEAST16_MAX __INT_LEAST16_MAX__
> +#undef INT_LEAST16_MIN
> +#define INT_LEAST16_MIN (-INT_LEAST16_MAX - 1)
> +#undef UINT_LEAST16_MAX
> +#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
> +#undef INT_LEAST32_MAX
> +#define INT_LEAST32_MAX __INT_LEAST32_MAX__
> +#undef INT_LEAST32_MIN
> +#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
> +#undef UINT_LEAST32_MAX
> +#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
> +#undef INT_LEAST64_MAX
> +#define INT_LEAST64_MAX __INT_LEAST64_MAX__
> +#undef INT_LEAST64_MIN
> +#define INT_LEAST64_MIN (-INT_LEAST64_MAX - 1)
> +#undef UINT_LEAST64_MAX
> +#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
> +
> +#undef INT_FAST8_MAX
> +#define INT_FAST8_MAX __INT_FAST8_MAX__
> +#undef INT_FAST8_MIN
> +#define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
> +#undef UINT_FAST8_MAX
> +#define UINT_FAST8_MAX __UINT_FAST8_MAX__
> +#undef INT_FAST16_MAX
> +#define INT_FAST16_MAX __INT_FAST16_MAX__
> +#undef INT_FAST16_MIN
> +#define INT_FAST16_MIN (-INT_FAST16_MAX - 1)
> +#undef UINT_FAST16_MAX
> +#define UINT_FAST16_MAX __UINT_FAST16_MAX__
> +#undef INT_FAST32_MAX
> +#define INT_FAST32_MAX __INT_FAST32_MAX__
> +#undef INT_FAST32_MIN
> +#define INT_FAST32_MIN (-INT_FAST32_MAX - 1)
> +#undef UINT_FAST32_MAX
> +#define UINT_FAST32_MAX __UINT_FAST32_MAX__
> +#undef INT_FAST64_MAX
> +#define INT_FAST64_MAX __INT_FAST64_MAX__
> +#undef INT_FAST64_MIN
> +#define INT_FAST64_MIN (-INT_FAST64_MAX - 1)
> +#undef UINT_FAST64_MAX
> +#define UINT_FAST64_MAX __UINT_FAST64_MAX__
> +
> +#ifdef __INTPTR_MAX__
> +# undef INTPTR_MAX
> +# define INTPTR_MAX __INTPTR_MAX__
> +# undef INTPTR_MIN
> +# define INTPTR_MIN (-INTPTR_MAX - 1)
> +#endif
> +#ifdef __UINTPTR_MAX__
> +# undef UINTPTR_MAX
> +# define UINTPTR_MAX __UINTPTR_MAX__
> +#endif
> +
> +#undef INTMAX_MAX
> +#define INTMAX_MAX __INTMAX_MAX__
> +#undef INTMAX_MIN
> +#define INTMAX_MIN (-INTMAX_MAX - 1)
> +#undef UINTMAX_MAX
> +#define UINTMAX_MAX __UINTMAX_MAX__
> +
> +/* 7.18.3 Limits of other integer types */
> +
> +#undef PTRDIFF_MAX
> +#define PTRDIFF_MAX __PTRDIFF_MAX__
> +#undef PTRDIFF_MIN
> +#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
> +
> +#undef SIG_ATOMIC_MAX
> +#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
> +#undef SIG_ATOMIC_MIN
> +#define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
> +
> +#undef SIZE_MAX
> +#define SIZE_MAX __SIZE_MAX__
> +
> +#undef WCHAR_MAX
> +#define WCHAR_MAX __WCHAR_MAX__
> +#undef WCHAR_MIN
> +#define WCHAR_MIN __WCHAR_MIN__
> +
> +#undef WINT_MAX
> +#define WINT_MAX __WINT_MAX__
> +#undef WINT_MIN
> +#define WINT_MIN __WINT_MIN__
> +
> +#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
> +
> +#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
> +
> +#undef INT8_C
> +#define INT8_C(c) __INT8_C(c)
> +#undef INT16_C
> +#define INT16_C(c) __INT16_C(c)
> +#undef INT32_C
> +#define INT32_C(c) __INT32_C(c)
> +#undef INT64_C
> +#define INT64_C(c) __INT64_C(c)
> +#undef UINT8_C
> +#define UINT8_C(c) __UINT8_C(c)
> +#undef UINT16_C
> +#define UINT16_C(c) __UINT16_C(c)
> +#undef UINT32_C
> +#define UINT32_C(c) __UINT32_C(c)
> +#undef UINT64_C
> +#define UINT64_C(c) __UINT64_C(c)
> +#undef INTMAX_C
> +#define INTMAX_C(c) __INTMAX_C(c)
> +#undef UINTMAX_C
> +#define UINTMAX_C(c) __UINTMAX_C(c)
> +
> +#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
> +
> +#endif /* _GCC_STDINT_H */
> Index: gcc/configure
> ===================================================================
> --- gcc/configure     (revision 141680)
> +++ gcc/configure     (working copy)
> @@ -458,7 +458,7 @@
>  # include <unistd.h>
>  #endif"
>  
> -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME 
> PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING 
> PACKAGE_BUGREPORT exec_prefix prefix program_transform_name 
> bindir sbindir libexecdir datadir sysconfdir sharedstatedir 
> localstatedir libdir includedir oldincludedir infodir mandir 
> build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T 
> LIBS build build_cpu build_vendor build_os host host_cpu 
> host_vendor host_os target target_cpu target_vendor target_os 
> target_noncanonical build_libsubdir build_subdir host_subdir 
> target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC 
> EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE 
> NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn 
> strict_warn warn_cflags nocommon_flag TREEBROWSER 
> valgrind_path valgrind_path_defines valgrind_command 
> coverage_flags enable_multilib enable_decimal_float 
> enable_fixed_point enable_shared TARGET_SYSTEM_ROOT 
> TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep 
> PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir 
> htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags 
> INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target 
> have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES 
> FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB 
> TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext 
> objext gthread_flags extra_modes_file extra_opt_files USE_NLS 
> LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS 
> DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL 
> SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS 
> BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED 
> FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP 
> ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL 
> NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 
> ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as 
> ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET 
> gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump 
> libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir 
> dollar slibdir subdirs srcdir all_compilers all_gtfiles 
> all_lang_makefrags all_lang_makefiles all_languages 
> all_selected_languages build_exeext build_install_headers_dir 
> build_xm_file_list build_xm_include_list build_xm_defines 
> build_file_translate check_languages cpp_install_dir 
> xmake_file tmake_file extra_gcc_objs extra_headers_list 
> extra_objs extra_parts extra_passes extra_programs 
> float_h_file gcc_config_arguments gcc_gxx_include_dir 
> host_exeext host_xm_file_list host_xm_include_list 
> host_xm_defines out_host_hook_obj install lang_opt_files 
> lang_specs_files lang_tree_files local_prefix md_file 
> objc_boehm_gc out_file out_object_file thread_file 
> tm_file_list tm_include_list tm_defines tm_p_file_list 
> tm_p_include_list xm_file_list xm_include_list xm_defines 
> c_target_objs cxx_target_objs fortran_target_objs 
> target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS 
> CLOOGINC LIBOBJS LTLIBOBJS'
> +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME 
> PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING 
> PACKAGE_BUGREPORT exec_prefix prefix program_transform_name 
> bindir sbindir libexecdir datadir sysconfdir sharedstatedir 
> localstatedir libdir includedir oldincludedir infodir mandir 
> build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T 
> LIBS build build_cpu build_vendor build_os host host_cpu 
> host_vendor host_os target target_cpu target_vendor target_os 
> target_noncanonical build_libsubdir build_subdir host_subdir 
> target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC 
> EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE 
> NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn 
> strict_warn warn_cflags nocommon_flag TREEBROWSER 
> valgrind_path valgrind_path_defines valgrind_command 
> coverage_flags enable_multilib enable_decimal_float 
> enable_fixed_point enable_shared TARGET_SYSTEM_ROOT 
> TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep 
> PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir 
> htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags 
> INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target 
> have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES 
> FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB 
> TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext 
> objext gthread_flags extra_modes_file extra_opt_files USE_NLS 
> LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS 
> DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL 
> SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS 
> BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED 
> FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP 
> ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL 
> NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 
> ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as 
> ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET 
> gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump 
> libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir 
> dollar slibdir subdirs srcdir all_compilers all_gtfiles 
> all_lang_makefrags all_lang_makefiles all_languages 
> all_selected_languages build_exeext build_install_headers_dir 
> build_xm_file_list build_xm_include_list build_xm_defines 
> build_file_translate check_languages cpp_install_dir 
> xmake_file tmake_file extra_gcc_objs extra_headers_list 
> extra_objs extra_parts extra_passes extra_programs 
> float_h_file gcc_config_arguments gcc_gxx_include_dir 
> host_exeext host_xm_file_list host_xm_include_list 
> host_xm_defines out_host_hook_obj install lang_opt_files 
> lang_specs_files lang_tree_files local_prefix md_file 
> objc_boehm_gc out_file out_object_file thread_file 
> tm_file_list tm_include_list tm_defines tm_p_file_list 
> tm_p_include_list xm_file_list xm_include_list xm_defines 
> use_gcc_stdint c_target_objs cxx_target_objs 
> fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS 
> PPLINC CLOOGLIBS CLOOGINC LIBOBJS LTLIBOBJS'
>  ac_subst_files='language_hooks'
>  ac_pwd=`pwd`
>  
> @@ -24718,6 +24718,7 @@
>  
>  
>  
> +
>  # Echo link setup.
>  if test x${build} = x${host} ; then
>    if test x${host} = x${target} ; then
> @@ -25586,6 +25587,7 @@
>  s,@xm_file_list@,$xm_file_list,;t t
>  s,@xm_include_list@,$xm_include_list,;t t
>  s,@xm_defines@,$xm_defines,;t t
> +s,@use_gcc_stdint@,$use_gcc_stdint,;t t
>  s,@c_target_objs@,$c_target_objs,;t t
>  s,@cxx_target_objs@,$cxx_target_objs,;t t
>  s,@fortran_target_objs@,$fortran_target_objs,;t t
> Index: gcc/c-cppbuiltin.c
> ===================================================================
> --- gcc/c-cppbuiltin.c        (revision 141680)
> +++ gcc/c-cppbuiltin.c        (working copy)
> @@ -55,7 +55,9 @@
>                                             const char *,
>                                             const char *);
>  static void builtin_define_stdint_macros (void);
> -static void builtin_define_type_max (const char *, tree, int);
> +static void builtin_define_constants (const char *, tree);
> +static void builtin_define_type_max (const char *, tree);
> +static void builtin_define_type_minmax (const char *, const 
> char *, tree);
>  static void builtin_define_type_precision (const char *, tree);
>  static void builtin_define_type_sizeof (const char *, tree);
>  static void builtin_define_float_constants (const char *, 
> @@ -393,21 +395,93 @@
>      cpp_define_formatted (parse_in, "__GNUG__=%d", major);
>  }
>  
> -/* Define macros used by <stdint.h>.  Currently only defines limits
> -   for intmax_t, used by the testsuite.  */
> +/* Define macros used by <stdint.h>.  */
>  static void
>  builtin_define_stdint_macros (void)
>  {
> -  int intmax_long;
> -  if (intmax_type_node == long_long_integer_type_node)
> -    intmax_long = 2;
> -  else if (intmax_type_node == long_integer_type_node)
> -    intmax_long = 1;
> -  else if (intmax_type_node == integer_type_node)
> -    intmax_long = 0;
> -  else
> -    gcc_unreachable ();
> -  builtin_define_type_max ("__INTMAX_MAX__", 
> intmax_type_node, intmax_long);
> +  builtin_define_type_max ("__INTMAX_MAX__", intmax_type_node);
> +  builtin_define_constants ("__INTMAX_C", intmax_type_node);
> +  builtin_define_type_max ("__UINTMAX_MAX__", uintmax_type_node);
> +  builtin_define_constants ("__UINTMAX_C", uintmax_type_node);
> +  if (sig_atomic_type_node)
> +    builtin_define_type_minmax ("__SIG_ATOMIC_MIN__", 
> "__SIG_ATOMIC_MAX__",
> +                             sig_atomic_type_node);
> +  if (int8_type_node)
> +    builtin_define_type_max ("__INT8_MAX__", int8_type_node);
> +  if (int16_type_node)
> +    builtin_define_type_max ("__INT16_MAX__", int16_type_node);
> +  if (int32_type_node)
> +    builtin_define_type_max ("__INT32_MAX__", int32_type_node);
> +  if (int64_type_node)
> +    builtin_define_type_max ("__INT64_MAX__", int64_type_node);
> +  if (uint8_type_node)
> +    builtin_define_type_max ("__UINT8_MAX__", uint8_type_node);
> +  if (uint16_type_node)
> +    builtin_define_type_max ("__UINT16_MAX__", uint16_type_node);
> +  if (c_uint32_type_node)
> +    builtin_define_type_max ("__UINT32_MAX__", c_uint32_type_node);
> +  if (c_uint64_type_node)
> +    builtin_define_type_max ("__UINT64_MAX__", c_uint64_type_node);
> +  if (int_least8_type_node)
> +    {
> +      builtin_define_type_max ("__INT_LEAST8_MAX__", 
> int_least8_type_node);
> +      builtin_define_constants ("__INT8_C", int_least8_type_node);
> +    }
> +  if (int_least16_type_node)
> +    {
> +      builtin_define_type_max ("__INT_LEAST16_MAX__", 
> int_least16_type_node);
> +      builtin_define_constants ("__INT16_C", int_least16_type_node);
> +    }
> +  if (int_least32_type_node)
> +    {
> +      builtin_define_type_max ("__INT_LEAST32_MAX__", 
> int_least32_type_node);
> +      builtin_define_constants ("__INT32_C", int_least32_type_node);
> +    }
> +  if (int_least64_type_node)
> +    {
> +      builtin_define_type_max ("__INT_LEAST64_MAX__", 
> int_least64_type_node);
> +      builtin_define_constants ("__INT64_C", int_least64_type_node);
> +    }
> +  if (uint_least8_type_node)
> +    {
> +      builtin_define_type_max ("__UINT_LEAST8_MAX__", 
> uint_least8_type_node);
> +      builtin_define_constants ("__UINT8_C", uint_least8_type_node);
> +    }
> +  if (uint_least16_type_node)
> +    {
> +      builtin_define_type_max ("__UINT_LEAST16_MAX__", 
> uint_least16_type_node);
> +      builtin_define_constants ("__UINT16_C", 
> uint_least16_type_node);
> +    }
> +  if (uint_least32_type_node)
> +    {
> +      builtin_define_type_max ("__UINT_LEAST32_MAX__", 
> uint_least32_type_node);
> +      builtin_define_constants ("__UINT32_C", 
> uint_least32_type_node);
> +    }
> +  if (uint_least64_type_node)
> +    {
> +      builtin_define_type_max ("__UINT_LEAST64_MAX__", 
> uint_least64_type_node);
> +      builtin_define_constants ("__UINT64_C", 
> uint_least64_type_node);
> +    }
> +  if (int_fast8_type_node)
> +    builtin_define_type_max ("__INT_FAST8_MAX__", 
> int_fast8_type_node);
> +  if (int_fast16_type_node)
> +    builtin_define_type_max ("__INT_FAST16_MAX__", 
> int_fast16_type_node);
> +  if (int_fast32_type_node)
> +    builtin_define_type_max ("__INT_FAST32_MAX__", 
> int_fast32_type_node);
> +  if (int_fast64_type_node)
> +    builtin_define_type_max ("__INT_FAST64_MAX__", 
> int_fast64_type_node);
> +  if (uint_fast8_type_node)
> +    builtin_define_type_max ("__UINT_FAST8_MAX__", 
> uint_fast8_type_node);
> +  if (uint_fast16_type_node)
> +    builtin_define_type_max ("__UINT_FAST16_MAX__", 
> uint_fast16_type_node);
> +  if (uint_fast32_type_node)
> +    builtin_define_type_max ("__UINT_FAST32_MAX__", 
> uint_fast32_type_node);
> +  if (uint_fast64_type_node)
> +    builtin_define_type_max ("__UINT_FAST64_MAX__", 
> uint_fast64_type_node);
> +  if (intptr_type_node)
> +    builtin_define_type_max ("__INTPTR_MAX__", intptr_type_node);
> +  if (uintptr_type_node)
> +    builtin_define_type_max ("__UINTPTR_MAX__", uintptr_type_node);
>  }
>  
>  /* Adjust the optimization macros when a #pragma GCC 
> optimization is done to
> @@ -517,17 +591,21 @@
>    if (USING_SJLJ_EXCEPTIONS)
>      cpp_define (pfile, "__USING_SJLJ_EXCEPTIONS__");
>  
> -  /* limits.h needs to know these.  */
> -  builtin_define_type_max ("__SCHAR_MAX__", 
> signed_char_type_node, 0);
> -  builtin_define_type_max ("__SHRT_MAX__", 
> short_integer_type_node, 0);
> -  builtin_define_type_max ("__INT_MAX__", integer_type_node, 0);
> -  builtin_define_type_max ("__LONG_MAX__", 
> long_integer_type_node, 1);
> -  builtin_define_type_max ("__LONG_LONG_MAX__", 
> long_long_integer_type_node, 2);
> -  builtin_define_type_max ("__WCHAR_MAX__", wchar_type_node, 0);
> +  /* limits.h and stdint.h need to know these.  */
> +  builtin_define_type_max ("__SCHAR_MAX__", signed_char_type_node);
> +  builtin_define_type_max ("__SHRT_MAX__", short_integer_type_node);
> +  builtin_define_type_max ("__INT_MAX__", integer_type_node);
> +  builtin_define_type_max ("__LONG_MAX__", long_integer_type_node);
> +  builtin_define_type_max ("__LONG_LONG_MAX__", 
> long_long_integer_type_node);
> +  builtin_define_type_minmax ("__WCHAR_MIN__", "__WCHAR_MAX__",
> +                           underlying_wchar_type_node);
> +  builtin_define_type_minmax ("__WINT_MIN__", 
> "__WINT_MAX__", wint_type_node);
> +  builtin_define_type_max ("__PTRDIFF_MAX__", ptrdiff_type_node);
> +  builtin_define_type_max ("__SIZE_MAX__", size_type_node);
>  
>    builtin_define_type_precision ("__CHAR_BIT__", char_type_node);
>  
> -  /* stdint.h (eventually) and the testsuite need to know these.  */
> +  /* stdint.h and the testsuite need to know these.  */
>    builtin_define_stdint_macros ();
>  
>    /* float.h needs to know these.  */
> @@ -887,13 +965,81 @@
>    cpp_define (parse_in, buf1);
>  }
>  
> -/* Define MAX for TYPE based on the precision of the type.  
> IS_LONG is
> -   1 for type "long" and 2 for "long long".  We have to handle
> -   unsigned types, since wchar_t might be unsigned.  */
> +/* Return a string constant for the suffix for a value of type TYPE
> +   promoted according to the integer promotions.  The type 
> must be one
> +   of the standard integer type nodes.  */
>  
> +static const char *
> +type_suffix (tree type)
> +{
> +  static const char *const suffixes[] = { "", "U", "L", 
> "UL", "LL", "ULL" };
> +  int unsigned_suffix;
> +  int is_long;
> +
> +  if (type == long_long_integer_type_node
> +      || type == long_long_unsigned_type_node)
> +    is_long = 2;
> +  else if (type == long_integer_type_node
> +        || type == long_unsigned_type_node)
> +    is_long = 1;
> +  else if (type == integer_type_node
> +        || type == unsigned_type_node
> +        || type == short_integer_type_node
> +        || type == short_unsigned_type_node
> +        || type == signed_char_type_node
> +        || type == unsigned_char_type_node
> +        /* ??? "char" is not a signed or unsigned integer type and
> +           so is not permitted for the standard typedefs, but some
> +           systems use it anyway.  */
> +        || type == char_type_node)
> +    is_long = 0;
> +  else
> +    gcc_unreachable ();
> +
> +  unsigned_suffix = TYPE_UNSIGNED (type);
> +  if (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
> +    unsigned_suffix = 0;
> +  return suffixes[is_long * 2 + unsigned_suffix];
> +}
> +
> +/* Define MACRO as a <stdint.h> constant-suffix macro for TYPE.  */
>  static void
> -builtin_define_type_max (const char *macro, tree type, int is_long)
> +builtin_define_constants (const char *macro, tree type)
>  {
> +  const char *suffix;
> +  char *buf;
> +
> +  suffix = type_suffix (type);
> +
> +  if (suffix[0] == 0)
> +    {
> +      buf = (char *) alloca (strlen (macro) + 6);
> +      sprintf (buf, "%s(c)=c", macro);
> +    }
> +  else
> +    {
> +      buf = (char *) alloca (strlen (macro) + 9 + strlen 
> (suffix) + 1);
> +      sprintf (buf, "%s(c)=c ## %s", macro, suffix);
> +    }
> +
> +  cpp_define (parse_in, buf);
> +}
> +
> +/* Define MAX for TYPE based on the precision of the type.  */
> +
> +static void
> +builtin_define_type_max (const char *macro, tree type)
> +{
> +  builtin_define_type_minmax (NULL, macro, type);
> +}
> +
> +/* Define MIN_MACRO (if not NULL) and MAX_MACRO for TYPE based on the
> +   precision of the type.  */
> +
> +static void
> +builtin_define_type_minmax (const char *min_macro, const 
> char *max_macro,
> +                         tree type)
> +{
>    static const char *const values[]
>      = { "127", "255",
>       "32767", "65535",
> @@ -901,7 +1047,6 @@
>       "9223372036854775807", "18446744073709551615",
>       "170141183460469231731687303715884105727",
>       "340282366920938463463374607431768211455" };
> -  static const char *const suffixes[] = { "", "U", "L", 
> "UL", "LL", "ULL" };
>  
>    const char *value, *suffix;
>    char *buf;
> @@ -921,11 +1066,27 @@
>      }
>  
>    value = values[idx + TYPE_UNSIGNED (type)];
> -  suffix = suffixes[is_long * 2 + TYPE_UNSIGNED (type)];
> +  suffix = type_suffix (type);
>  
> -  buf = (char *) alloca (strlen (macro) + 1 + strlen (value)
> +  buf = (char *) alloca (strlen (max_macro) + 1 + strlen (value)
>                           + strlen (suffix) + 1);
> -  sprintf (buf, "%s=%s%s", macro, value, suffix);
> +  sprintf (buf, "%s=%s%s", max_macro, value, suffix);
>  
>    cpp_define (parse_in, buf);
> +
> +  if (min_macro)
> +    {
> +      if (TYPE_UNSIGNED (type))
> +     {
> +       buf = (char *) alloca (strlen (min_macro) + 2 + 
> strlen (suffix) + 1);
> +       sprintf (buf, "%s=0%s", min_macro, suffix);
> +     }
> +      else
> +     {
> +       buf = (char *) alloca (strlen (min_macro) + 3
> +                              + strlen (max_macro) + 6);
> +       sprintf (buf, "%s=(-%s - 1)", min_macro, max_macro);
> +     }
> +      cpp_define (parse_in, buf);
> +    }
>  }
> Index: gcc/testsuite/gcc.dg/c99-stdint-6.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/c99-stdint-6.c       (revision 0)
> +++ gcc/testsuite/gcc.dg/c99-stdint-6.c       (revision 0)
> @@ -0,0 +1,67 @@
> +/* Verify that GCC's internal notions of types in <stdint.h> agree
> +   with any system <inttypes.h> header.  */
> +/* { dg-do compile { target inttypes_types } } */
> +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
> +/* { dg-options "-std=gnu99 -pedantic-errors 
> -DNO_FAST_TYPES" { target *-*-solaris2.[789]* } } */
> +
> +#include <inttypes.h>
> +#include <signal.h>
> +
> +#define CHECK_TYPES(TYPE1, TYPE2) \
> +  do { TYPE1 a; TYPE2 *b = &a; TYPE2 c; TYPE1 *d = &c; } while (0)
> +
> +void
> +check_types (void)
> +{
> +#ifdef __INT8_TYPE__
> +  CHECK_TYPES(__INT8_TYPE__, int8_t);
> +#endif
> +#ifdef __INT16_TYPE__
> +  CHECK_TYPES(__INT16_TYPE__, int16_t);
> +#endif
> +#ifdef __INT32_TYPE__
> +  CHECK_TYPES(__INT32_TYPE__, int32_t);
> +#endif
> +#ifdef __INT64_TYPE__
> +  CHECK_TYPES(__INT64_TYPE__, int64_t);
> +#endif
> +#ifdef __UINT8_TYPE__
> +  CHECK_TYPES(__UINT8_TYPE__, uint8_t);
> +#endif
> +#ifdef __UINT16_TYPE__
> +  CHECK_TYPES(__UINT16_TYPE__, uint16_t);
> +#endif
> +#ifdef __UINT32_TYPE__
> +  CHECK_TYPES(__UINT32_TYPE__, uint32_t);
> +#endif
> +#ifdef __UINT64_TYPE__
> +  CHECK_TYPES(__UINT64_TYPE__, uint64_t);
> +#endif
> +  CHECK_TYPES(__INT_LEAST8_TYPE__, int_least8_t);
> +  CHECK_TYPES(__INT_LEAST16_TYPE__, int_least16_t);
> +  CHECK_TYPES(__INT_LEAST32_TYPE__, int_least32_t);
> +  CHECK_TYPES(__INT_LEAST64_TYPE__, int_least64_t);
> +  CHECK_TYPES(__UINT_LEAST8_TYPE__, uint_least8_t);
> +  CHECK_TYPES(__UINT_LEAST16_TYPE__, uint_least16_t);
> +  CHECK_TYPES(__UINT_LEAST32_TYPE__, uint_least32_t);
> +  CHECK_TYPES(__UINT_LEAST64_TYPE__, uint_least64_t);
> +#ifndef NO_FAST_TYPES
> +  CHECK_TYPES(__INT_FAST8_TYPE__, int_fast8_t);
> +  CHECK_TYPES(__INT_FAST16_TYPE__, int_fast16_t);
> +  CHECK_TYPES(__INT_FAST32_TYPE__, int_fast32_t);
> +  CHECK_TYPES(__INT_FAST64_TYPE__, int_fast64_t);
> +  CHECK_TYPES(__UINT_FAST8_TYPE__, uint_fast8_t);
> +  CHECK_TYPES(__UINT_FAST16_TYPE__, uint_fast16_t);
> +  CHECK_TYPES(__UINT_FAST32_TYPE__, uint_fast32_t);
> +  CHECK_TYPES(__UINT_FAST64_TYPE__, uint_fast64_t);
> +#endif
> +#ifdef __INTPTR_TYPE__
> +  CHECK_TYPES(__INTPTR_TYPE__, intptr_t);
> +#endif
> +#ifdef __UINTPTR_TYPE__
> +  CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
> +#endif
> +  CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
> +  CHECK_TYPES(__UINTMAX_TYPE__, uintmax_t);
> +  CHECK_TYPES(__SIG_ATOMIC_TYPE__, sig_atomic_t);
> +}
> Index: gcc/testsuite/gcc.dg/c99-stdint-1.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/c99-stdint-1.c       (revision 0)
> +++ gcc/testsuite/gcc.dg/c99-stdint-1.c       (revision 0)
> @@ -0,0 +1,265 @@
> +/* Verify that <stdint.h> is present and follows the C99 
> requirements.
> +   If this test fails because of the header being missing on a
> +   particular target, this indicates GCC has not been correctly
> +   configured regarding what version of <stdint.h> to install or what
> +   the <stdint.h> types are on that target.  If GCC is wrapping a
> +   system copy of the header and some tests fail because of bugs in
> +   that copy, they should be fixed with fixincludes (and the bugs
> +   reported to maintainer of that copy if still present in the latest
> +   version).  */
> +/* { dg-do compile } */
> +/* { dg-options "-std=iso9899:1999 -pedantic-errors -fhosted" } */
> +
> +#include <limits.h>
> +#include <stdint.h>
> +/* This and the later SIG_ATOMIC_* tests should be appropriately
> +   conditioned for any freestanding targets with no <signal.h>.  */
> +#include <signal.h>
> +
> +/* Note that some of these conditions assume two's complement and no
> +   padding bits; GCC only supports two's complement, and no supported
> +   target has padding bits in any integer type of the standard
> +   widths.  */
> +#define CHECK_SIGNED(TYPE) \
> +  do { TYPE a; int b[(TYPE)-1 < 0 ? 1 : -1]; } while (0)
> +#define CHECK_UNSIGNED(TYPE) \
> +  do { TYPE a; int b[(TYPE)-1 < 0 ? -1 : 1]; } while (0)
> +#define CHECK_WIDTH_EQUALS(TYPE, WIDTH) \
> +  do { int a[sizeof(TYPE) * CHAR_BIT == (WIDTH) ? 1 : -1]; } 
> while (0)
> +#define CHECK_WIDTH_AT_LEAST(TYPE, WIDTH) \
> +  do { int a[sizeof(TYPE) * CHAR_BIT >= (WIDTH) ? 1 : -1]; } 
> while (0)
> +#define CHECK_WIDTH_ORDER(TYPE1, TYPE2) \
> +  do { int a[sizeof(TYPE2) >= sizeof(TYPE1) ? 1 : -1]; } while (0)
> +#define CHECK_EXPR_TYPE(TYPE, EXPR) \
> +  do { __typeof__(EXPR) a; __typeof__((TYPE)0 + 0) *b = &a; 
> } while (0)
> +#define UNSIGNED_MAX_COND(TYPE, EXPR) \
> +  ((EXPR) == (TYPE)-1)
> +#define SIGNED_MIN_MAX_COND(TYPE, MIN, MAX)                  
>       \
> +  ((MIN) == -(MAX)-1                                         
>       \
> +   && ((MAX) & 1)                                            
>       \
> +   && ((((MAX) >> 1) + 1) >> (sizeof(TYPE) * CHAR_BIT - 2)) == 1)
> +#define MIN_MAX_COND(TYPE, MIN, MAX)                 \
> +  ((TYPE)-1 < 0                                              \
> +   ? SIGNED_MIN_MAX_COND(TYPE, (MIN), (MAX))         \
> +   : ((MIN) == 0 && UNSIGNED_MAX_COND(TYPE, (MAX))))
> +#define CHECK_SIGNED_LIMITS(TYPE, MIN, MAX)                  
>       \
> +  CHECK_SIGNED(TYPE);                                        
>               \
> +  CHECK_EXPR_TYPE(TYPE, (MIN));                              
>               \
> +  CHECK_EXPR_TYPE(TYPE, (MAX));                              
>               \
> +  do { int a[SIGNED_MIN_MAX_COND(TYPE, (MIN), (MAX)) ? 1 : 
> -1]; } while (0)
> +#define CHECK_SIGNED_LIMITS_2(TYPE, MIN, MAX, MINBD, MAXBD)  \
> +  CHECK_SIGNED(TYPE);                                        
>       \
> +  CHECK_EXPR_TYPE(TYPE, (MIN));                              
>       \
> +  CHECK_EXPR_TYPE(TYPE, (MAX));                              
>       \
> +  do { int a[(SIGNED_MIN_MAX_COND(TYPE, (MIN), (MAX))        
>       \
> +           && (MIN) <= (MINBD)                               \
> +           && (MAX) >= (MAXBD)) ? 1 : -1]; } while (0)
> +#define CHECK_UNSIGNED_LIMITS(TYPE, MAX)                     
>       \
> +  CHECK_UNSIGNED(TYPE);                                      
>               \
> +  CHECK_EXPR_TYPE(TYPE, (MAX));                              
>               \
> +  do { int a[UNSIGNED_MAX_COND(TYPE, (MAX)) ? 1 : -1]; } while (0)
> +#define CHECK_UNSIGNED_LIMITS_2(TYPE, MAX, MAXBD)            \
> +  CHECK_UNSIGNED(TYPE);                                      
>       \
> +  CHECK_EXPR_TYPE(TYPE, (MAX));                              
>       \
> +  do { int a[(UNSIGNED_MAX_COND(TYPE, (MAX))                 \
> +           && (MAX) >= (MAXBD)) ? 1 : -1]; } while (0)
> +#define CHECK_LIMITS_2(TYPE, MIN, MAX, SMINBD, SMAXBD, 
> UMAXBD)       \
> +  do { int a[(MIN_MAX_COND(TYPE, (MIN), (MAX))               
>       \
> +           && ((TYPE)-1 < 0                                  \
> +               ? ((MIN) <= (SMINBD) && (MAX) >= (SMAXBD))    \
> +               : (MAX) >= (UMAXBD))) ? 1 : -1]; } while (0)
> +#define CHECK_CONSTS(TYPE, MACRO)                            \
> +  CHECK_EXPR_TYPE(TYPE, MACRO(01));                          \
> +  CHECK_EXPR_TYPE(TYPE, MACRO(2));                           \
> +  CHECK_EXPR_TYPE(TYPE, MACRO(0x3));                         \
> +  do { int a[(MACRO(12) == 12                                
>       \
> +           && MACRO(012) == 012                              \
> +           && MACRO(0x12) == 0x12) ? 1 : -1]; } while (0);
> +
> +void
> +test_exact (void)
> +{
> +#ifdef INT8_MIN
> +  CHECK_WIDTH_EQUALS(int8_t, 8);
> +  CHECK_SIGNED_LIMITS(int8_t, INT8_MIN, INT8_MAX);
> +#else
> +  CHECK_WIDTH_AT_LEAST(int_least8_t, 9);
> +#endif
> +#ifdef INT16_MIN
> +  CHECK_WIDTH_EQUALS(int16_t, 16);
> +  CHECK_SIGNED_LIMITS(int16_t, INT16_MIN, INT16_MAX);
> +#else
> +  CHECK_WIDTH_AT_LEAST(int_least8_t, 17);
> +#endif
> +#ifdef INT32_MIN
> +  CHECK_WIDTH_EQUALS(int32_t, 32);
> +  CHECK_SIGNED_LIMITS(int32_t, INT32_MIN, INT32_MAX);
> +#else
> +  CHECK_WIDTH_AT_LEAST(int_least8_t, 33);
> +#endif
> +#ifdef INT64_MIN
> +  CHECK_WIDTH_EQUALS(int64_t, 64);
> +  CHECK_SIGNED_LIMITS(int64_t, INT64_MIN, INT64_MAX);
> +#else
> +  CHECK_WIDTH_AT_LEAST(int_least8_t, 65);
> +#endif
> +#ifdef UINT8_MAX
> +  CHECK_WIDTH_EQUALS(uint8_t, 8);
> +  CHECK_UNSIGNED_LIMITS(uint8_t, UINT8_MAX);
> +#else
> +  CHECK_WIDTH_AT_LEAST(uint_least8_t, 9);
> +#endif
> +#ifdef UINT16_MAX
> +  CHECK_WIDTH_EQUALS(uint16_t, 16);
> +  CHECK_UNSIGNED_LIMITS(uint16_t, UINT16_MAX);
> +#else
> +  CHECK_WIDTH_AT_LEAST(uint_least8_t, 17);
> +#endif
> +#ifdef UINT32_MAX
> +  CHECK_WIDTH_EQUALS(uint32_t, 32);
> +  CHECK_UNSIGNED_LIMITS(uint32_t, UINT32_MAX);
> +#else
> +  CHECK_WIDTH_AT_LEAST(uint_least8_t, 33);
> +#endif
> +#ifdef UINT64_MAX
> +  CHECK_WIDTH_EQUALS(uint64_t, 64);
> +  CHECK_UNSIGNED_LIMITS(uint64_t, UINT64_MAX);
> +#else
> +  CHECK_WIDTH_AT_LEAST(uint_least8_t, 65);
> +#endif
> +}
> +
> +void
> +test_least (void)
> +{
> +  CHECK_WIDTH_AT_LEAST(int_least8_t, 8);
> +  CHECK_WIDTH_ORDER(int_least8_t, int_fast8_t);
> +  CHECK_SIGNED_LIMITS(int_least8_t, INT_LEAST8_MIN, INT_LEAST8_MAX);
> +  CHECK_WIDTH_AT_LEAST(int_least16_t, 16);
> +  CHECK_WIDTH_ORDER(int_least16_t, int_fast16_t);
> +  CHECK_SIGNED_LIMITS(int_least16_t, INT_LEAST16_MIN, 
> INT_LEAST16_MAX);
> +  CHECK_WIDTH_AT_LEAST(int_least32_t, 32);
> +  CHECK_WIDTH_ORDER(int_least32_t, int_fast32_t);
> +  CHECK_SIGNED_LIMITS(int_least32_t, INT_LEAST32_MIN, 
> INT_LEAST32_MAX);
> +  CHECK_WIDTH_AT_LEAST(int_least64_t, 64);
> +  CHECK_WIDTH_ORDER(int_least64_t, int_fast64_t);
> +  CHECK_SIGNED_LIMITS(int_least64_t, INT_LEAST64_MIN, 
> INT_LEAST64_MAX);
> +  CHECK_WIDTH_AT_LEAST(uint_least8_t, 8);
> +  CHECK_WIDTH_ORDER(uint_least8_t, uint_fast8_t);
> +  CHECK_UNSIGNED_LIMITS(uint_least8_t, UINT_LEAST8_MAX);
> +  CHECK_WIDTH_AT_LEAST(uint_least16_t, 16);
> +  CHECK_WIDTH_ORDER(uint_least16_t, uint_fast16_t);
> +  CHECK_UNSIGNED_LIMITS(uint_least16_t, UINT_LEAST16_MAX);
> +  CHECK_WIDTH_AT_LEAST(uint_least32_t, 32);
> +  CHECK_WIDTH_ORDER(uint_least32_t, uint_fast32_t);
> +  CHECK_UNSIGNED_LIMITS(uint_least32_t, UINT_LEAST32_MAX);
> +  CHECK_WIDTH_AT_LEAST(uint_least64_t, 64);
> +  CHECK_WIDTH_ORDER(uint_least64_t, uint_fast64_t);
> +  CHECK_UNSIGNED_LIMITS(uint_least64_t, UINT_LEAST64_MAX);
> +}
> +
> +void
> +test_fast (void)
> +{
> +  CHECK_WIDTH_AT_LEAST(int_fast8_t, 8);
> +  CHECK_SIGNED_LIMITS(int_fast8_t, INT_FAST8_MIN, INT_FAST8_MAX);
> +  CHECK_WIDTH_AT_LEAST(int_fast16_t, 16);
> +  CHECK_SIGNED_LIMITS(int_fast16_t, INT_FAST16_MIN, INT_FAST16_MAX);
> +  CHECK_WIDTH_AT_LEAST(int_fast32_t, 32);
> +  CHECK_SIGNED_LIMITS(int_fast32_t, INT_FAST32_MIN, INT_FAST32_MAX);
> +  CHECK_WIDTH_AT_LEAST(int_fast64_t, 64);
> +  CHECK_SIGNED_LIMITS(int_fast64_t, INT_FAST64_MIN, INT_FAST64_MAX);
> +  CHECK_WIDTH_AT_LEAST(uint_fast8_t, 8);
> +  CHECK_UNSIGNED_LIMITS(uint_fast8_t, UINT_FAST8_MAX);
> +  CHECK_WIDTH_AT_LEAST(uint_fast16_t, 16);
> +  CHECK_UNSIGNED_LIMITS(uint_fast16_t, UINT_FAST16_MAX);
> +  CHECK_WIDTH_AT_LEAST(uint_fast32_t, 32);
> +  CHECK_UNSIGNED_LIMITS(uint_fast32_t, UINT_FAST32_MAX);
> +  CHECK_WIDTH_AT_LEAST(uint_fast64_t, 64);
> +  CHECK_UNSIGNED_LIMITS(uint_fast64_t, UINT_FAST64_MAX);
> +}
> +
> +void
> +test_ptr (void)
> +{
> +#ifdef INTPTR_MIN
> +  CHECK_SIGNED_LIMITS_2(intptr_t, INTPTR_MIN, INTPTR_MAX, 
> -0x7fff, 0x7fff);
> +#endif
> +#ifdef UINTPTR_MAX
> +  CHECK_UNSIGNED_LIMITS_2(uintptr_t, UINTPTR_MAX, 0xffffU);
> +#endif
> +}
> +
> +void
> +test_max (void)
> +{
> +  CHECK_WIDTH_AT_LEAST(intmax_t, 64);
> +  CHECK_WIDTH_ORDER(long long, intmax_t);
> +  CHECK_WIDTH_ORDER(int_fast8_t, intmax_t);
> +  CHECK_WIDTH_ORDER(int_fast16_t, intmax_t);
> +  CHECK_WIDTH_ORDER(int_fast32_t, intmax_t);
> +  CHECK_WIDTH_ORDER(int_fast64_t, intmax_t);
> +  CHECK_SIGNED_LIMITS(intmax_t, INTMAX_MIN, INTMAX_MAX);
> +  CHECK_WIDTH_AT_LEAST(uintmax_t, 64);
> +  CHECK_WIDTH_ORDER(unsigned long long, uintmax_t);
> +  CHECK_WIDTH_ORDER(uint_fast8_t, uintmax_t);
> +  CHECK_WIDTH_ORDER(uint_fast16_t, uintmax_t);
> +  CHECK_WIDTH_ORDER(uint_fast32_t, uintmax_t);
> +  CHECK_WIDTH_ORDER(uint_fast64_t, uintmax_t);
> +  CHECK_UNSIGNED_LIMITS(uintmax_t, UINTMAX_MAX);
> +}
> +
> +void
> +test_misc_limits (void)
> +{
> +  CHECK_SIGNED_LIMITS_2(__PTRDIFF_TYPE__, PTRDIFF_MIN, 
> PTRDIFF_MAX, -65535L, 65535L);
> +  CHECK_LIMITS_2(sig_atomic_t, SIG_ATOMIC_MIN, 
> SIG_ATOMIC_MAX, -127, 127, 255);
> +  CHECK_UNSIGNED_LIMITS_2(__SIZE_TYPE__, SIZE_MAX, 65535U);
> +  CHECK_LIMITS_2(__WCHAR_TYPE__, WCHAR_MIN, WCHAR_MAX, -127, 
> 127, 255);
> +  CHECK_LIMITS_2(__WINT_TYPE__, WINT_MIN, WINT_MAX, -32767, 
> 32767, 65535);
> +}
> +
> +void
> +test_constants (void)
> +{
> +  CHECK_CONSTS(int_least8_t, INT8_C);
> +  CHECK_CONSTS(int_least16_t, INT16_C);
> +  CHECK_CONSTS(int_least32_t, INT32_C);
> +  CHECK_CONSTS(int_least64_t, INT64_C);
> +  CHECK_CONSTS(intmax_t, INTMAX_C);
> +  CHECK_CONSTS(uint_least8_t, UINT8_C);
> +  CHECK_CONSTS(uint_least16_t, UINT16_C);
> +  CHECK_CONSTS(uint_least32_t, UINT32_C);
> +  CHECK_CONSTS(uint_least64_t, UINT64_C);
> +  CHECK_CONSTS(uintmax_t, UINTMAX_C);
> +#if INT8_C(12) != 12
> +#error "INT8_C not usable in #if"
> +#endif
> +#if INT16_C(12) != 12
> +#error "INT16_C not usable in #if"
> +#endif
> +#if INT32_C(12) != 12
> +#error "INT32_C not usable in #if"
> +#endif
> +#if INT64_C(12) != 12
> +#error "INT64_C not usable in #if"
> +#endif
> +#if INTMAX_C(12) != 12
> +#error "INTMAX_C not usable in #if"
> +#endif
> +#if UINT8_C(12) != 12
> +#error "UINT8_C not usable in #if"
> +#endif
> +#if UINT16_C(12) != 12
> +#error "UINT16_C not usable in #if"
> +#endif
> +#if UINT32_C(12) != 12
> +#error "UINT32_C not usable in #if"
> +#endif
> +#if UINT64_C(12) != 12
> +#error "UINT64_C not usable in #if"
> +#endif
> +#if UINTMAX_C(12) != 12
> +#error "UINTMAX_C not usable in #if"
> +#endif
> +}
> Index: gcc/testsuite/gcc.dg/c99-stdint-3.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/c99-stdint-3.c       (revision 0)
> +++ gcc/testsuite/gcc.dg/c99-stdint-3.c       (revision 0)
> @@ -0,0 +1,39 @@
> +/* Verify that pairs of types in <stdint.h> are corresponding types
> +   (requires no pointer sign warnings, so separate from
> +   c99-stdint-1.c).  */
> +/* { dg-do compile } */
> +/* { dg-options "-std=iso9899:1999 -fhosted" } */
> +
> +#include <stdint.h>
> +
> +#define CHECK_CORRESPONDING(TYPE1, TYPE2) \
> +  do { TYPE1 a; TYPE2 *b = &a; TYPE2 c; TYPE1 *d = &c; } while (0)
> +
> +void
> +check_corresponding (void)
> +{
> +#if defined(INT8_MAX) && defined(UINT8_MAX)
> +  CHECK_CORRESPONDING(int8_t, uint8_t);
> +#endif
> +#if defined(INT16_MAX) && defined(UINT16_MAX)
> +  CHECK_CORRESPONDING(int16_t, uint16_t);
> +#endif
> +#if defined(INT32_MAX) && defined(UINT32_MAX)
> +  CHECK_CORRESPONDING(int32_t, uint32_t);
> +#endif
> +#if defined(INT64_MAX) && defined(UINT64_MAX)
> +  CHECK_CORRESPONDING(int64_t, uint64_t);
> +#endif
> +  CHECK_CORRESPONDING(int_least8_t, uint_least8_t);
> +  CHECK_CORRESPONDING(int_least16_t, uint_least16_t);
> +  CHECK_CORRESPONDING(int_least32_t, uint_least32_t);
> +  CHECK_CORRESPONDING(int_least64_t, uint_least64_t);
> +  CHECK_CORRESPONDING(int_fast8_t, uint_fast8_t);
> +  CHECK_CORRESPONDING(int_fast16_t, uint_fast16_t);
> +  CHECK_CORRESPONDING(int_fast32_t, uint_fast32_t);
> +  CHECK_CORRESPONDING(int_fast64_t, uint_fast64_t);
> +#if defined(INTPTR_MAX) && defined(UINTPTR_MAX)
> +  CHECK_CORRESPONDING(intptr_t, uintptr_t);
> +#endif
> +  CHECK_CORRESPONDING(intmax_t, uintmax_t);
> +}
> Index: gcc/testsuite/gcc.dg/c99-stdint-5.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/c99-stdint-5.c       (revision 0)
> +++ gcc/testsuite/gcc.dg/c99-stdint-5.c       (revision 0)
> @@ -0,0 +1,65 @@
> +/* Verify that GCC's internal notions of types in <stdint.h> agree
> +   with any system header (which GCC will use by default for hosted
> +   compilations).  */
> +/* { dg-do compile } */
> +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
> +
> +#include <stdint.h>
> +#include <signal.h>
> +
> +#define CHECK_TYPES(TYPE1, TYPE2) \
> +  do { TYPE1 a; TYPE2 *b = &a; TYPE2 c; TYPE1 *d = &c; } while (0)
> +
> +void
> +check_types (void)
> +{
> +#ifdef __INT8_TYPE__
> +  CHECK_TYPES(__INT8_TYPE__, int8_t);
> +#endif
> +#ifdef __INT16_TYPE__
> +  CHECK_TYPES(__INT16_TYPE__, int16_t);
> +#endif
> +#ifdef __INT32_TYPE__
> +  CHECK_TYPES(__INT32_TYPE__, int32_t);
> +#endif
> +#ifdef __INT64_TYPE__
> +  CHECK_TYPES(__INT64_TYPE__, int64_t);
> +#endif
> +#ifdef __UINT8_TYPE__
> +  CHECK_TYPES(__UINT8_TYPE__, uint8_t);
> +#endif
> +#ifdef __UINT16_TYPE__
> +  CHECK_TYPES(__UINT16_TYPE__, uint16_t);
> +#endif
> +#ifdef __UINT32_TYPE__
> +  CHECK_TYPES(__UINT32_TYPE__, uint32_t);
> +#endif
> +#ifdef __UINT64_TYPE__
> +  CHECK_TYPES(__UINT64_TYPE__, uint64_t);
> +#endif
> +  CHECK_TYPES(__INT_LEAST8_TYPE__, int_least8_t);
> +  CHECK_TYPES(__INT_LEAST16_TYPE__, int_least16_t);
> +  CHECK_TYPES(__INT_LEAST32_TYPE__, int_least32_t);
> +  CHECK_TYPES(__INT_LEAST64_TYPE__, int_least64_t);
> +  CHECK_TYPES(__UINT_LEAST8_TYPE__, uint_least8_t);
> +  CHECK_TYPES(__UINT_LEAST16_TYPE__, uint_least16_t);
> +  CHECK_TYPES(__UINT_LEAST32_TYPE__, uint_least32_t);
> +  CHECK_TYPES(__UINT_LEAST64_TYPE__, uint_least64_t);
> +  CHECK_TYPES(__INT_FAST8_TYPE__, int_fast8_t);
> +  CHECK_TYPES(__INT_FAST16_TYPE__, int_fast16_t);
> +  CHECK_TYPES(__INT_FAST32_TYPE__, int_fast32_t);
> +  CHECK_TYPES(__INT_FAST64_TYPE__, int_fast64_t);
> +  CHECK_TYPES(__UINT_FAST8_TYPE__, uint_fast8_t);
> +  CHECK_TYPES(__UINT_FAST16_TYPE__, uint_fast16_t);
> +  CHECK_TYPES(__UINT_FAST32_TYPE__, uint_fast32_t);
> +  CHECK_TYPES(__UINT_FAST64_TYPE__, uint_fast64_t);
> +#ifdef __INTPTR_TYPE__
> +  CHECK_TYPES(__INTPTR_TYPE__, intptr_t);
> +#endif
> +#ifdef __UINTPTR_TYPE__
> +  CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
> +#endif
> +  CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
> +  CHECK_TYPES(__UINTMAX_TYPE__, uintmax_t);
> +  CHECK_TYPES(__SIG_ATOMIC_TYPE__, sig_atomic_t);
> +}
> Index: gcc/testsuite/gcc.dg/c99-stdint-2.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/c99-stdint-2.c       (revision 0)
> +++ gcc/testsuite/gcc.dg/c99-stdint-2.c       (revision 0)
> @@ -0,0 +1,8 @@
> +/* Verify that <stdint.h> is present and follows the C99 
> requirements.
> +   Freestanding version.  */
> +/* { dg-do compile } */
> +/* { dg-options "-std=iso9899:1999 -pedantic-errors 
> -ffreestanding" } */
> +
> +/* The test is that there are no diagnostics, so just include the
> +   hosted version.  */
> +#include "c99-stdint-1.c"
> Index: gcc/testsuite/gcc.dg/c99-stdint-4.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/c99-stdint-4.c       (revision 0)
> +++ gcc/testsuite/gcc.dg/c99-stdint-4.c       (revision 0)
> @@ -0,0 +1,8 @@
> +/* Verify that pairs of types in <stdint.h> are corresponding types.
> +   Freestanding version.  */
> +/* { dg-do compile } */
> +/* { dg-options "-std=iso9899:1999 -ffreestanding" } */
> +
> +/* The test is that there are no diagnostics, so just include the
> +   hosted version.  */
> +#include "c99-stdint-3.c"
> Index: gcc/testsuite/lib/target-supports.exp
> ===================================================================
> --- gcc/testsuite/lib/target-supports.exp     (revision 141680)
> +++ gcc/testsuite/lib/target-supports.exp     (working copy)
> @@ -2437,7 +2437,8 @@
>  }
>  
>  # Return 1 if target has the basic signed and unsigned types in
> -# <stdint.h>, 0 otherwise.
> +# <stdint.h>, 0 otherwise.  This will be obsolete when GCC ensures a
> +# working <stdint.h> for all targets.
>  
>  proc check_effective_target_stdint_types { } {
>      return [check_no_compiler_messages stdint_types assembly {
> @@ -2447,6 +2448,19 @@
>      }]
>  }
>  
> +# Return 1 if target has the basic signed and unsigned types in
> +# <inttypes.h>, 0 otherwise.  This is for tests that GCC's notions of
> +# these types agree with those in the header, as some systems have
> +# only <inttypes.h>.
> +
> +proc check_effective_target_inttypes_types { } {
> +    return [check_no_compiler_messages inttypes_types assembly {
> +     #include <inttypes.h>
> +     int8_t a; int16_t b; int32_t c; int64_t d;
> +     uint8_t e; uint16_t f; uint32_t g; uint64_t h;
> +    }]
> +}
> +
>  # Return 1 if programs are intended to be run on a simulator
>  # (i.e. slowly) rather than hardware (i.e. fast).
>  
> Index: gcc/configure.ac
> ===================================================================
> --- gcc/configure.ac  (revision 141680)
> +++ gcc/configure.ac  (working copy)
> @@ -3872,6 +3872,7 @@
>  AC_SUBST(xm_file_list)
>  AC_SUBST(xm_include_list)
>  AC_SUBST(xm_defines)
> +AC_SUBST(use_gcc_stdint)
>  AC_SUBST(c_target_objs)
>  AC_SUBST(cxx_target_objs)
>  AC_SUBST(fortran_target_objs)
> Index: gcc/c-common.c
> ===================================================================
> --- gcc/c-common.c    (revision 141680)
> +++ gcc/c-common.c    (working copy)
> @@ -67,11 +67,21 @@
>  #define PID_TYPE "int"
>  #endif
>  
> -#ifndef CHAR16_TYPE
> +/* If GCC knows the exact uint_least16_t and uint_least32_t 
> types from
> +   <stdint.h>, use them for char16_t and char32_t.  Otherwise, use
> +   these guesses; getting the wrong type of a given width will not
> +   affect C++ name mangling because in C++ these are distinct types
> +   not typedefs.  */
> +
> +#ifdef UINT_LEAST16_TYPE
> +#define CHAR16_TYPE UINT_LEAST16_TYPE
> +#else
>  #define CHAR16_TYPE "short unsigned int"
>  #endif
>  
> -#ifndef CHAR32_TYPE
> +#ifdef UINT_LEAST32_TYPE
> +#define CHAR32_TYPE UINT_LEAST32_TYPE
> +#else
>  #define CHAR32_TYPE "unsigned int"
>  #endif
>  
> @@ -107,6 +117,116 @@
>                       : "long long unsigned int"))
>  #endif
>  
> +/* There are no default definitions of these <stdint.h> types.  */
> +
> +#ifndef SIG_ATOMIC_TYPE
> +#define SIG_ATOMIC_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT8_TYPE
> +#define INT8_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT16_TYPE
> +#define INT16_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT32_TYPE
> +#define INT32_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT64_TYPE
> +#define INT64_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT8_TYPE
> +#define UINT8_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT16_TYPE
> +#define UINT16_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT32_TYPE
> +#define UINT32_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT64_TYPE
> +#define UINT64_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT_LEAST8_TYPE
> +#define INT_LEAST8_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT_LEAST16_TYPE
> +#define INT_LEAST16_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT_LEAST32_TYPE
> +#define INT_LEAST32_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT_LEAST64_TYPE
> +#define INT_LEAST64_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT_LEAST8_TYPE
> +#define UINT_LEAST8_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT_LEAST16_TYPE
> +#define UINT_LEAST16_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT_LEAST32_TYPE
> +#define UINT_LEAST32_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT_LEAST64_TYPE
> +#define UINT_LEAST64_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT_FAST8_TYPE
> +#define INT_FAST8_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT_FAST16_TYPE
> +#define INT_FAST16_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT_FAST32_TYPE
> +#define INT_FAST32_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INT_FAST64_TYPE
> +#define INT_FAST64_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT_FAST8_TYPE
> +#define UINT_FAST8_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT_FAST16_TYPE
> +#define UINT_FAST16_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT_FAST32_TYPE
> +#define UINT_FAST32_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINT_FAST64_TYPE
> +#define UINT_FAST64_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef INTPTR_TYPE
> +#define INTPTR_TYPE ((const char *) NULL)
> +#endif
> +
> +#ifndef UINTPTR_TYPE
> +#define UINTPTR_TYPE ((const char *) NULL)
> +#endif
> +
>  /* The following symbols are subsumed in the c_global_trees 
> array, and
>     listed here individually for documentation purposes.
>  
> @@ -129,8 +249,6 @@
>       tree unsigned_char_type_node;
>       tree signed_char_type_node;
>       tree wchar_type_node;
> -     tree signed_wchar_type_node;
> -     tree unsigned_wchar_type_node;
>  
>       tree char16_type_node;
>       tree char32_type_node;
> @@ -4359,6 +4477,7 @@
>    wchar_type_node = get_identifier (MODIFIED_WCHAR_TYPE);
>    wchar_type_node = TREE_TYPE (identifier_global_value 
> (wchar_type_node));
>    wchar_type_size = TYPE_PRECISION (wchar_type_node);
> +  underlying_wchar_type_node = wchar_type_node;
>    if (c_dialect_cxx ())
>      {
>        if (TYPE_UNSIGNED (wchar_type_node))
> @@ -4367,11 +4486,6 @@
>       wchar_type_node = make_signed_type (wchar_type_size);
>        record_builtin_type (RID_WCHAR, "wchar_t", wchar_type_node);
>      }
> -  else
> -    {
> -      signed_wchar_type_node = c_common_signed_type 
> (wchar_type_node);
> -      unsigned_wchar_type_node = c_common_unsigned_type 
> (wchar_type_node);
> -    }
>  
>    /* This is for wide string constants.  */
>    wchar_array_type_node
> @@ -4417,6 +4531,88 @@
>    uintmax_type_node =
>      TREE_TYPE (identifier_global_value (get_identifier 
> (UINTMAX_TYPE)));
>  
> +  if (SIG_ATOMIC_TYPE)
> +    sig_atomic_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (SIG_ATOMIC_TYPE)));
> +  if (INT8_TYPE)
> +    int8_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT8_TYPE)));
> +  if (INT16_TYPE)
> +    int16_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT16_TYPE)));
> +  if (INT32_TYPE)
> +    int32_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT32_TYPE)));
> +  if (INT64_TYPE)
> +    int64_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT64_TYPE)));
> +  if (UINT8_TYPE)
> +    uint8_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT8_TYPE)));
> +  if (UINT16_TYPE)
> +    uint16_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT16_TYPE)));
> +  if (UINT32_TYPE)
> +    c_uint32_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT32_TYPE)));
> +  if (UINT64_TYPE)
> +    c_uint64_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT64_TYPE)));
> +  if (INT_LEAST8_TYPE)
> +    int_least8_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT_LEAST8_TYPE)));
> +  if (INT_LEAST16_TYPE)
> +    int_least16_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT_LEAST16_TYPE)));
> +  if (INT_LEAST32_TYPE)
> +    int_least32_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT_LEAST32_TYPE)));
> +  if (INT_LEAST64_TYPE)
> +    int_least64_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT_LEAST64_TYPE)));
> +  if (UINT_LEAST8_TYPE)
> +    uint_least8_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT_LEAST8_TYPE)));
> +  if (UINT_LEAST16_TYPE)
> +    uint_least16_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT_LEAST16_TYPE)));
> +  if (UINT_LEAST32_TYPE)
> +    uint_least32_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT_LEAST32_TYPE)));
> +  if (UINT_LEAST64_TYPE)
> +    uint_least64_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT_LEAST64_TYPE)));
> +  if (INT_FAST8_TYPE)
> +    int_fast8_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT_FAST8_TYPE)));
> +  if (INT_FAST16_TYPE)
> +    int_fast16_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT_FAST16_TYPE)));
> +  if (INT_FAST32_TYPE)
> +    int_fast32_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT_FAST32_TYPE)));
> +  if (INT_FAST64_TYPE)
> +    int_fast64_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INT_FAST64_TYPE)));
> +  if (UINT_FAST8_TYPE)
> +    uint_fast8_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT_FAST8_TYPE)));
> +  if (UINT_FAST16_TYPE)
> +    uint_fast16_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT_FAST16_TYPE)));
> +  if (UINT_FAST32_TYPE)
> +    uint_fast32_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT_FAST32_TYPE)));
> +  if (UINT_FAST64_TYPE)
> +    uint_fast64_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINT_FAST64_TYPE)));
> +  if (INTPTR_TYPE)
> +    intptr_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (INTPTR_TYPE)));
> +  if (UINTPTR_TYPE)
> +    uintptr_type_node =
> +      TREE_TYPE (identifier_global_value (get_identifier 
> (UINTPTR_TYPE)));
> +
>    default_function_type = build_function_type 
> (integer_type_node, NULL_TREE);
>    ptrdiff_type_node
>      = TREE_TYPE (identifier_global_value (get_identifier 
> (PTRDIFF_TYPE)));
> @@ -5138,8 +5334,8 @@
>    return val;
>  }
>  > 
> -/* Built-in macros for stddef.h, that require macros defined in this
> -   file.  */
> +/* Built-in macros for stddef.h and stdint.h, that require macros
> +   defined in this file.  */
>  void
>  c_stddef_cpp_builtins(void)
>  {
> @@ -5151,6 +5347,60 @@
>    builtin_define_with_value ("__UINTMAX_TYPE__", UINTMAX_TYPE, 0);
>    builtin_define_with_value ("__CHAR16_TYPE__", CHAR16_TYPE, 0);
>    builtin_define_with_value ("__CHAR32_TYPE__", CHAR32_TYPE, 0);
> +  if (SIG_ATOMIC_TYPE)
> +    builtin_define_with_value ("__SIG_ATOMIC_TYPE__", 
> SIG_ATOMIC_TYPE, 0);
> +  if (INT8_TYPE)
> +    builtin_define_with_value ("__INT8_TYPE__", INT8_TYPE, 0);
> +  if (INT16_TYPE)
> +    builtin_define_with_value ("__INT16_TYPE__", INT16_TYPE, 0);
> +  if (INT32_TYPE)
> +    builtin_define_with_value ("__INT32_TYPE__", INT32_TYPE, 0);
> +  if (INT64_TYPE)
> +    builtin_define_with_value ("__INT64_TYPE__", INT64_TYPE, 0);
> +  if (UINT8_TYPE)
> +    builtin_define_with_value ("__UINT8_TYPE__", UINT8_TYPE, 0);
> +  if (UINT16_TYPE)
> +    builtin_define_with_value ("__UINT16_TYPE__", UINT16_TYPE, 0);
> +  if (UINT32_TYPE)
> +    builtin_define_with_value ("__UINT32_TYPE__", UINT32_TYPE, 0);
> +  if (UINT64_TYPE)
> +    builtin_define_with_value ("__UINT64_TYPE__", UINT64_TYPE, 0);
> +  if (INT_LEAST8_TYPE)
> +    builtin_define_with_value ("__INT_LEAST8_TYPE__", 
> INT_LEAST8_TYPE, 0);
> +  if (INT_LEAST16_TYPE)
> +    builtin_define_with_value ("__INT_LEAST16_TYPE__", 
> INT_LEAST16_TYPE, 0);
> +  if (INT_LEAST32_TYPE)
> +    builtin_define_with_value ("__INT_LEAST32_TYPE__", 
> INT_LEAST32_TYPE, 0);
> +  if (INT_LEAST64_TYPE)
> +    builtin_define_with_value ("__INT_LEAST64_TYPE__", 
> INT_LEAST64_TYPE, 0);
> +  if (UINT_LEAST8_TYPE)
> +    builtin_define_with_value ("__UINT_LEAST8_TYPE__", 
> UINT_LEAST8_TYPE, 0);
> +  if (UINT_LEAST16_TYPE)
> +    builtin_define_with_value ("__UINT_LEAST16_TYPE__", 
> UINT_LEAST16_TYPE, 0);
> +  if (UINT_LEAST32_TYPE)
> +    builtin_define_with_value ("__UINT_LEAST32_TYPE__", 
> UINT_LEAST32_TYPE, 0);
> +  if (UINT_LEAST64_TYPE)
> +    builtin_define_with_value ("__UINT_LEAST64_TYPE__", 
> UINT_LEAST64_TYPE, 0);
> +  if (INT_FAST8_TYPE)
> +    builtin_define_with_value ("__INT_FAST8_TYPE__", 
> INT_FAST8_TYPE, 0);
> +  if (INT_FAST16_TYPE)
> +    builtin_define_with_value ("__INT_FAST16_TYPE__", 
> INT_FAST16_TYPE, 0);
> +  if (INT_FAST32_TYPE)
> +    builtin_define_with_value ("__INT_FAST32_TYPE__", 
> INT_FAST32_TYPE, 0);
> +  if (INT_FAST64_TYPE)
> +    builtin_define_with_value ("__INT_FAST64_TYPE__", 
> INT_FAST64_TYPE, 0);
> +  if (UINT_FAST8_TYPE)
> +    builtin_define_with_value ("__UINT_FAST8_TYPE__", 
> UINT_FAST8_TYPE, 0);
> +  if (UINT_FAST16_TYPE)
> +    builtin_define_with_value ("__UINT_FAST16_TYPE__", 
> UINT_FAST16_TYPE, 0);
> +  if (UINT_FAST32_TYPE)
> +    builtin_define_with_value ("__UINT_FAST32_TYPE__", 
> UINT_FAST32_TYPE, 0);
> +  if (UINT_FAST64_TYPE)
> +    builtin_define_with_value ("__UINT_FAST64_TYPE__", 
> UINT_FAST64_TYPE, 0);
> +  if (INTPTR_TYPE)
> +    builtin_define_with_value ("__INTPTR_TYPE__", INTPTR_TYPE, 0);
> +  if (UINTPTR_TYPE)
> +    builtin_define_with_value ("__UINTPTR_TYPE__", UINTPTR_TYPE, 0);
>  }
>  
>  static void
> Index: gcc/c-common.h
> ===================================================================
> --- gcc/c-common.h    (revision 141680)
> +++ gcc/c-common.h    (working copy)
> @@ -152,8 +152,7 @@
>      CTI_CHAR16_TYPE,
>      CTI_CHAR32_TYPE,
>      CTI_WCHAR_TYPE,
> -    CTI_SIGNED_WCHAR_TYPE,
> -    CTI_UNSIGNED_WCHAR_TYPE,
> +    CTI_UNDERLYING_WCHAR_TYPE,
>      CTI_WINT_TYPE,
>      CTI_SIGNED_SIZE_TYPE, /* For format checking only.  */
>      CTI_UNSIGNED_PTRDIFF_TYPE, /* For format checking only.  */
> @@ -162,6 +161,36 @@
>      CTI_WIDEST_INT_LIT_TYPE,
>      CTI_WIDEST_UINT_LIT_TYPE,
>  
> +    /* Types for <stdint.h>, that may not be defined on all
> +       targets.  */
> +    CTI_SIG_ATOMIC_TYPE,
> +    CTI_INT8_TYPE,
> +    CTI_INT16_TYPE,
> +    CTI_INT32_TYPE,
> +    CTI_INT64_TYPE,
> +    CTI_UINT8_TYPE,
> +    CTI_UINT16_TYPE,
> +    CTI_UINT32_TYPE,
> +    CTI_UINT64_TYPE,
> +    CTI_INT_LEAST8_TYPE,
> +    CTI_INT_LEAST16_TYPE,
> +    CTI_INT_LEAST32_TYPE,
> +    CTI_INT_LEAST64_TYPE,
> +    CTI_UINT_LEAST8_TYPE,
> +    CTI_UINT_LEAST16_TYPE,
> +    CTI_UINT_LEAST32_TYPE,
> +    CTI_UINT_LEAST64_TYPE,
> +    CTI_INT_FAST8_TYPE,
> +    CTI_INT_FAST16_TYPE,
> +    CTI_INT_FAST32_TYPE,
> +    CTI_INT_FAST64_TYPE,
> +    CTI_UINT_FAST8_TYPE,
> +    CTI_UINT_FAST16_TYPE,
> +    CTI_UINT_FAST32_TYPE,
> +    CTI_UINT_FAST64_TYPE,
> +    CTI_INTPTR_TYPE,
> +    CTI_UINTPTR_TYPE,
> +
>      CTI_CHAR_ARRAY_TYPE,
>      CTI_CHAR16_ARRAY_TYPE,
>      CTI_CHAR32_ARRAY_TYPE,
> @@ -238,8 +267,7 @@
>  #define char16_type_node             c_global_trees[CTI_CHAR16_TYPE]
>  #define char32_type_node             c_global_trees[CTI_CHAR32_TYPE]
>  #define wchar_type_node                      
> c_global_trees[CTI_WCHAR_TYPE]
> -#define signed_wchar_type_node               
> c_global_trees[CTI_SIGNED_WCHAR_TYPE]
> -#define unsigned_wchar_type_node     
> c_global_trees[CTI_UNSIGNED_WCHAR_TYPE]
> +#define underlying_wchar_type_node   
> c_global_trees[CTI_UNDERLYING_WCHAR_TYPE]
>  #define wint_type_node                       
> c_global_trees[CTI_WINT_TYPE]
>  #define signed_size_type_node                
> c_global_trees[CTI_SIGNED_SIZE_TYPE]
>  #define unsigned_ptrdiff_type_node   
> c_global_trees[CTI_UNSIGNED_PTRDIFF_TYPE]
> @@ -248,6 +276,34 @@
>  #define widest_integer_literal_type_node 
> c_global_trees[CTI_WIDEST_INT_LIT_TYPE]
>  #define widest_unsigned_literal_type_node 
> c_global_trees[CTI_WIDEST_UINT_LIT_TYPE]
>  
> +#define sig_atomic_type_node         
> c_global_trees[CTI_SIG_ATOMIC_TYPE]
> +#define int8_type_node                       
> c_global_trees[CTI_INT8_TYPE]
> +#define int16_type_node                      
> c_global_trees[CTI_INT16_TYPE]
> +#define int32_type_node                      
> c_global_trees[CTI_INT32_TYPE]
> +#define int64_type_node                      
> c_global_trees[CTI_INT64_TYPE]
> +#define uint8_type_node                      
> c_global_trees[CTI_UINT8_TYPE]
> +#define uint16_type_node             c_global_trees[CTI_UINT16_TYPE]
> +#define c_uint32_type_node           c_global_trees[CTI_UINT32_TYPE]
> +#define c_uint64_type_node           c_global_trees[CTI_UINT64_TYPE]
> +#define int_least8_type_node         
> c_global_trees[CTI_INT_LEAST8_TYPE]
> +#define int_least16_type_node                
> c_global_trees[CTI_INT_LEAST16_TYPE]
> +#define int_least32_type_node                
> c_global_trees[CTI_INT_LEAST32_TYPE]
> +#define int_least64_type_node                
> c_global_trees[CTI_INT_LEAST64_TYPE]
> +#define uint_least8_type_node                
> c_global_trees[CTI_UINT_LEAST8_TYPE]
> +#define uint_least16_type_node               
> c_global_trees[CTI_UINT_LEAST16_TYPE]
> +#define uint_least32_type_node               
> c_global_trees[CTI_UINT_LEAST32_TYPE]
> +#define uint_least64_type_node               
> c_global_trees[CTI_UINT_LEAST64_TYPE]
> +#define int_fast8_type_node          
> c_global_trees[CTI_INT_FAST8_TYPE]
> +#define int_fast16_type_node         
> c_global_trees[CTI_INT_FAST16_TYPE]
> +#define int_fast32_type_node         
> c_global_trees[CTI_INT_FAST32_TYPE]
> +#define int_fast64_type_node         
> c_global_trees[CTI_INT_FAST64_TYPE]
> +#define uint_fast8_type_node         
> c_global_trees[CTI_UINT_FAST8_TYPE]
> +#define uint_fast16_type_node                
> c_global_trees[CTI_UINT_FAST16_TYPE]
> +#define uint_fast32_type_node                
> c_global_trees[CTI_UINT_FAST32_TYPE]
> +#define uint_fast64_type_node                
> c_global_trees[CTI_UINT_FAST64_TYPE]
> +#define intptr_type_node             c_global_trees[CTI_INTPTR_TYPE]
> +#define uintptr_type_node            c_global_trees[CTI_UINTPTR_TYPE]
> +
>  #define truthvalue_type_node         
> c_global_trees[CTI_TRUTHVALUE_TYPE]
>  #define truthvalue_true_node         
> c_global_trees[CTI_TRUTHVALUE_TRUE]
>  #define truthvalue_false_node                
> c_global_trees[CTI_TRUTHVALUE_FALSE]
> Index: gcc/config.gcc
> ===================================================================
> --- gcc/config.gcc    (revision 141680)
> +++ gcc/config.gcc    (working copy)
> @@ -104,6 +104,12 @@
>  #  use_gcc_tgmath    If set, add tgmath.h to the list of used header
>  #                    files.
>  #
> +#  use_gcc_stdint    If "wrap", install a version of stdint.h that
> +#                    wraps the system's copy for hosted compilations;
> +#                    if "provide", provide a version of 
> systems without
> +#                    such a system header; otherwise "none", do not
> +#                    provide such a header at all.
> +#
>  #  extra_passes              List of extra executables 
> compiled for this target
>  #                    machine, used for compiling from source 
> to object.
>  #
> @@ -168,6 +174,7 @@
>  tmake_file=
>  extra_headers=
>  use_gcc_tgmath=yes
> +use_gcc_stdint=none
>  extra_passes=
>  extra_parts=
>  extra_programs=
> @@ -501,6 +508,7 @@
>    # Assume that glibc or uClibc are being used and so 
> __cxa_atexit is provided.
>    default_use_cxa_atexit=yes
>    use_gcc_tgmath=no
> +  use_gcc_stdint=wrap
>    ;;
>  *-*-gnu*)
>    # On the Hurd, the setup is just about the same on
> @@ -516,15 +524,16 @@
>    tmake_file="t-slibgcc-elf-ver t-linux t-gnu"
>    case ${target} in
>      alpha*)
> -      tm_file="${cpu_type}/${cpu_type}.h alpha/elf.h 
> alpha/linux.h alpha/linux-elf.h gnu.h ${tm_file}"
> +      tm_file="${cpu_type}/${cpu_type}.h alpha/elf.h 
> alpha/linux.h alpha/linux-elf.h gnu.h glibc-stdint.h ${tm_file}"
>        ;;
>      i[34567]86-*-*)
> -      tm_file="${cpu_type}/${cpu_type}.h i386/unix.h 
> i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h gnu.h 
> ${tm_file}"
> +      tm_file="${cpu_type}/${cpu_type}.h i386/unix.h 
> i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h gnu.h 
> glibc-stdint.h ${tm_file}"
>        ;;
>    esac
>    # Assume that glibc is being used and so __cxa_atexit is provided.
>    default_use_cxa_atexit=yes
>    use_gcc_tgmath=no
> +  use_gcc_stdint=wrap
>    ;;
>  *-*-netbsd*)
>    tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd t-libgcc-pic"
> @@ -582,7 +591,11 @@
>    case ${enable_threads} in
>      yes) thread_file='rtems' ;;
>    esac
> +  use_gcc_stdint=wrap
>    ;;
> +*-*-uclinux*)
> +  use_gcc_stdint=wrap
> +  ;;
>  *-*-vxworks*)
>    tmake_file=t-vxworks
>    xm_defines=POSIX
> @@ -597,6 +610,7 @@
>  *-*-elf)
>    # Assume that newlib is being used and so __cxa_atexit is provided.
>    default_use_cxa_atexit=yes
> +  use_gcc_stdint=wrap
>    ;;
>  esac
>  
> @@ -613,7 +627,7 @@
>       fi
>       ;;
>  alpha*-*-linux*)
> -     tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
> +     tm_file="${tm_file} alpha/elf.h alpha/linux.h 
> alpha/linux-elf.h glibc-stdint.h"
>       target_cpu_default="MASK_GAS"
>       tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha 
> alpha/t-ieee alpha/t-linux"
>       ;;
> @@ -687,12 +701,13 @@
>       local_prefix=/gnu
>       ;;
>  arc-*-elf*)
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file}"
>       extra_parts="crtinit.o crtfini.o"
>       ;;
>  arm-*-coff* | armel-*-coff*)
> -     tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h"
> +     tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h 
> dbxcoff.h newlib-stdint.h"
>       tmake_file="arm/t-arm arm/t-arm-coff"
> +     use_gcc_stdint=wrap
>       ;;
>  arm-wrs-vxworks)
>       tm_file="elfos.h arm/elf.h arm/aout.h ${tm_file} 
> vx-common.h vxworks.h arm/vxworks.h"
> @@ -713,7 +728,7 @@
>       use_collect2=yes
>       ;;
>  arm*-*-linux*)                       # ARM GNU/Linux with ELF
> -     tm_file="dbxelf.h elfos.h linux.h arm/elf.h 
> arm/linux-gas.h arm/linux-elf.h"
> +     tm_file="dbxelf.h elfos.h linux.h glibc-stdint.h 
> arm/elf.h arm/linux-gas.h arm/linux-elf.h"
>       case $target in
>       arm*b-*)
>               tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
> @@ -739,7 +754,7 @@
>       tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
>       ;;
>  arm*-*-uclinux*)             # ARM ucLinux
> -     tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h 
> arm/linux-gas.h arm/uclinux-elf.h"
> +     tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h 
> arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
>       tmake_file="arm/t-arm arm/t-arm-elf"
>       case ${target} in
>       arm*-*-uclinux*eabi)
> @@ -756,7 +771,7 @@
>       tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
>       ;;
>  arm*-*-ecos-elf)
> -     tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h 
> arm/aout.h arm/arm.h arm/ecos-elf.h"
> +     tm_file="dbxelf.h elfos.h newlib-stdint.h 
> arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/ecos-elf.h"
>       tmake_file="arm/t-arm arm/t-arm-elf"
>       tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
>       ;;
> @@ -770,9 +785,10 @@
>       tmake_file="arm/t-arm arm/t-arm-elf"
>       case ${target} in
>       arm*-*-eabi*)
> -       tm_file="$tm_file arm/eabi.h"
> +       tm_file="$tm_file arm/eabi.h newlib-stdint.h"
>         tmake_file="${tmake_file} arm/t-bpabi"
>         extra_options="${extra_options} arm/eabi.opt"
> +       use_gcc_stdint=wrap
>         ;;
>       arm*-*-symbianelf*)
>         tm_file="${tm_file} arm/symbian.h"
> @@ -785,12 +801,12 @@
>       tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
>       ;;
>  arm*-*-rtems*)
> -     tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h 
> arm/aout.h arm/arm.h arm/rtems-elf.h rtems.h"
> +     tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h 
> arm/aout.h arm/arm.h arm/rtems-elf.h rtems.h newlib-stdint.h"
>       tmake_file="arm/t-arm arm/t-arm-elf t-rtems arm/t-rtems"
>       tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
>       ;;
>  arm*-*-elf)
> -     tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h 
> arm/aout.h arm/arm.h"
> +     tm_file="dbxelf.h elfos.h newlib-stdint.h 
> arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h"
>       tmake_file="arm/t-arm arm/t-arm-elf"
>       tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
>       ;;
> @@ -801,32 +817,34 @@
>       extra_objs="pe.o"
>       ;;
>  arm-*-pe*)
> -     tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h 
> dbxcoff.h arm/pe.h"
> +     tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h 
> dbxcoff.h arm/pe.h newlib-stdint.h"
>       tmake_file="arm/t-arm arm/t-pe"
> +     use_gcc_stdint=wrap
>       extra_options="${extra_options} arm/pe.opt"
>       extra_objs="pe.o"
>       ;;
>  avr-*-rtems*)
> -     tm_file="avr/avr.h dbxelf.h avr/rtems.h rtems.h"
> +     tm_file="avr/avr.h dbxelf.h avr/rtems.h rtems.h newlib-stdint.h"
>       tmake_file="avr/t-avr t-rtems avr/t-rtems"
>       ;;
>  avr-*-*)
> -     tm_file="avr/avr.h dbxelf.h"
> +     tm_file="avr/avr.h dbxelf.h newlib-stdint.h"
> +     use_gcc_stdint=wrap
>       ;;
>  bfin*-elf*)
> -     tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
>       tmake_file=bfin/t-bfin-elf
>       use_collect2=no
>       ;;
>  bfin*-uclinux*)
> -     tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h linux.h 
> bfin/uclinux.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h linux.h 
> glibc-stdint.h bfin/uclinux.h"
>       tmake_file=bfin/t-bfin-uclinux
>       tm_defines="${tm_defines} UCLIBC_DEFAULT=1"
>       extra_options="${extra_options} linux.opt"
>       use_collect2=no
>       ;;
>  bfin*-linux-uclibc*)
> -     tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h linux.h 
> bfin/linux.h ./linux-sysroot-suffix.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h linux.h 
> glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
>       tmake_file="t-slibgcc-elf-ver bfin/t-bfin-linux"
>       extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
>       use_collect2=no
> @@ -836,25 +854,28 @@
>       tmake_file="bfin/t-bfin t-rtems bfin/t-rtems"
>       ;;
>  bfin*-*)
> -     tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
>       tmake_file=bfin/t-bfin
>       use_collect2=no
> +     use_gcc_stdint=wrap
>       ;;
>  crisv32-*-elf | crisv32-*-none)
> -     tm_file="dbxelf.h elfos.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
>       tmake_file="cris/t-cris"
>       target_cpu_default=32
>       gas=yes
>       extra_options="${extra_options} cris/elf.opt"
> +     use_gcc_stdint=wrap
>       ;;
>  cris-*-elf | cris-*-none)
> -     tm_file="dbxelf.h elfos.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
>       tmake_file="cris/t-cris cris/t-elfmulti"
>       gas=yes
>       extra_options="${extra_options} cris/elf.opt"
> +     use_gcc_stdint=wrap
>       ;;
>  crisv32-*-linux* | cris-*-linux*)
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h 
> cris/linux.h"
> +     tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h 
> glibc-stdint.h cris/linux.h"
>       # We need to avoid using t-linux, so override default tmake_file
>       tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
>       extra_options="${extra_options} cris/linux.opt"
> @@ -868,46 +889,48 @@
>       esac
>       ;;
>  crx-*-elf)
> -     tm_file="elfos.h ${tm_file}"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file}"
>       extra_parts="crtbegin.o crtend.o"
>       use_collect2=no
>       ;;
>  fr30-*-elf)
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file}"
>       tmake_file=fr30/t-fr30
>       extra_parts="crti.o crtn.o crtbegin.o crtend.o"
>       ;;
>  frv-*-elf)
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file} frv/frv-abi.h"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h 
> ${tm_file} frv/frv-abi.h"
>       tmake_file=frv/t-frv
>       ;;
>  frv-*-*linux*)
>       tm_file="dbxelf.h elfos.h svr4.h ${tm_file} \
> -              linux.h frv/linux.h frv/frv-abi.h"
> +              linux.h glibc-stdint.h frv/linux.h frv/frv-abi.h"
>       tmake_file="${tmake_file} frv/t-frv frv/t-linux"
>       ;;
>  h8300-*-rtems*)
>       tmake_file="h8300/t-h8300 h8300/t-elf t-rtems h8300/t-rtems"
> -     tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h 
> h8300/rtems.h rtems.h"
> +     tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h 
> h8300/rtems.h rtems.h newlib-stdint.h"
>       ;;
>  h8300-*-elf*)
>       tmake_file="h8300/t-h8300 h8300/t-elf"
> -     tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h"
> +     tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h 
> h8300/elf.h"
>       ;;
>  h8300-*-*)
> -     tm_file="h8300/h8300.h dbxcoff.h h8300/coff.h"
> +     tm_file="h8300/h8300.h dbxcoff.h newlib-stdint.h h8300/coff.h"
> +     use_gcc_stdint=wrap
>       ;;
>  hppa*64*-*-linux*)
>       target_cpu_default="MASK_PA_11|MASK_PA_20"
>       tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h 
> svr4.h linux.h \
> -              pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h 
> pa/pa64-linux.h"
> +              glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h 
> pa/pa-64.h \
> +              pa/pa64-linux.h"
>       tmake_file="${tmake_file} pa/t-linux64"
>       gas=yes gnu_ld=yes
>       need_64bit_hwint=yes
>       ;;
>  hppa*-*-linux*)
>       target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> pa/pa-linux.h \
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> glibc-stdint.h pa/pa-linux.h \
>                pa/pa32-regs.h pa/pa32-linux.h"
>       tmake_file="${tmake_file} pa/t-linux"
>       # Set the libgcc version number
> @@ -1039,15 +1062,16 @@
>       tm_file="${tm_file} ${cpu_type}/darwin64.h"
>       ;;
>  i[34567]86-*-elf*)
> -     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h i386/i386elf.h"
> +     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h newlib-stdint.h i386/i386elf.h"
>       tmake_file="${tmake_file} i386/t-i386elf t-svr4"
>       ;;
>  x86_64-*-elf*)
> -     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h i386/i386elf.h i386/x86-64.h"
> +     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
>       tmake_file="${tmake_file} i386/t-i386elf t-svr4"
>       ;;
>  i[34567]86-*-aout*)
> -     tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h 
> i386/gstabs.h i386/i386-aout.h"
> +     tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h 
> i386/gstabs.h i386/i386-aout.h newlib-stdint.h"
> +     use_gcc_stdint=wrap
>       ;;
>  i[34567]86-*-freebsd*)
>       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h ${fbsd_tm_file} i386/freebsd.h"
> @@ -1083,12 +1107,13 @@
>       gnu_ld=yes
>       ;;
>  i[34567]86-*-coff*)
> -     tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h 
> dbxcoff.h i386/i386-coff.h"
> +     tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h 
> dbxcoff.h newlib-stdint.h i386/i386-coff.h"
> +     use_gcc_stdint=wrap
>       ;;
>  i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | 
> i[34567]86-*-knetbsd*-gnu)
>                       # Intel 80386's running GNU/*
>                       # with ELF format using glibc 2
> -     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h svr4.h linux.h"
> +     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h svr4.h linux.h glibc-stdint.h"
>       case ${target} in
>       i[34567]86-*-linux*)
>               if test x$enable_targets = xall; then
> @@ -1120,7 +1145,7 @@
>       tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc 
> i386/t-crtfm t-dfprules"
>       ;;
>  x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
> -     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h svr4.h linux.h \
> +     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h svr4.h linux.h glibc-stdint.h \
>                i386/x86-64.h i386/linux64.h"
>       case ${target} in
>       x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;;
> @@ -1174,7 +1199,7 @@
>       gas=yes
>       ;;
>  i[34567]86-*-rtems*)
> -     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h i386/i386elf.h i386/rtemself.h rtems.h"
> +     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h 
> elfos.h i386/i386elf.h i386/rtemself.h rtems.h newlib-stdint.h"
>       extra_parts="crtbegin.o crtend.o crti.o crtn.o"
>       tmake_file="${tmake_file} i386/t-rtems-i386 
> i386/t-crtstuff t-rtems"
>       ;;
> @@ -1207,6 +1232,7 @@
>               tm_defines="${tm_defines} TARGET_BI_ARCH=1"
>               tmake_file="$tmake_file i386/t-crtstuff i386/t-sol2-10"
>               need_64bit_hwint=yes
> +             use_gcc_stdint=wrap
>               case X"${with_cpu}" in
>               
> Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopte
> ron|Xathlon64|Xathlon-fx)
>                       ;;
> @@ -1226,6 +1252,7 @@
>               extra_parts="gmon.o crtbegin.o crtend.o"
>               ;;
>       *)
> +             use_gcc_stdint=provide
>               extra_parts="crt1.o crti.o crtn.o gcrt1.o 
> gmon.o crtbegin.o crtend.o"
>               ;;
>       esac
> @@ -1309,7 +1336,7 @@
>       fi
>       ;;
>  ia64*-*-elf*)
> -     tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/elf.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h 
> ia64/sysv4.h ia64/elf.h"
>       tmake_file="ia64/t-ia64"
>       target_cpu_default="0"
>       if test x$gas = xyes
> @@ -1329,7 +1356,7 @@
>       extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o 
> crtfastmath.o"
>       ;;
>  ia64*-*-linux*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> ia64/sysv4.h ia64/linux.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> glibc-stdint.h ia64/sysv4.h ia64/linux.h"
>       tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc"
>       if test x$with_system_libunwind != xyes ; then
>               tmake_file="${tmake_file} t-libunwind-elf 
> ia64/t-glibc-libunwind"
> @@ -1352,21 +1379,21 @@
>       extra_options="${extra_options} ia64/ilp32.opt"
>       ;;
>  iq2000*-*-elf*)
> -        tm_file="svr4.h elfos.h iq2000/iq2000.h"
> +        tm_file="svr4.h elfos.h newlib-stdint.h iq2000/iq2000.h"
>          tmake_file=iq2000/t-iq2000
>          out_file=iq2000/iq2000.c
>          md_file=iq2000/iq2000.md
>          ;;
>  m32r-*-elf*)
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file}"
>       extra_parts="crtinit.o crtfini.o"
>       ;;
>  m32rle-*-elf*)
> -     tm_file="dbxelf.h elfos.h svr4.h m32r/little.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h 
> m32r/little.h ${tm_file}"
>       extra_parts="crtinit.o crtfini.o m32rx/crtinit.o 
> m32rx/crtfini.o"
>       ;;
>  m32r-*-linux*)
> -     tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} 
> m32r/linux.h"
> +     tm_file="dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h 
> ${tm_file} m32r/linux.h"
>       # We override the tmake_file for linux -- why?
>       tmake_file="t-slibgcc-elf-ver m32r/t-linux"
>       gnu_ld=yes
> @@ -1375,7 +1402,7 @@
>       fi
>       ;;
>  m32rle-*-linux*)
> -     tm_file="dbxelf.h elfos.h svr4.h linux.h m32r/little.h 
> ${tm_file} m32r/linux.h"
> +     tm_file="dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h 
> m32r/little.h ${tm_file} m32r/linux.h"
>       # We override the tmake_file for linux -- why?
>       tmake_file="t-slibgcc-elf-ver m32r/t-linux"
>       gnu_ld=yes
> @@ -1385,32 +1412,36 @@
>       ;;
>  # m68hc11 and m68hc12 share the same machine description.
>  m68hc11-*-*|m6811-*-*)
> -     tm_file="dbxelf.h elfos.h usegas.h m68hc11/m68hc11.h"
> +     tm_file="dbxelf.h elfos.h usegas.h newlib-stdint.h 
> m68hc11/m68hc11.h"
>       tm_p_file="m68hc11/m68hc11-protos.h"
>       md_file="m68hc11/m68hc11.md"
>       out_file="m68hc11/m68hc11.c"
>       tmake_file="m68hc11/t-m68hc11"
> +     use_gcc_stdint=wrap
>          ;;
>  m68hc12-*-*|m6812-*-*)
> -     tm_file="m68hc11/m68hc12.h dbxelf.h elfos.h usegas.h 
> m68hc11/m68hc11.h"
> +     tm_file="m68hc11/m68hc12.h dbxelf.h elfos.h usegas.h 
> newlib-stdint.h m68hc11/m68hc11.h"
>       tm_p_file="m68hc11/m68hc11-protos.h"
>       md_file="m68hc11/m68hc11.md"
>       out_file="m68hc11/m68hc11.c"
>       tmake_file="m68hc11/t-m68hc11"
>       extra_options="${extra_options} m68hc11/m68hc11.opt"
> +     use_gcc_stdint=wrap
>          ;;
>  m68k-*-aout*)
>       default_m68k_cpu=68020
>       default_cf_cpu=5206
>       tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-mlibs"
> -     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kemb.h 
> m68k/m68k-aout.h libgloss.h"
> +     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kemb.h 
> m68k/m68k-aout.h libgloss.h newlib-stdint.h"
> +     use_gcc_stdint=wrap
>       ;;
>  m68k-*-coff*)
>       default_m68k_cpu=68020
>       default_cf_cpu=5206
>       tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-mlibs"
>       tm_defines="${tm_defines} MOTOROLA=1"
> -     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kemb.h 
> dbxcoff.h m68k/coff.h dbx.h"
> +     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kemb.h 
> dbxcoff.h m68k/coff.h dbx.h newlib-stdint.h"
> +     use_gcc_stdint=wrap
>       ;;
>  m68k-*-elf* | fido-*-elf*)
>       case ${target} in
> @@ -1431,7 +1462,7 @@
>               default_cf_cpu=5206
>               ;;
>       esac
> -     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h 
> dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
> +     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h 
> dbxelf.h elfos.h newlib-stdint.h m68k/m68kemb.h m68k/m68020-elf.h"
>       tm_defines="${tm_defines} MOTOROLA=1"
>       tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
>       # Add multilibs for targets other than fido.
> @@ -1465,7 +1496,7 @@
>                               # m68k-elf-based ABI
>       default_m68k_cpu=68020
>       default_cf_cpu=5206
> -     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h 
> dbxelf.h elfos.h m68k/uclinux-oldabi.h"
> +     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h 
> dbxelf.h elfos.h m68k/uclinux-oldabi.h glibc-stdint.h"
>       tm_defines="${tm_defines} MOTOROLA=1"
>       tmake_file="m68k/t-floatlib m68k/t-uclinux"
>       ;;
> @@ -1474,7 +1505,7 @@
>                               # ABI.
>       default_m68k_cpu=68020
>       default_cf_cpu=5206
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> glibc-stdint.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
>       tm_defines="${tm_defines} MOTOROLA=1 UCLIBC_DEFAULT=1"
>       extra_options="${extra_options} linux.opt"
>       tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
> @@ -1485,7 +1516,7 @@
>       default_m68k_cpu=68020
>       default_cf_cpu=5475
>       with_arch=${with_arch:-m68k}
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> m68k/linux.h ./sysroot-suffix.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> glibc-stdint.h m68k/linux.h ./sysroot-suffix.h"
>       extra_options="${extra_options} m68k/ieee.opt"
>       tm_defines="${tm_defines} MOTOROLA=1"
>       tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux 
> m68k/t-mlibs"
> @@ -1499,19 +1530,20 @@
>       default_m68k_cpu=68020
>       default_cf_cpu=5206
>       tmake_file="m68k/t-floatlib m68k/t-m68kbare 
> m68k/t-crtstuff t-rtems m68k/t-rtems m68k/t-mlibs"
> -     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h 
> dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h 
> m68k/rtemself.h rtems.h"
> +     tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h 
> dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h 
> m68k/rtemself.h rtems.h newlib-stdint.h"
>       tm_defines="${tm_defines} MOTOROLA=1"
>       extra_parts="crtbegin.o crtend.o"
>       ;;
>  mcore-*-elf)
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file} mcore/mcore-elf.h"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h 
> ${tm_file} mcore/mcore-elf.h"
>       tmake_file=mcore/t-mcore
>       inhibit_libc=true
>       ;;
>  mcore-*-pe*)
> -     tm_file="svr3.h dbxcoff.h ${tm_file} mcore/mcore-pe.h"
> +     tm_file="svr3.h dbxcoff.h newlib-stdint.h ${tm_file} 
> mcore/mcore-pe.h"
>       tmake_file=mcore/t-mcore-pe
>       inhibit_libc=true
> +     use_gcc_stdint=wrap
>       ;;
>  mips-sgi-irix[56]*)
>       tm_file="elfos.h ${tm_file} mips/iris.h"
> @@ -1546,7 +1578,7 @@
>       tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h 
> netbsd-elf.h mips/netbsd.h"
>       ;;
>  mips64*-*-linux* | mipsisa64*-*-linux*)
> -     tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} 
> mips/linux.h mips/linux64.h"
> +     tm_file="dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h 
> ${tm_file} mips/linux.h mips/linux64.h"
>       tmake_file="${tmake_file} mips/t-linux64 mips/t-libgcc-mips16"
>       tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
>       case ${target} in
> @@ -1567,7 +1599,7 @@
>       test x$with_llsc != x || with_llsc=yes
>       ;;
>  mips*-*-linux*)                              # Linux MIPS, 
> either endian.
> -        tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} 
> mips/linux.h"
> +        tm_file="dbxelf.h elfos.h svr4.h linux.h 
> glibc-stdint.h ${tm_file} mips/linux.h"
>       tmake_file="${tmake_file} mips/t-libgcc-mips16"
>       case ${target} in
>          mipsisa32r2*)
> @@ -1589,7 +1621,7 @@
>          esac
>       ;;
>  mips*-sde-elf*)
> -     tm_file="elfos.h ${tm_file} mips/elf.h mips/sde.h"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h 
> mips/sde.h"
>       tmake_file="mips/t-sde mips/t-libgcc-mips16"
>       case "${with_newlib}" in
>         yes)
> @@ -1622,7 +1654,7 @@
>  mipsisa32-*-elf* | mipsisa32el-*-elf* | \
>  mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
>  mipsisa64-*-elf* | mipsisa64el-*-elf*)
> -     tm_file="elfos.h ${tm_file} mips/elf.h"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
>       tmake_file="mips/t-isa3264 mips/t-libgcc-mips16"
>       case ${target} in
>         mipsisa32r2*)
> @@ -1650,39 +1682,39 @@
>       esac
>       ;;
>  mipsisa64sr71k-*-elf*)
> -        tm_file="elfos.h ${tm_file} mips/elf.h"
> +        tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
>          tmake_file=mips/t-sr71k
>       target_cpu_default="MASK_64BIT|MASK_FLOAT64"
>       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 
> MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI"
>          ;;
>  mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
> -     tm_file="elfos.h ${tm_file} mips/elf.h"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
>       tmake_file="mips/t-elf mips/t-libgcc-mips16 mips/t-sb1"
>       target_cpu_default="MASK_64BIT|MASK_FLOAT64"
>       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 
> MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
>       ;;
>  mips-*-elf* | mipsel-*-elf*)
> -     tm_file="elfos.h ${tm_file} mips/elf.h"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
>       tmake_file="mips/t-elf mips/t-libgcc-mips16"
>       ;;
>  mips64-*-elf* | mips64el-*-elf*)
> -     tm_file="elfos.h ${tm_file} mips/elf.h"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
>       tmake_file="mips/t-elf mips/t-libgcc-mips16"
>       target_cpu_default="MASK_64BIT|MASK_FLOAT64"
>       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 
> MIPS_ABI_DEFAULT=ABI_O64"
>       ;;
>  mips64vr-*-elf* | mips64vrel-*-elf*)
> -        tm_file="mips/vr.h elfos.h ${tm_file} mips/elf.h"
> +        tm_file="mips/vr.h elfos.h newlib-stdint.h 
> ${tm_file} mips/elf.h"
>          tmake_file=mips/t-vr
>          ;;
>  mips64orion-*-elf* | mips64orionel-*-elf*)
> -     tm_file="elfos.h ${tm_file} mips/elforion.h mips/elf.h"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file} 
> mips/elforion.h mips/elf.h"
>       tmake_file="mips/t-elf mips/t-libgcc-mips16"
>       target_cpu_default="MASK_64BIT|MASK_FLOAT64"
>       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 
> MIPS_ABI_DEFAULT=ABI_O64"
>       ;;
>  mips*-*-rtems*)
> -     tm_file="elfos.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h 
> mips/rtems.h rtems.h"
>       tmake_file="mips/t-elf mips/t-libgcc-mips16 t-rtems 
> mips/t-rtems"
>       ;;
>  mips-wrs-vxworks)
> @@ -1690,28 +1722,34 @@
>       tmake_file="${tmake_file} mips/t-vxworks"
>       ;;
>  mipstx39-*-elf* | mipstx39el-*-elf*)
> -     tm_file="elfos.h ${tm_file} mips/r3900.h mips/elf.h"
> +     tm_file="elfos.h newlib-stdint.h ${tm_file} 
> mips/r3900.h mips/elf.h"
>       tmake_file="mips/t-r3900 mips/t-libgcc-mips16"
>       ;;
>  mmix-knuth-mmixware)
> +     tm_file="${tm_file} newlib-stdint.h"
>       need_64bit_hwint=yes
> +     use_gcc_stdint=wrap
>       ;;
>  mn10300-*-*)
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file}"
>       if test x$stabs = xyes
>       then
>               tm_file="${tm_file} dbx.h"
>       fi
>       use_collect2=no
> +     use_gcc_stdint=wrap
>       ;;
>  pdp11-*-bsd)
>       tm_file="${tm_file} pdp11/2bsd.h"
>       use_fixproto=yes
>          ;;
>  pdp11-*-*)
> +     tm_file="${tm_file} newlib-stdint.h"
> +     use_gcc_stdint=wrap
>       ;;
>  picochip-*)
> -        # Nothing special
> +     tm_file="${tm_file} newlib-stdint.h"
> +     use_gcc_stdint=wrap
>          ;;
>  # port not yet contributed
>  #powerpc-*-openbsd*)
> @@ -1722,7 +1760,7 @@
>       tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h"
>       test x$with_cpu != x || cpu_is_64bit=yes
>       test x$cpu_is_64bit != xyes || tm_file="${tm_file} 
> rs6000/default64.h"
> -     tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h"
> +     tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h 
> glibc-stdint.h"
>       if test x${enable_secureplt} = xyes; then
>               tm_file="rs6000/secureplt.h ${tm_file}"
>       fi
> @@ -1730,7 +1768,7 @@
>       tmake_file="t-dfprules rs6000/t-fprules ${tmake_file} 
> rs6000/t-ppccomm rs6000/t-linux64 rs6000/t-fprules-softfp 
> soft-fp/t-softfp"
>       ;;
>  powerpc64-*-gnu*)
> -     tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h 
> freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux64.h rs6000/gnu.h"
> +     tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h 
> freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux64.h 
> rs6000/gnu.h glibc-stdint.h"
>       extra_options="${extra_options} rs6000/sysv4.opt 
> rs6000/linux64.opt"
>       tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-gnu 
> rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp"
>       ;;
> @@ -1767,57 +1805,63 @@
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       ;;
>  powerpc-*-eabispe*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h 
> rs6000/eabispe.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h 
> rs6000/e500.h rs6000/eabispe.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-spe rs6000/t-ppccomm"
> +     use_gcc_stdint=wrap
>       ;;
>  powerpc-*-eabisimaltivec*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h 
> rs6000/eabisim.h rs6000/eabialtivec.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h 
> rs6000/e500.h rs6000/eabisim.h rs6000/eabialtivec.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcendian rs6000/t-ppccomm"
> +     use_gcc_stdint=wrap
>       ;;
>  powerpc-*-eabisim*)
> -     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h 
> rs6000/eabisim.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h 
> rs6000/e500.h rs6000/eabisim.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcgas rs6000/t-ppccomm"
> +     use_gcc_stdint=wrap
>       ;;
>  powerpc-*-elf*)
> -     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcgas rs6000/t-ppccomm"
>       ;;
>  powerpc-*-eabialtivec*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h 
> rs6000/eabialtivec.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h 
> rs6000/e500.h rs6000/eabialtivec.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcendian rs6000/t-ppccomm"
> +     use_gcc_stdint=wrap
>       ;;
>  powerpc-xilinx-eabi*)
> -     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/singlefp.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h 
> rs6000/singlefp.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcgas rs6000/t-ppccomm"
> +     use_gcc_stdint=wrap
>       ;;
>  powerpc-*-eabi*)
> -     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h 
> rs6000/e500.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcgas rs6000/t-ppccomm"
> +     use_gcc_stdint=wrap
>       ;;
>  powerpc-*-rtems*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h 
> rs6000/rtems.h rtems.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h 
> rs6000/e500.h rs6000/rtems.h rtems.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-rtems t-rtems rs6000/t-ppccomm"
>       ;;
>  powerpc-*-linux*altivec*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/linux.h 
> rs6000/linuxaltivec.h glibc-stdint.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp 
> soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
>       ;;
>  powerpc-*-linux*spe*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/linux.h 
> rs6000/linuxspe.h rs6000/e500.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/linux.h 
> rs6000/linuxspe.h rs6000/e500.h glibc-stdint.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="t-dfprules rs6000/t-fprules 
> rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos 
> ${tmake_file} rs6000/t-ppccomm"
>       ;;
>  powerpc-*-linux*paired*)
> -        tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/750cl.h"
> +        tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/750cl.h 
> glibc-stdint.h"
>          extra_options="${extra_options} rs6000/sysv4.opt"
>          tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp 
> soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
>          ;;
> @@ -1830,12 +1874,12 @@
>               if test x$cpu_is_64bit = xyes; then
>                   tm_file="${tm_file} rs6000/default64.h"
>               fi
> -             tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h"
> +             tm_file="rs6000/biarch64.h ${tm_file} 
> rs6000/linux64.h glibc-stdint.h"
>               tmake_file="$tmake_file rs6000/t-linux64"
>               extra_options="${extra_options} rs6000/linux64.opt"
>               ;;
>           *)
> -             tm_file="${tm_file} rs6000/linux.h"
> +             tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
>               ;;
>       esac
>       if test x${enable_secureplt} = xyes; then
> @@ -1843,7 +1887,7 @@
>       fi
>       ;;
>  powerpc-*-gnu-gnualtivec*)
> -     tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h 
> freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h 
> rs6000/linuxaltivec.h rs6000/gnu.h"
> +     tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h 
> freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h 
> rs6000/linuxaltivec.h rs6000/gnu.h glibc-stdint.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm"
>       if test x$enable_threads = xyes; then
> @@ -1851,7 +1895,7 @@
>       fi
>       ;;
>  powerpc-*-gnu*)
> -     tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h 
> freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/gnu.h"
> +     tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h 
> freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h 
> rs6000/gnu.h glibc-stdint.h"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       if test x$enable_threads = xyes; then
> @@ -1885,24 +1929,27 @@
>       gas=yes
>       ;;
>  powerpcle-*-elf*)
> -     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcgas rs6000/t-ppccomm"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       ;;
>  powerpcle-*-eabisim*)
> -     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h 
> rs6000/e500.h rs6000/eabisim.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h 
> rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h rs6000/eabisim.h"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcgas rs6000/t-ppccomm"
>       extra_options="${extra_options} rs6000/sysv4.opt"
> +     use_gcc_stdint=wrap
>       ;;
>  powerpcle-*-eabi*)
> -     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h 
> rs6000/e500.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h 
> rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcgas rs6000/t-ppccomm"
>       extra_options="${extra_options} rs6000/sysv4.opt"
> +     use_gcc_stdint=wrap
>       ;;
>  powerpc-xilinx-eabi*)
> -     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/singlefp.h 
> rs6000/xfpu.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h usegas.h svr4.h 
> freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h 
> rs6000/singlefp.h rs6000/xfpu.h"
>       extra_options="${extra_options} rs6000/sysv4.opt"
>       tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit 
> rs6000/t-ppcgas rs6000/t-ppccomm"
> +     use_gcc_stdint=wrap
>       ;;
>  rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
>       tm_file="${tm_file} rs6000/aix.h rs6000/aix41.h rs6000/xcoff.h"
> @@ -1953,11 +2000,11 @@
>       extra_headers=altivec.h
>       ;;
>  s390-*-linux*)
> -     tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h 
> s390/linux.h"
> +     tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h 
> glibc-stdint.h s390/linux.h"
>       tmake_file="${tmake_file} t-dfprules s390/t-crtstuff 
> s390/t-linux"
>       ;;
>  s390x-*-linux*)
> -     tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h 
> svr4.h linux.h s390/linux.h"
> +     tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h 
> svr4.h linux.h glibc-stdint.h s390/linux.h"
>       tm_p_file=s390/s390-protos.h
>       md_file=s390/s390.md
>       extra_modes=s390/s390-modes.def
> @@ -1976,7 +2023,7 @@
>       extra_options="${extra_options} s390/tpf.opt"
>       ;;
>  score-*-elf)
> -        tm_file="dbxelf.h elfos.h score/elf.h score/score.h"
> +        tm_file="dbxelf.h elfos.h score/elf.h score/score.h 
> newlib-stdint.h"
>          tmake_file=score/t-score-elf
>          extra_objs="score7.o score3.o"
>          ;;
> @@ -2013,7 +2060,7 @@
>       tm_file="${tm_file} sh/elf.h"
>       case ${target} in
>       sh*-*-linux*)   tmake_file="${tmake_file} sh/t-linux"
> -                     tm_file="${tm_file} linux.h sh/linux.h" ;;
> +                     tm_file="${tm_file} linux.h 
> glibc-stdint.h sh/linux.h" ;;
>       sh*-*-netbsd*)  tm_file="${tm_file} netbsd.h 
> netbsd-elf.h sh/netbsd-elf.h" ;;
>       sh*-superh-elf) if test x$with_libgloss != xno; then
>                               with_libgloss=yes
> @@ -2056,6 +2103,9 @@
>               extra_objs="symbian.o"
>               extra_parts="crt1.o crti.o crtn.o crtbegin.o 
> crtend.o crtbeginS.o crtendS.o"
>               ;;
> +     *-*-elf*)
> +             tm_file="${tm_file} newlib-stdint.h"
> +             ;;
>       esac
>       # sed el/eb endian suffixes away to avoid confusion with sh[23]e
>       case `echo ${target} | sed 's/e[lb]-/-/'` in
> @@ -2147,7 +2197,7 @@
>       ;;
>  sh-*-rtems*)
>       tmake_file="sh/t-sh sh/t-elf t-rtems sh/t-rtems"
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h 
> sh/embed-elf.h sh/rtemself.h rtems.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h 
> sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
>       ;;
>  sh-wrs-vxworks)
>       tmake_file="$tmake_file sh/t-sh sh/t-elf sh/t-vxworks"
> @@ -2155,6 +2205,7 @@
>       ;;
>  sh-*-*)
>       tm_file="${tm_file} dbxcoff.h sh/coff.h"
> +     use_gcc_stdint=wrap
>       ;;
>  sparc-*-netbsdelf*)
>       tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
> @@ -2167,12 +2218,12 @@
>       with_cpu=ultrasparc
>       ;;
>  sparc-*-elf*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h sparc/sp-elf.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h 
> svr4.h sparc/sysv4.h sparc/sp-elf.h"
>       tmake_file="sparc/t-elf sparc/t-crtfm"
>       extra_parts="crti.o crtn.o crtbegin.o crtend.o"
>       ;;
>  sparc-*-linux*)              # SPARC's running GNU/Linux, libc6
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h linux.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h linux.h glibc-stdint.h"
>       extra_options="${extra_options} sparc/long-double-switch.opt"
>       tmake_file="${tmake_file} sparc/t-linux"
>       if test x$enable_targets = xall; then
> @@ -2184,7 +2235,7 @@
>       tmake_file="${tmake_file} sparc/t-crtfm"
>       ;;
>  sparc-*-rtems*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
>       tmake_file="sparc/t-elf sparc/t-crtfm t-rtems"
>       extra_parts="crti.o crtn.o crtbegin.o crtend.o"
>       ;;
> @@ -2193,7 +2244,11 @@
>       case ${target} in
>       *-*-solaris2.1[0-9]*)
>               tm_file="${tm_file} sol2-10.h"
> +             use_gcc_stdint=wrap
>               ;;
> +     *)
> +             use_gcc_stdint=provide
> +             ;;
>       esac
>       tm_file="${tm_file} sparc/sol2.h sparc/sol2-64.h 
> sparc/sol2-bi.h"
>       if test x$gnu_ld = xyes; then
> @@ -2224,7 +2279,11 @@
>       case ${target} in
>       *-*-solaris2.1[0-9]*)
>               tm_file="${tm_file} sol2-10.h"
> +             use_gcc_stdint=wrap
>               ;;
> +     *)
> +             use_gcc_stdint=provide
> +             ;;
>       esac
>       tm_file="${tm_file} sparc/sol2.h"
>       if test x$gnu_ld = xyes; then
> @@ -2268,7 +2327,7 @@
>       tmake_file="${tmake_file} sparc/t-vxworks"
>       ;;
>  sparc64-*-elf*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h sparc/sp64-elf.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h"
>       extra_options="${extra_options} sparc/little-endian.opt"
>       tmake_file="${tmake_file} sparc/t-crtfm"
>       extra_parts="crtbegin.o crtend.o"
> @@ -2284,7 +2343,7 @@
>       esac
>       ;;
>  sparc64-*-linux*)            # 64-bit SPARC's running GNU/Linux
> -     tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h 
> svr4.h sparc/sysv4.h linux.h sparc/linux64.h"
> +     tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h 
> svr4.h sparc/sysv4.h linux.h glibc-stdint.h sparc/linux64.h"
>       extra_options="${extra_options} sparc/long-double-switch.opt"
>       tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 
> sparc/t-crtfm"
>       ;;
> @@ -2295,7 +2354,7 @@
>       tmake_file="${tmake_file} sparc/t-netbsd64"
>       ;;
>  spu-*-elf*)
> -     tm_file="dbxelf.h elfos.h spu/spu-elf.h spu/spu.h"
> +     tm_file="dbxelf.h elfos.h spu/spu-elf.h spu/spu.h 
> newlib-stdint.h"
>       tmake_file="spu/t-spu-elf"
>       extra_headers="spu_intrinsics.h spu_internals.h 
> vmx2spu.h spu_mfcio.h vec_types.h"
>       extra_modes=spu/spu-modes.def
> @@ -2304,7 +2363,7 @@
>       ;;
>  v850e1-*-*)
>       target_cpu_default="TARGET_CPU_v850e1"
> -     tm_file="dbxelf.h elfos.h svr4.h v850/v850.h"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h v850/v850.h"
>       tm_p_file=v850/v850-protos.h
>       tmake_file=v850/t-v850e
>       md_file=v850/v850.md
> @@ -2317,10 +2376,11 @@
>       use_collect2=no
>       c_target_objs="v850-c.o"
>       cxx_target_objs="v850-c.o"
> +     use_gcc_stdint=wrap
>       ;;
>  v850e-*-*)
>       target_cpu_default="TARGET_CPU_v850e"
> -     tm_file="dbxelf.h elfos.h svr4.h v850/v850.h"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h v850/v850.h"
>       tm_p_file=v850/v850-protos.h
>       tmake_file=v850/t-v850e
>       md_file=v850/v850.md
> @@ -2333,10 +2393,11 @@
>       use_collect2=no
>       c_target_objs="v850-c.o"
>       cxx_target_objs="v850-c.o"
> +     use_gcc_stdint=wrap
>       ;;
>  v850-*-*)
>       target_cpu_default="TARGET_CPU_generic"
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file}"
>       tmake_file=v850/t-v850
>       if test x$stabs = xyes
>       then
> @@ -2345,6 +2406,7 @@
>       use_collect2=no
>       c_target_objs="v850-c.o"
>       cxx_target_objs="v850-c.o"
> +     use_gcc_stdint=wrap
>       ;;
>  vax-*-netbsdelf*)
>       tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h 
> vax/elf.h vax/netbsd-elf.h"
> @@ -2361,7 +2423,7 @@
>       ;;
>  xstormy16-*-elf)
>       # For historical reasons, the target files omit the 'x'.
> -     tm_file="dbxelf.h elfos.h svr4.h stormy16/stormy16.h"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h 
> stormy16/stormy16.h"
>       tm_p_file=stormy16/stormy16-protos.h
>       md_file=stormy16/stormy16.md
>       out_file=stormy16/stormy16.c
> @@ -2370,22 +2432,22 @@
>       extra_parts="crtbegin.o crtend.o"
>       ;;
>  xtensa*-*-elf*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h xtensa/elf.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h 
> newlib-stdint.h xtensa/elf.h"
>       tmake_file="xtensa/t-xtensa xtensa/t-elf"
>       ;;
>  xtensa*-*-linux*)
> -     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> xtensa/linux.h"
> +     tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h 
> glibc-stdint.h xtensa/linux.h"
>       tmake_file="${tmake_file} xtensa/t-xtensa xtensa/t-linux"
>       ;;
>  am33_2.0-*-linux*)
> -     tm_file="mn10300/mn10300.h dbxelf.h elfos.h linux.h 
> mn10300/linux.h"
> +     tm_file="mn10300/mn10300.h dbxelf.h elfos.h linux.h 
> glibc-stdint.h mn10300/linux.h"
>       tmake_file="${tmake_file} mn10300/t-linux"
>       gas=yes gnu_ld=yes
>       extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
>       use_collect2=no
>       ;;
>  m32c-*-elf*)
> -     tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
> +     tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file}"
>       c_target_objs="m32c-pragma.o"
>       cxx_target_objs="m32c-pragma.o"
>       ;;
> Index: gcc/Makefile.in
> ===================================================================
> --- gcc/Makefile.in   (revision 141680)
> +++ gcc/Makefile.in   (working copy)
> @@ -646,6 +646,9 @@
>  # List of additional header files to install.
>  EXTRA_HEADERS address@hidden@
>  
> +# How to handle <stdint.h>.
> +USE_GCC_STDINT = @use_gcc_stdint@
> +
>  # The configure script will set this to collect2$(exeext), 
> except on a
>  # (non-Unix) host which can not build collect2, for which it will be
>  # set to empty.
> @@ -3627,6 +3630,14 @@
>       done
>       rm -f include/unwind.h
>       cp $(UNWIND_H) include/unwind.h
> +     rm -f include/stdint.h
> +     if [ $(USE_GCC_STDINT) = wrap ]; then \
> +       rm -f include/stdint-gcc.h; \
> +       cp $(srcdir)/ginclude/stdint-gcc.h include/stdint-gcc.h; \
> +       cp $(srcdir)/ginclude/stdint-wrap.h include/stdint.h; \
> +     elif [ $(USE_GCC_STDINT) = provide ]; then \
> +       cp $(srcdir)/ginclude/stdint-gcc.h include/stdint.h; \
> +     fi
>       set -e; for ml in `cat fixinc_list`; do \
>         sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
>         multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
> Index: gcc/config/m32c/m32c.h
> ===================================================================
> --- gcc/config/m32c/m32c.h    (revision 141680)
> +++ gcc/config/m32c/m32c.h    (working copy)
> @@ -173,6 +173,9 @@
>  #undef PTRDIFF_TYPE
>  #define PTRDIFF_TYPE (TARGET_A16 ? "int" : "long int")
>  
> +#undef UINTPTR_TYPE
> +#define UINTPTR_TYPE (TARGET_A16 ? "unsigned int" : "long 
> unsigned int")
> +
>  /* REGISTER USAGE */
>  
>  /* Register Basics */
> Index: gcc/config/spu/spu.h
> ===================================================================
> --- gcc/config/spu/spu.h      (revision 141680)
> +++ gcc/config/spu/spu.h      (working copy)
> @@ -142,6 +142,8 @@
>  
>  #define DEFAULT_SIGNED_CHAR 0
>  
> +#define STDINT_LONG32 0
> +
>  > 
>  /* Register Basics */
>  
> Index: gcc/config/sol2.h
> ===================================================================
> --- gcc/config/sol2.h (revision 141680)
> +++ gcc/config/sol2.h (working copy)
> @@ -38,6 +38,40 @@
>  #undef       WINT_TYPE_SIZE
>  #define      WINT_TYPE_SIZE BITS_PER_WORD
>  
> +#define SIG_ATOMIC_TYPE "int"
> +
> +/* ??? This definition of int8_t follows the system header but does
> +   not conform to C99.  Likewise int_fast8_t, int_least8_t.  */
> +#define INT8_TYPE "char"
> +#define INT16_TYPE "short int"
> +#define INT32_TYPE "int"
> +#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : 
> "long long int")
> +#define UINT8_TYPE "unsigned char"
> +#define UINT16_TYPE "short unsigned int"
> +#define UINT32_TYPE "unsigned int"
> +#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned 
> int" : "long long unsigned int")
> +
> +#define INT_LEAST8_TYPE "char"
> +#define INT_LEAST16_TYPE "short int"
> +#define INT_LEAST32_TYPE "int"
> +#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" 
> : "long long int")
> +#define UINT_LEAST8_TYPE "unsigned char"
> +#define UINT_LEAST16_TYPE "short unsigned int"
> +#define UINT_LEAST32_TYPE "unsigned int"
> +#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long 
> unsigned int" : "long long unsigned int")
> +
> +#define INT_FAST8_TYPE "char"
> +#define INT_FAST16_TYPE "int"
> +#define INT_FAST32_TYPE "int"
> +#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : 
> "long long int")
> +#define UINT_FAST8_TYPE "unsigned char"
> +#define UINT_FAST16_TYPE "unsigned int"
> +#define UINT_FAST32_TYPE "unsigned int"
> +#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long 
> unsigned int" : "long long unsigned int")
> +
> +#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
> +#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned 
> int" : "unsigned int")
> +
>  #define TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME 1
>  
>  /* ??? Note: in order for -compat-bsd to work fully,
> Index: gcc/config/glibc-stdint.h
> ===================================================================
> --- gcc/config/glibc-stdint.h (revision 0)
> +++ gcc/config/glibc-stdint.h (revision 0)
> @@ -0,0 +1,50 @@
> +/* Definitions for <stdint.h> types on systems using GNU 
> libc or uClibc.
> +   Copyright (C) 2008 Free Software Foundation, Inc.
> +
> +This file is part of GCC.
> +
> +GCC is free software; you can redistribute it and/or modify
> +it under the terms of the GNU General Public License as published by
> +the Free Software Foundation; either version 3, or (at your option)
> +any later version.
> +
> +GCC is distributed in the hope that it will be useful,
> +but WITHOUT ANY WARRANTY; without even the implied warranty of
> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +GNU General Public License for more details.
> +
> +You should have received a copy of the GNU General Public License
> +along with GCC; see the file COPYING3.  If not see
> +<http://www.gnu.org/licenses/>.  */
> +
> +#define SIG_ATOMIC_TYPE "int"
> +
> +#define INT8_TYPE "signed char"
> +#define INT16_TYPE "short int"
> +#define INT32_TYPE "int"
> +#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : 
> "long long int")
> +#define UINT8_TYPE "unsigned char"
> +#define UINT16_TYPE "short unsigned int"
> +#define UINT32_TYPE "unsigned int"
> +#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned 
> int" : "long long unsigned int")
> +
> +#define INT_LEAST8_TYPE "signed char"
> +#define INT_LEAST16_TYPE "short int"
> +#define INT_LEAST32_TYPE "int"
> +#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" 
> : "long long int")
> +#define UINT_LEAST8_TYPE "unsigned char"
> +#define UINT_LEAST16_TYPE "short unsigned int"
> +#define UINT_LEAST32_TYPE "unsigned int"
> +#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long 
> unsigned int" : "long long unsigned int")
> +
> +#define INT_FAST8_TYPE "signed char"
> +#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
> +#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
> +#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : 
> "long long int")
> +#define UINT_FAST8_TYPE "unsigned char"
> +#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long 
> unsigned int" : "unsigned int")
> +#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long 
> unsigned int" : "unsigned int")
> +#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long 
> unsigned int" : "long long unsigned int")
> +
> +#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
> +#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned 
> int" : "unsigned int")
> Index: gcc/config/newlib-stdint.h
> ===================================================================
> --- gcc/config/newlib-stdint.h        (revision 0)
> +++ gcc/config/newlib-stdint.h        (revision 0)
> @@ -0,0 +1,64 @@
> +/* Definitions for <stdint.h> types on systems using newlib.
> +   Copyright (C) 2008 Free Software Foundation, Inc.
> +
> +This file is part of GCC.
> +
> +GCC is free software; you can redistribute it and/or modify
> +it under the terms of the GNU General Public License as published by
> +the Free Software Foundation; either version 3, or (at your option)
> +any later version.
> +
> +GCC is distributed in the hope that it will be useful,
> +but WITHOUT ANY WARRANTY; without even the implied warranty of
> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +GNU General Public License for more details.
> +
> +You should have received a copy of the GNU General Public License
> +along with GCC; see the file COPYING3.  If not see
> +<http://www.gnu.org/licenses/>.  */
> +
> +/* newlib uses 32-bit long in certain cases for all non-SPU
> +   targets.  */
> +#ifndef STDINT_LONG32
> +#define STDINT_LONG32 (LONG_TYPE_SIZE == 32)
> +#endif
> +
> +#define SIG_ATOMIC_TYPE "int"
> +
> +/* The newlib logic actually checks for sizes greater than 32 rather
> +   than equal to 64 for various 64-bit types.  */
> +
> +#define INT8_TYPE (CHAR_TYPE_SIZE == 8 ? "signed char" : 0)
> +#define INT16_TYPE (SHORT_TYPE_SIZE == 16 ? "short int" : 
> INT_TYPE_SIZE == 16 ? "int" : CHAR_TYPE_SIZE == 16 ? "signed 
> char" : 0)
> +#define INT32_TYPE (STDINT_LONG32 ? "long int" : 
> INT_TYPE_SIZE == 32 ? "int" : SHORT_TYPE_SIZE == 32 ? "short 
> int" : CHAR_TYPE_SIZE == 32 ? "signed char" : 0)
> +#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : 
> LONG_LONG_TYPE_SIZE == 64 ? "long long int" : INT_TYPE_SIZE 
> == 64 ? "int" : 0)
> +#define UINT8_TYPE (CHAR_TYPE_SIZE == 8 ? "unsigned char" : 0)
> +#define UINT16_TYPE (SHORT_TYPE_SIZE == 16 ? "short unsigned 
> int" : INT_TYPE_SIZE == 16 ? "unsigned int" : CHAR_TYPE_SIZE 
> == 16 ? "unsigned char" : 0)
> +#define UINT32_TYPE (STDINT_LONG32 ? "long unsigned int" : 
> INT_TYPE_SIZE == 32 ? "unsigned int" : SHORT_TYPE_SIZE == 32 
> ? "short unsigned int" : CHAR_TYPE_SIZE == 32 ? "unsigned char" : 0)
> +#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned 
> int" : LONG_LONG_TYPE_SIZE == 64 ? "long long unsigned int" : 
> INT_TYPE_SIZE == 64 ? "unsigned int" : 0)
> +
> +#define INT_LEAST8_TYPE (INT8_TYPE ? INT8_TYPE : INT16_TYPE 
> ? INT16_TYPE : INT32_TYPE ? INT32_TYPE : INT64_TYPE ? INT64_TYPE : 0)
> +#define INT_LEAST16_TYPE (INT16_TYPE ? INT16_TYPE : 
> INT32_TYPE ? INT32_TYPE : INT64_TYPE ? INT64_TYPE : 0)
> +#define INT_LEAST32_TYPE (INT32_TYPE ? INT32_TYPE : 
> INT64_TYPE ? INT64_TYPE : 0)
> +#define INT_LEAST64_TYPE INT64_TYPE
> +#define UINT_LEAST8_TYPE (UINT8_TYPE ? UINT8_TYPE : 
> UINT16_TYPE ? UINT16_TYPE : UINT32_TYPE ? UINT32_TYPE : 
> UINT64_TYPE ? UINT64_TYPE : 0)
> +#define UINT_LEAST16_TYPE (UINT16_TYPE ? UINT16_TYPE : 
> UINT32_TYPE ? UINT32_TYPE : UINT64_TYPE ? UINT64_TYPE : 0)
> +#define UINT_LEAST32_TYPE (UINT32_TYPE ? UINT32_TYPE : 
> UINT64_TYPE ? UINT64_TYPE : 0)
> +#define UINT_LEAST64_TYPE UINT64_TYPE
> +
> +#define INT_FAST8_TYPE (INT_TYPE_SIZE >= 8 ? "int" : INT_LEAST8_TYPE)
> +#define INT_FAST16_TYPE (INT_TYPE_SIZE >= 16 ? "int" : 
> INT_LEAST16_TYPE)
> +#define INT_FAST32_TYPE (INT_TYPE_SIZE >= 32 ? "int" : 
> INT_LEAST32_TYPE)
> +#define INT_FAST64_TYPE (INT_TYPE_SIZE >= 64 ? "int" : 
> INT_LEAST64_TYPE)
> +#define UINT_FAST8_TYPE (INT_TYPE_SIZE >= 8 ? "unsigned int" 
> : UINT_LEAST8_TYPE)
> +#define UINT_FAST16_TYPE (INT_TYPE_SIZE >= 16 ? "unsigned 
> int" : UINT_LEAST16_TYPE)
> +#define UINT_FAST32_TYPE (INT_TYPE_SIZE >= 32 ? "unsigned 
> int" : UINT_LEAST32_TYPE)
> +#define UINT_FAST64_TYPE (INT_TYPE_SIZE >= 64 ? "unsigned 
> int" : UINT_LEAST64_TYPE)
> +
> +/* Newlib uses the unsigned type corresponding to ptrdiff_t for
> +   uintptr_t; this is the same as size_t for most newlib-using
> +   targets.  */
> +#define INTPTR_TYPE PTRDIFF_TYPE
> +#ifndef UINTPTR_TYPE
> +#define UINTPTR_TYPE SIZE_TYPE
> +#endif
> Index: gcc/config/score/score.h
> ===================================================================
> --- gcc/config/score/score.h  (revision 141680)
> +++ gcc/config/score/score.h  (working copy)
> @@ -216,6 +216,8 @@
>  /* Default definitions for size_t and ptrdiff_t.  */
>  #define SIZE_TYPE                       "unsigned int"
>  
> +#define UINTPTR_TYPE                 "long unsigned int"
> +
>  /* Register Usage
>  
>     S+core have:
> Index: fixincludes/fixincl.x
> ===================================================================
> --- fixincludes/fixincl.x     (revision 141680)
> +++ fixincludes/fixincl.x     (working copy)
> @@ -2,11 +2,11 @@
>   * 
>   * DO NOT EDIT THIS FILE   (fixincl.x)
>   * 
> - * It has been AutoGen-ed  Tuesday November  4, 2008 at 
> 01:31:18 PM UTC
> + * It has been AutoGen-ed  Thursday November  6, 2008 at 
> 11:04:40 PM UTC
>   * From the definitions    inclhack.def
>   * and the template file   fixincl
>   */
> -/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Nov  4 13:31:18 UTC 2008
> +/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Nov  6 23:04:40 UTC 2008
>   *
>   * You must regenerate it.  Use the ./genfixes script.
>   *
> @@ -15,7 +15,7 @@
>   * certain ANSI-incompatible system header files which are 
> fixed to work
>   * correctly with ANSI C and placed in a directory that GNU 
> C will search.
>   *
> - * This file contains 178 fixup descriptions.
> + * This file contains 180 fixup descriptions.
>   *
>   * See README for more information.
>   *
> @@ -4564,6 +4564,96 @@
>  
>  /* * * * * * * * * * * * * * * * * * * * * * * * * *
>   *
> + *  Description of Newlib_Stdint_1 fix
> + */
> +tSCC zNewlib_Stdint_1Name[] =
> +     "newlib_stdint_1";
> +
> +/*
> + *  File name selection pattern
> + */
> +tSCC zNewlib_Stdint_1List[] =
> +  "stdint.h\0";
> +/*
> + *  Machine/OS name selection pattern
> + */
> +#define apzNewlib_Stdint_1Machs (const char**)NULL
> +
> +/*
> + *  content selection pattern - do fix if pattern found
> + */
> +tSCC zNewlib_Stdint_1Select0[] =
> +       "@todo - Add support for wint_t types";
> +
> +#define    NEWLIB_STDINT_1_TEST_CT  1
> +static tTestDesc aNewlib_Stdint_1Tests[] = {
> +  { TT_EGREP,    zNewlib_Stdint_1Select0, (regex_t*)NULL }, };
> +
> +/*
> + *  Fix Command Arguments for Newlib_Stdint_1
> + */
> +static const char* apzNewlib_Stdint_1Patch[] = { sed_cmd_z,
> +    "-e", "address@hidden address@hidden INT32_MIN 
> (-INT32_MAX - 1)@",
> +    "-e", "address@hidden address@hidden INT32_MAX __INT32_MAX__@",
> +    "-e", "address@hidden address@hidden UINT32_MAX 
> __UINT32_MAX__@",
> +    "-e", "address@hidden address@hidden 
> INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)@",
> +    "-e", "address@hidden address@hidden 
> INT_LEAST32_MAX __INT_LEAST32_MAX__@",
> +    "-e", "address@hidden address@hidden 
> UINT_LEAST32_MAX __UINT_LEAST32_MAX__@",
> +    "-e", "address@hidden INT_FAST\\([0-9]*\\)address@hidden 
> INT_FAST\\1_MIN (-INT_FAST\\1_MAX - 1)@",
> +    "-e", "address@hidden INT_FAST\\([0-9]*\\)address@hidden 
> INT_FAST\\1_MAX __INT_FAST\\1_MAX__@",
> +    "-e", "address@hidden UINT_FAST\\([0-9]*\\)address@hidden 
> UINT_FAST\\1_MAX __UINT_FAST\\1_MAX__@",
> +    "-e", "address@hidden address@hidden SIZE_MAX __SIZE_MAX__@",
> +    "-e", "address@hidden address@hidden PTRDIFF_MIN 
> (-PTRDIFF_MAX - 1)@",
> +    "-e", "address@hidden address@hidden PTRDIFF_MAX 
> __PTRDIFF_MAX__@",
> +    "-e", "address@hidden address@hidden UINT8_C(c) __UINT8_C(c)@",
> +    "-e", "address@hidden address@hidden UINT16_C(c) __UINT16_C(c)@",
> +    (char*)NULL };
> +
> +/* * * * * * * * * * * * * * * * * * * * * * * * * *
> + *
> + *  Description of Newlib_Stdint_2 fix
> + */
> +tSCC zNewlib_Stdint_2Name[] =
> +     "newlib_stdint_2";
> +
> +/*
> + *  File name selection pattern
> + */
> +tSCC zNewlib_Stdint_2List[] =
> +  "stdint.h\0";
> +/*
> + *  Machine/OS name selection pattern
> + */
> +#define apzNewlib_Stdint_2Machs (const char**)NULL
> +
> +/*
> + *  content selection pattern - do fix if pattern found
> + */
> +tSCC zNewlib_Stdint_2Select0[] =
> +       "@todo - Add support for wint_t types";
> +
> +#define    NEWLIB_STDINT_2_TEST_CT  1
> +static tTestDesc aNewlib_Stdint_2Tests[] = {
> +  { TT_EGREP,    zNewlib_Stdint_2Select0, (regex_t*)NULL }, };
> +
> +/*
> + *  Fix Command Arguments for Newlib_Stdint_2
> + */
> +static const char* apzNewlib_Stdint_2Patch[] = {
> +    "format",
> +    "#define INTMAX_MAX __INTMAX_MAX__\n\
> +#define INTMAX_MIN (-INTMAX_MAX - 1)\n\
> +#define UINTMAX_MAX __UINTMAX_MAX__\n\
> +#define WCHAR_MAX __WCHAR_MAX__\n\
> +#define WCHAR_MIN __WCHAR_MIN__\n\
> +#define WINT_MAX __WINT_MAX__\n\
> +#define WINT_MIN __WINT_MIN__\n\n\
> +%0",
> +    "/\\*\\* Macros for minimum-width integer constant 
> expressions \\*/",
> +    (char*)NULL };
> +
> +/* * * * * * * * * * * * * * * * * * * * * * * * * *
> + *
>   *  Description of Next_Math_Prefix fix
>   */
>  tSCC zNext_Math_PrefixName[] =
> @@ -7225,9 +7315,9 @@
>   *
>   *  List of all fixes
>   */
> -#define REGEX_COUNT          225
> +#define REGEX_COUNT          227
>  #define MACH_LIST_SIZE_LIMIT 181
> -#define FIX_COUNT            178
> +#define FIX_COUNT            180
>  
>  /*
>   *  Enumerate the fixes
> @@ -7345,6 +7435,8 @@
>      NETBSD_C99_INLINE_1_FIXIDX,
>      NETBSD_C99_INLINE_2_FIXIDX,
>      NETBSD_EXTRA_SEMICOLON_FIXIDX,
> +    NEWLIB_STDINT_1_FIXIDX,
> +    NEWLIB_STDINT_2_FIXIDX,
>      NEXT_MATH_PREFIX_FIXIDX,
>      NEXT_TEMPLATE_FIXIDX,
>      NEXT_VOLITILE_FIXIDX,
> @@ -7974,6 +8066,16 @@
>       NETBSD_EXTRA_SEMICOLON_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
>       aNetbsd_Extra_SemicolonTests,   
> apzNetbsd_Extra_SemicolonPatch, 0 },
>  
> +  {  zNewlib_Stdint_1Name,    zNewlib_Stdint_1List,
> +     apzNewlib_Stdint_1Machs,
> +     NEWLIB_STDINT_1_TEST_CT, FD_MACH_ONLY,
> +     aNewlib_Stdint_1Tests,   apzNewlib_Stdint_1Patch, 0 },
> +
> +  {  zNewlib_Stdint_2Name,    zNewlib_Stdint_2List,
> +     apzNewlib_Stdint_2Machs,
> +     NEWLIB_STDINT_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
> +     aNewlib_Stdint_2Tests,   apzNewlib_Stdint_2Patch, 0 },
> +
>    {  zNext_Math_PrefixName,    zNext_Math_PrefixList,
>       apzNext_Math_PrefixMachs,
>       NEXT_MATH_PREFIX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
> Index: fixincludes/tests/base/stdint.h
> ===================================================================
> --- fixincludes/tests/base/stdint.h   (revision 141680)
> +++ fixincludes/tests/base/stdint.h   (working copy)
> @@ -14,3 +14,36 @@
>  #error This header file is to be used only for c99 mode compilations
>  #else
>  #endif  /* IRIX_STDINT_C99_CHECK */
> +
> +
> +#if defined( NEWLIB_STDINT_1_CHECK )
> +/* @todo - Add support for wint_t types. */
> +#define INT32_MIN (-INT32_MAX - 1)
> +#define INT32_MAX __INT32_MAX__
> +#define UINT32_MAX __UINT32_MAX__
> +#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
> +#define INT_LEAST32_MAX __INT_LEAST32_MAX__
> +#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
> +#define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
> +#define INT_FAST8_MAX __INT_FAST8_MAX__
> +#define UINT_FAST8_MAX __UINT_FAST8_MAX__
> +#define SIZE_MAX __SIZE_MAX__
> +#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
> +#define PTRDIFF_MAX __PTRDIFF_MAX__
> +#define UINT8_C(c) __UINT8_C(c)
> +#define UINT16_C(c) __UINT16_C(c)
> +#endif  /* NEWLIB_STDINT_1_CHECK */
> +
> +
> +#if defined( NEWLIB_STDINT_2_CHECK )
> +/* @todo - Add support for wint_t types. */
> +#define INTMAX_MAX __INTMAX_MAX__
> +#define INTMAX_MIN (-INTMAX_MAX - 1)
> +#define UINTMAX_MAX __UINTMAX_MAX__
> +#define WCHAR_MAX __WCHAR_MAX__
> +#define WCHAR_MIN __WCHAR_MIN__
> +#define WINT_MAX __WINT_MAX__
> +#define WINT_MIN __WINT_MIN__
> +
> +/** Macros for minimum-width integer constant expressions */
> +#endif  /* NEWLIB_STDINT_2_CHECK */
> Index: fixincludes/inclhack.def
> ===================================================================
> --- fixincludes/inclhack.def  (revision 141680)
> +++ fixincludes/inclhack.def  (working copy)
> @@ -2449,6 +2449,64 @@
>  };
>  
>  
> +/* newlib's stdint.h has several failures to conform to C99.  The fix
> +   for these removed a comment that can be matched to 
> identify unfixed
> +   versions.  */
> +fix = {
> +    hackname  = newlib_stdint_1;
> +    files     = stdint.h;
> +    select    = "@todo - Add support for wint_t types";
> +    sed       = "address@hidden address@hidden INT32_MIN 
> (-INT32_MAX - 1)@";
> +    sed       = "address@hidden address@hidden INT32_MAX 
> __INT32_MAX__@";
> +    sed       = "address@hidden address@hidden UINT32_MAX 
> __UINT32_MAX__@";
> +    sed       = "address@hidden address@hidden 
> INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)@";
> +    sed       = "address@hidden address@hidden 
> INT_LEAST32_MAX __INT_LEAST32_MAX__@";
> +    sed       = "address@hidden address@hidden 
> UINT_LEAST32_MAX __UINT_LEAST32_MAX__@";
> +    sed       = 'address@hidden INT_FAST\([0-9]*\)address@hidden 
> INT_FAST\1_MIN (-INT_FAST\1_MAX - 1)@';
> +    sed       = 'address@hidden INT_FAST\([0-9]*\)address@hidden 
> INT_FAST\1_MAX __INT_FAST\1_MAX__@';
> +    sed       = 'address@hidden UINT_FAST\([0-9]*\)address@hidden 
> UINT_FAST\1_MAX __UINT_FAST\1_MAX__@';
> +    sed       = "address@hidden address@hidden SIZE_MAX 
> __SIZE_MAX__@";
> +    sed       = "address@hidden address@hidden PTRDIFF_MIN 
> (-PTRDIFF_MAX - 1)@";
> +    sed       = "address@hidden address@hidden PTRDIFF_MAX 
> __PTRDIFF_MAX__@";
> +    sed       = "address@hidden address@hidden UINT8_C(c) 
> __UINT8_C(c)@";
> +    sed       = "address@hidden address@hidden UINT16_C(c) 
> __UINT16_C(c)@";
> +    test_text = "/* @todo - Add support for wint_t types. */\n"
> +                "#define INT32_MIN (-2147483647-1)\n"
> +                "#define INT32_MAX 2147483647\n"
> +                "#define UINT32_MAX 4294967295U\n"
> +                "#define INT_LEAST32_MIN (-2147483647-1)\n"
> +                "#define INT_LEAST32_MAX 2147483647\n"
> +                "#define UINT_LEAST32_MAX 4294967295U\n"
> +                "#define INT_FAST8_MIN INT8_MIN\n"
> +                "#define INT_FAST8_MAX INT8_MAX\n"
> +                "#define UINT_FAST8_MAX UINT8_MAX\n"
> +                "#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 
> 2UL + 1)\n"
> +                "#define PTRDIFF_MIN 
> (-__STDINT_EXP(LONG_MAX) - 1L)\n"
> +                "#define PTRDIFF_MAX __STDINT_EXP(LONG_MAX)\n"
> +                "#define UINT8_C(x) x##U\n"
> +                "#define UINT16_C(x) x##U";
> +};
> +
> +
> +fix = {
> +    hackname  = newlib_stdint_2;
> +    files     = stdint.h;
> +    select    = "@todo - Add support for wint_t types";
> +    c_fix     = format;
> +    c_fix_arg = "#define INTMAX_MAX __INTMAX_MAX__\n"
> +                "#define INTMAX_MIN (-INTMAX_MAX - 1)\n"
> +                "#define UINTMAX_MAX __UINTMAX_MAX__\n"
> +                "#define WCHAR_MAX __WCHAR_MAX__\n"
> +                "#define WCHAR_MIN __WCHAR_MIN__\n"
> +                "#define WINT_MAX __WINT_MAX__\n"
> +                "#define WINT_MIN __WINT_MIN__\n\n"
> +                "%0";
> +    c_fix_arg = '/\*\* Macros for minimum-width integer 
> constant expressions \*/';
> +    test_text = "/* @todo - Add support for wint_t types. */\n"
> +                "/** Macros for minimum-width integer 
> constant expressions */";
> +};
> +
> +
>  /*
>   *  NeXT 3.2 adds const prefix to some math functions.
>   *  These conflict with the built-in functions.
> 
> -- 
> Joseph S. Myers
> address@hidden
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]