This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
autoconf for type sizes
- To: gcc-patches at gcc dot gnu dot org
- Subject: autoconf for type sizes
- From: "Zack Weinberg" <zackw at stanford dot edu>
- Date: Mon, 12 Mar 2001 12:03:19 -0800
This patch adds configure tests for the sizes of host integer types,
which means we don't have to set them in xm-host.h anymore, even if
they're unusual.
CHAR_BIT is required to be >= 8 by C89, but I start checking at 7 just
in case.
This doesn't change anything about the way HOST_WIDE_INT and
HOST_WIDEST_INT are set up, except that they're both now done in
hwint.h and that gets included from system.h instead of at the end of
config.h. We look for __int64, but we don't use it for anything right
now.
I also took out definitions of HOST_FLOAT_FORMAT to IEEE_FLOAT_FORMAT,
which is the global default, except for i370/xm-linux.h where it
serves as documentation - IEEE is not the default for that
architecture.
Bootstrapped i686-linux. The configuration sequence has also been
tested on alpha-dec-osf4.0; I was going to do a bootstrap, but I get
"Virtual memory exhausted" in stage2 compiling expr.c. This appears
to be an unrelated problem with the garbage collector. It was working
fine up to that point.
Gack, I seem to have forgotten to commit the aclocal.m4 change
associated with the last patch - harmless, because the macro is not
used. I'll apply it with this patch if approved.
zw
* aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF, gcc_AC_C_CHAR_BIT,
gcc_AC_C_LONG_LONG): New.
* configure.in: Use them. Probe the size of short, int, long,
and long long/__int64 if we have them. Move all the AC_C_*
checks together, except gcc_AC_C_CHAR_BIT which has to go
after AC_CHECK_HEADERS(limits.h).
Take hwint.h out of host_xm_file and build_xm_file.
* hwint.h: Unconditionally define HOST_BITS_PER_CHAR,
HOST_BITS_PER_SHORT, HOST_BITS_PER_INT, HOST_BITS_PER_LONG,
and HOST_BITS_PER_LONGLONG in terms of SIZEOF_* and CHAR_BIT.
Move the HOST_WIDEST_INT setup logic here from system.h.
* system.h: Include hwint.h after limits.h. HOST_WIDEST_INT
is now handled by hwint.h.
* config/alpha/xm-alpha-interix.h, config/alpha/xm-vms.h,
config/c4x/xm-c4x.h, config/i370/xm-oe.h,
config/ia64/xm-ia64.h,
Don't define any of:
HOST_BITS_PER_LONG, HOST_BITS_PER_CHAR, HOST_BITS_PER_SHORT,
HOST_BITS_PER_LONGLONG
* config/alpha/xm-alpha.h, config/dsp16xx/xm-dsp16xx.h,
config/h8300/xm-h8300.h, config/mips/iris6.h,
config/mn10200/xm-mn10200.h, config/pa/xm-pa64hpux.h,
config/sparc/xm-sp64.h: Delete.
* config.gcc: Remove references to deleted files.
* config/arm/xm-arm.h, config/mips/xm-mips.h: Don't define
HOST_FLOAT_FORMAT to IEEE_FLOAT_FORMAT.
* config/i370/xm-linux.h: Clarify floating-point situation in
a comment.
===================================================================
Index: aclocal.m4
--- aclocal.m4 2001/03/06 09:52:28 1.42
+++ aclocal.m4 2001/03/12 19:50:04
@@ -1123,3 +1123,111 @@ else
gcc_cv_prog_$2_modern=no
fi
])
+
+dnl Determine if enumerated bitfields are unsigned. ISO C says they can
+dnl be either signed or unsigned.
+dnl
+AC_DEFUN(gcc_AC_C_ENUM_BF_UNSIGNED,
+[AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned,
+[AC_TRY_RUN(#include <stdlib.h>
+enum t { BLAH = 128 } ;
+struct s_t { enum t member : 8; } s ;
+int main(void)
+{
+ s.member = BLAH;
+ if (s.member < 0) exit(1);
+ exit(0);
+
+}, gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no, gcc_cv_enum_bf_unsigned=yes)])
+if test $gcc_cv_enum_bf_unsigned = yes; then
+ AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1,
+ [Define if enumerated bitfields are treated as unsigned values.])
+fi])
+
+dnl Host type sizes probe.
+dnl By Kaveh R. Ghazi. One typo fixed since.
+dnl
+AC_DEFUN([gcc_AC_COMPILE_CHECK_SIZEOF],
+[changequote(<<, >>)dnl
+dnl The name to #define.
+define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
+dnl The cache variable name.
+define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
+changequote([, ])dnl
+AC_MSG_CHECKING(size of $1)
+AC_CACHE_VAL(AC_CV_NAME,
+[for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence.
+ AC_TRY_COMPILE([#include "confdefs.h"
+#include <sys/types.h>
+$2
+], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
+ if test x$AC_CV_NAME != x ; then break; fi
+done
+])
+if test x$AC_CV_NAME = x ; then
+ AC_MSG_ERROR([cannot determine a size for $1])
+fi
+AC_MSG_RESULT($AC_CV_NAME)
+AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
+undefine([AC_TYPE_NAME])dnl
+undefine([AC_CV_NAME])dnl
+])
+
+dnl Probe number of bits in a byte.
+dnl Note C89 requires CHAR_BIT >= 8.
+dnl
+AC_DEFUN(gcc_AC_C_CHAR_BIT,
+[AC_CACHE_CHECK(for CHAR_BIT, gcc_cv_decl_char_bit,
+[AC_EGREP_CPP(found,
+[#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef CHAR_BIT
+found
+#endif], gcc_cv_decl_char_bit=yes, gcc_cv_decl_char_bit=no)
+])
+if test $gcc_cv_decl_char_bit = no; then
+ AC_CACHE_CHECK(number of bits in a byte, gcc_cv_c_nbby,
+[i=7
+ gcc_cv_c_nbby=
+ while test $i -lt 65; do
+ AC_TRY_COMPILE(,
+ [char test[(char)((char)1 << $i)
+ ? (char)((char)1 << $i) == 1 ? 1 : -1
+ : 1];],
+ gcc_cv_c_nbby=$i
+ break)
+ i=`expr $i + 1`
+ done
+ test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
+])
+if test $gcc_cv_c_nbby = failed; then
+ AC_MSG_ERROR(cannot determine number of bits in a byte)
+else
+ AC_DEFINE_UNQUOTED(CHAR_BIT, $gcc_cv_c_nbby,
+ [Define as the number of bits in a byte, if \`limits.h' doesn't.])
+fi
+fi])
+
+dnl Checking for long long.
+dnl By Caolan McNamara <caolan@skynet.ie>
+dnl Added check for __int64, Zack Weinberg <zackw@stanford.edu>
+dnl
+AC_DEFUN([gcc_AC_C_LONG_LONG],
+[AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
+ [AC_TRY_COMPILE(,[long long int i;],
+ ac_cv_c_long_long=yes,
+ ac_cv_c_long_long=no)])
+ if test $ac_cv_c_long_long = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1,
+ [Define if your compiler supports the \`long long' type.])
+ fi
+AC_CACHE_CHECK(for __int64, ac_cv_c___int64,
+ [AC_TRY_COMPILE(,[__int64 i;],
+ ac_cv_c___int64=yes,
+ ac_cv_c___int64=no)])
+ if test $ac_cv_c___int64 = yes; then
+ AC_DEFINE(HAVE___INT64, 1,
+ [Define if your compiler supports the \`__int64' type.])
+ fi
+])
===================================================================
Index: config.gcc
--- config.gcc 2001/03/12 03:29:51 1.39
+++ config.gcc 2001/03/12 19:50:04
@@ -357,7 +357,7 @@ alpha-*-interix)
target_cpu_default="MASK_GAS|MASK_IEEE_CONFORMANT"
xm_defines=USG
- xm_file="alpha/xm-alpha.h alpha/xm-alpha-interix.h xm-interix.h"
+ xm_file="alpha/xm-alpha-interix.h xm-interix.h"
xmake_file=x-interix
tmake_file="alpha/t-alpha alpha/t-interix alpha/t-ieee"
if test x$enable_threads = xyes ; then
@@ -661,7 +661,6 @@ hppa*-*-openbsd*)
;;
hppa1.1-*-rtems*)
tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h pa/rtems.h"
- xm_file=pa/xm-papro.h
tmake_file="pa/t-pro t-rtems"
if test x$enable_threads = xyes; then
thread_file='rtems'
@@ -670,7 +669,6 @@ hppa1.1-*-rtems*)
hppa1.1-*-pro*)
target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
tm_file="${tm_file} pa/pa32-regs.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h"
- xm_file=pa/xm-papro.h
tmake_file=pa/t-pro
;;
hppa1.1-*-osf*)
@@ -681,7 +679,6 @@ hppa1.1-*-osf*)
hppa1.1-*-rtems*)
target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
tm_file="${tm_file} pa/pa32-regs.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h pa/rtems.h"
- xm_file=pa/xm-papro.h
tmake_file=pa/t-pro
;;
hppa1.0-*-osf*)
@@ -700,7 +697,6 @@ hppa1.0-*-bsd*)
hppa1.0-*-hpux7*)
tm_file="pa/pa-oldas.h ${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux7.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -712,7 +708,6 @@ hppa1.0-*-hpux7*)
hppa1.0-*-hpux8.0[0-2]*)
tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -727,7 +722,6 @@ hppa1.1-*-hpux8.0[0-2]*)
target_cpu_default="MASK_PA_11"
tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -742,7 +736,6 @@ hppa1.1-*-hpux8*)
target_cpu_default="MASK_PA_11"
tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -754,7 +747,6 @@ hppa1.1-*-hpux8*)
hppa1.0-*-hpux8*)
tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -768,7 +760,6 @@ hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
float_format=i128
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
tmake_file=pa/t-pa
if test x$gas = xyes
@@ -790,7 +781,6 @@ hppa1.0-*-hpux10*)
tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
float_format=i128
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
tmake_file=pa/t-pa
if test x$gas = xyes
@@ -810,7 +800,6 @@ hppa1.0-*-hpux10*)
;;
hppa*64*-*-hpux11*)
xm_defines=USG
- xm_file=pa/xm-pa64hpux.h
xmake_file=pa/x-pa-hpux
tmake_file=pa/t-pa
tm_file="pa/pa64-start.h ${tm_file} pa/pa64-regs.h pa/long_double.h pa/elf.h pa/pa-hpux.h pa/pa-hpux11.h pa/pa-64.h"
@@ -837,7 +826,6 @@ hppa1.1-*-hpux11* | hppa2*-*-hpux11*)
tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h"
float_format=i128
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
tmake_file=pa/t-pa
if test x$gas = xyes
@@ -858,7 +846,6 @@ hppa1.0-*-hpux11*)
tm_file="${tm_file} pa/pa32-regs.h pa/long_double.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h"
float_format=i128
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -878,7 +865,6 @@ hppa1.1-*-hpux* | hppa2*-*-hpux*)
target_cpu_default="MASK_PA_11"
tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux.h pa/pa-hpux9.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -890,7 +876,6 @@ hppa1.1-*-hpux* | hppa2*-*-hpux*)
hppa1.0-*-hpux*)
tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux.h pa/pa-hpux9.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -903,7 +888,6 @@ hppa1.1-*-hiux* | hppa2*-*-hiux*)
target_cpu_default="MASK_PA_11"
tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux.h pa/pa-hiux.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -915,7 +899,6 @@ hppa1.1-*-hiux* | hppa2*-*-hiux*)
hppa1.0-*-hiux*)
tm_file="${tm_file} pa/pa32-regs.h pa/som.h pa/pa-hpux.h pa/pa-hiux.h"
xm_defines=USG
- xm_file=pa/xm-pahpux.h
xmake_file=pa/x-pa-hpux
if test x$gas = xyes
then
@@ -2133,7 +2116,6 @@ mips-sgi-irix6*) # SGI System V.4., IRI
fi
tmake_file=mips/t-iris6
xm_defines=USG
- xm_file='mips/xm-mips.h mips/xm-iris6.h'
xmake_file=mips/x-iris6
# if test x$enable_threads = xyes; then
# thread_file='irix'
@@ -3036,7 +3018,6 @@ sparcv9-*-solaris2*)
else
tm_file=sparc/sol2-sld-64.h
fi
- xm_file="sparc/xm-sysv4.h sparc/xm-sp64.h"
xm_defines="USG POSIX"
tmake_file="sparc/t-sol2 sparc/t-sol2-64"
if test x$gnu_ld = xyes; then
@@ -3062,7 +3043,6 @@ sparcv9-*-solaris2*)
fi
;;
sparc-hal-solaris2*)
- xm_file="sparc/xm-sysv4.h"
xm_defines="USG POSIX"
tm_file="sparc/sol2.h sparc/hal.h"
tmake_file="sparc/t-halos sparc/t-sol2"
@@ -3090,7 +3070,6 @@ sparc-*-solaris2*)
else
tm_file=sparc/sol2-sld.h
fi
- xm_file="sparc/xm-sysv4.h"
xm_defines="USG POSIX"
tmake_file=sparc/t-sol2
if test x$gnu_ld = xyes; then
@@ -3154,14 +3133,12 @@ sparc-*-sunos3*)
;;
sparc-*-sysv4*)
tm_file=sparc/sysv4.h
- xm_file="sparc/xm-sysv4.h"
xm_defines="USG POSIX"
tmake_file=t-svr4
xmake_file=sparc/x-sysv4
extra_parts="crtbegin.o crtend.o"
;;
sparc-*-vxsim*)
- xm_file="sparc/xm-sysv4.h"
xm_defines="USG POSIX"
tm_file=sparc/vxsim.h
tmake_file=sparc/t-vxsparc
@@ -3204,7 +3181,6 @@ sparc64-*-elf*)
;;
sparc64-*-linux*) # 64-bit Sparc's running GNU/Linux
tmake_file="t-linux sparc/t-linux64"
- xm_file="sparc/xm-sparc.h sparc/xm-sp64.h"
tm_file=sparc/linux64.h
xmake_file=x-linux
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
===================================================================
Index: configure.in
--- configure.in 2001/03/12 06:31:36 1.496
+++ configure.in 2001/03/12 19:50:05
@@ -347,8 +347,6 @@ fi
AC_SUBST(NO_MINUS_C_MINUS_O)
AC_SUBST(OUTPUT_OPTION)
-gcc_AC_C_LONG_DOUBLE
-
AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long,
ac_cv_prog_cc_no_long_long,
[save_CFLAGS="$CFLAGS"
@@ -362,6 +360,23 @@ if test $ac_cv_prog_cc_no_long_long = ye
fi
AC_SUBST(strict1_warn)
+AC_C_INLINE
+gcc_AC_C_VOLATILE
+
+gcc_AC_C_LONG_DOUBLE
+gcc_AC_C_LONG_LONG
+
+# sizeof(char) is 1 by definition.
+gcc_AC_COMPILE_CHECK_SIZEOF(short)
+gcc_AC_COMPILE_CHECK_SIZEOF(int)
+gcc_AC_COMPILE_CHECK_SIZEOF(long)
+if test $ac_cv_c_long_long = yes; then
+ gcc_AC_COMPILE_CHECK_SIZEOF(long long)
+fi
+if test $ac_cv_c___int64 = yes; then
+ gcc_AC_COMPILE_CHECK_SIZEOF(__int64)
+fi
+
# If the native compiler is GCC, we can enable warnings even in stage1.
# That's useful for people building cross-compilers, or just running a
# quick `make'.
@@ -423,13 +438,10 @@ if test $gcc_cv_glibc = yes; then
AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
fi
-AC_C_INLINE
-
# Find some useful tools
AC_PROG_AWK
gcc_AC_PROG_LN
gcc_AC_PROG_LN_S
-gcc_AC_C_VOLATILE
AC_PROG_RANLIB
gcc_AC_PROG_INSTALL
@@ -446,6 +458,9 @@ AC_CHECK_HEADERS(limits.h stddef.h strin
AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
+# This test can't be done till we know if we have limits.h.
+gcc_AC_C_CHAR_BIT
+
# See if GNAT has been installed
AC_CHECK_PROG(have_gnat, gnatbind, yes, no)
@@ -783,8 +798,8 @@ else
fi
tm_file="${tm_file} defaults.h"
-host_xm_file="auto-host.h gansidecl.h ${host_xm_file} ${tm_file} hwint.h"
-build_xm_file="${build_auto} gansidecl.h ${build_xm_file} ${tm_file} hwint.h"
+host_xm_file="auto-host.h gansidecl.h ${host_xm_file} ${tm_file}"
+build_xm_file="${build_auto} gansidecl.h ${build_xm_file} ${tm_file}"
xm_file="gansidecl.h ${xm_file} ${tm_file}"
# Truncate the target if necessary
@@ -970,7 +985,7 @@ done
host_xm_file_list=
for f in $host_xm_file; do
case $f in
- auto-host.h | gansidecl.h | defaults.h | hwint.h )
+ auto-host.h | gansidecl.h | defaults.h )
host_xm_file_list="${host_xm_file_list} $f" ;;
*) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
esac
@@ -979,7 +994,7 @@ done
build_xm_file_list=
for f in $build_xm_file; do
case $f in
- auto-build.h | auto-host.h | gansidecl.h | defaults.h | hwint.h )
+ auto-build.h | auto-host.h | gansidecl.h | defaults.h )
build_xm_file_list="${build_xm_file_list} $f" ;;
*) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
esac
===================================================================
Index: hwint.h
--- hwint.h 2001/03/06 14:32:57 1.5
+++ hwint.h 2001/03/12 19:50:05
@@ -9,23 +9,14 @@
#ifndef __HWINT_H__
#define __HWINT_H__
-/* This describes the machine the compiler is hosted on. The defaults
- we provide describe the standard 32 bit host since that is the most
- common type supported in gcc. */
-#ifndef HOST_BITS_PER_CHAR
-# define HOST_BITS_PER_CHAR 8
-#endif
-#ifndef HOST_BITS_PER_SHORT
-# define HOST_BITS_PER_SHORT 16
-#endif
-#ifndef HOST_BITS_PER_INT
-# define HOST_BITS_PER_INT 32
-#endif
-#ifndef HOST_BITS_PER_LONG
-# define HOST_BITS_PER_LONG 32
-#endif
-#ifndef HOST_BITS_PER_LONGLONG
-# define HOST_BITS_PER_LONGLONG 64
+/* This describes the machine the compiler is hosted on. */
+#define HOST_BITS_PER_CHAR CHAR_BIT
+#define HOST_BITS_PER_SHORT (CHAR_BIT * SIZEOF_SHORT)
+#define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT)
+#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
+
+#ifdef HAVE_LONG_LONG
+#define HOST_BITS_PER_LONGLONG (CHAR_BIT * SIZEOF_LONG_LONG)
#endif
/* Find the largest host integer type and set its size and type. */
@@ -42,7 +33,6 @@
#endif /* ! HOST_BITS_PER_WIDE_INT */
-
/* Provide defaults for the way to print a HOST_WIDE_INT
in various manners. */
@@ -105,5 +95,27 @@
# endif
# endif
#endif /* ! HOST_WIDE_INT_PRINT_DOUBLE_HEX */
+
+/* Find HOST_WIDEST_INT and set its bit size, type and print macros.
+ It will be the largest integer mode supported by the host which may
+ (or may not) be larger than HOST_WIDE_INT. */
+
+#ifndef HOST_WIDEST_INT
+# if defined (HOST_BITS_PER_LONG) && defined (HOST_BITS_PER_LONGLONG)
+# if (HOST_BITS_PER_LONGLONG > HOST_BITS_PER_LONG) && (defined (LONG_LONG_MAX) || defined (LONGLONG_MAX) || defined (LLONG_MAX) || defined (__GNUC__))
+# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
+# define HOST_WIDEST_INT long long
+# define HOST_WIDEST_INT_PRINT_DEC "%lld"
+# define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
+# define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
+# else
+# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONG
+# define HOST_WIDEST_INT long
+# define HOST_WIDEST_INT_PRINT_DEC "%ld"
+# define HOST_WIDEST_INT_PRINT_UNSIGNED "%lu"
+# define HOST_WIDEST_INT_PRINT_HEX "0x%lx"
+# endif /*(long long>long) && (LONG_LONG_MAX||LONGLONG_MAX||LLONG_MAX||GNUC)*/
+# endif /* defined(HOST_BITS_PER_LONG) && defined(HOST_BITS_PER_LONGLONG) */
+#endif /* ! HOST_WIDEST_INT */
#endif /* __HWINT_H__ */
===================================================================
Index: system.h
--- system.h 2001/03/12 06:31:38 1.92
+++ system.h 2001/03/12 19:50:05
@@ -145,33 +145,8 @@ extern int errno;
# include <limits.h>
#endif
-/* Find HOST_WIDEST_INT and set its bit size, type and print macros.
- It will be the largest integer mode supported by the host which may
- (or may not) be larger than HOST_WIDE_INT. This must appear after
- <limits.h> since we only use `long long' if its bigger than a
- `long' and also if it is supported by macros in limits.h. For old
- hosts which don't have a limits.h (and thus won't include it in
- stage2 cause we don't rerun configure) we assume gcc supports long
- long.) Note, you won't get these defined if you don't include
- {ht}config.h before this file to set the HOST_BITS_PER_* macros. */
-
-#ifndef HOST_WIDEST_INT
-# if defined (HOST_BITS_PER_LONG) && defined (HOST_BITS_PER_LONGLONG)
-# if (HOST_BITS_PER_LONGLONG > HOST_BITS_PER_LONG) && (defined (LONG_LONG_MAX) || defined (LONGLONG_MAX) || defined (LLONG_MAX) || defined (__GNUC__))
-# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
-# define HOST_WIDEST_INT long long
-# define HOST_WIDEST_INT_PRINT_DEC "%lld"
-# define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
-# define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
-# else
-# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONG
-# define HOST_WIDEST_INT long
-# define HOST_WIDEST_INT_PRINT_DEC "%ld"
-# define HOST_WIDEST_INT_PRINT_UNSIGNED "%lu"
-# define HOST_WIDEST_INT_PRINT_HEX "0x%lx"
-# endif /*(long long>long) && (LONG_LONG_MAX||LONGLONG_MAX||LLONG_MAX||GNUC)*/
-# endif /* defined(HOST_BITS_PER_LONG) && defined(HOST_BITS_PER_LONGLONG) */
-#endif /* ! HOST_WIDEST_INT */
+/* Get definitions of HOST_WIDE_INT and HOST_WIDEST_INT. */
+#include "hwint.h"
/* Infrastructure for defining missing _MAX and _MIN macros. Note that
macros defined with these cannot be used in #if. */
===================================================================
Index: config/alpha/xm-alpha-interix.h
--- config/alpha/xm-alpha-interix.h 2001/03/12 03:29:53 1.3
+++ config/alpha/xm-alpha-interix.h 2001/03/12 19:50:05
@@ -1,6 +1,6 @@
/* Configuration for GNU compiler
for an DEC/Compaq Alpha
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001 Free Software Foundation, Inc.
Donn Terry, Softway Systems, Inc.
derived from code by Douglas B. Rupp (drupp@cs.washington.edu)
@@ -21,16 +21,12 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#undef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG 32
-
#define HOST_BITS_PER_WIDE_INT 64
#ifdef __GNUC__
# define HOST_WIDE_INT long long
#else
# define HOST_WIDE_INT __int64
#endif
-
#define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
#ifdef __GNUC__
===================================================================
Index: config/alpha/xm-alpha.h
--- config/alpha/xm-alpha.h Mon Mar 12 11:50:07 2001
+++ config/alpha/xm-alpha.h Tue May 5 13:32:27 1998
@@ -1,24 +0,0 @@
-/* Configuration for GNU C-compiler for DEC Alpha.
- Copyright (C) 1990, 1992, 1993, 1994, 1995, 1998, 2001
- Free Software Foundation, Inc.
- Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC 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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_LONG 64
===================================================================
Index: config/alpha/xm-vms.h
--- config/alpha/xm-vms.h 2001/03/06 09:52:32 1.8
+++ config/alpha/xm-vms.h 2001/03/12 19:50:05
@@ -35,9 +35,6 @@ Boston, MA 02111-1307, USA. */
#undef FILE_TYPE
#endif
-#undef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG 32
-
#define HOST_WIDE_INT long long
#define HOST_BITS_PER_WIDE_INT 64
===================================================================
Index: config/arm/xm-arm.h
--- config/arm/xm-arm.h 2001/03/08 18:53:26 1.9
+++ config/arm/xm-arm.h 2001/03/12 19:50:05
@@ -22,11 +22,4 @@ the Free Software Foundation, 59 Temple
Boston, MA 02111-1307, USA. */
/* This describes the machine the compiler is hosted on. */
-
-/* A code distinguishing the floating point format of the host
- machine. There are three defined values: IEEE_FLOAT_FORMAT,
- VAX_FLOAT_FORMAT, and UNKNOWN_FLOAT_FORMAT. */
-
-#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-
#define HOST_FLOAT_WORDS_BIG_ENDIAN 1
===================================================================
Index: config/c4x/xm-c4x.h
--- config/c4x/xm-c4x.h 2001/03/06 14:32:59 1.5
+++ config/c4x/xm-c4x.h 2001/03/12 19:50:05
@@ -1,5 +1,2 @@
/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_CHAR 32
-#define HOST_BITS_PER_SHORT 32
-
#define HOST_WORDS_BIG_ENDIAN
===================================================================
Index: config/dsp16xx/xm-dsp16xx.h
--- config/dsp16xx/xm-dsp16xx.h Mon Mar 12 11:50:08 2001
+++ config/dsp16xx/xm-dsp16xx.h Tue May 5 13:32:27 1998
@@ -1,23 +0,0 @@
-/* Configuration file for GNU CC for AT&T DSP1600.
- Copyright (C) 1993, 2001 Free Software Foundation, Inc.
- Contributed by Michael Collison (collison@world.std.com).
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC 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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_INT 16
===================================================================
Index: config/h8300/xm-h8300.h
--- config/h8300/xm-h8300.h Mon Mar 12 11:50:08 2001
+++ config/h8300/xm-h8300.h Tue May 5 13:32:27 1998
@@ -1,22 +0,0 @@
-/* Configuration for GNU C-compiler for H8/300.
- Copyright (C) 1993, 2001 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC 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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_INT 16
===================================================================
Index: config/i370/xm-linux.h
--- config/i370/xm-linux.h 2001/03/12 06:31:39 1.8
+++ config/i370/xm-linux.h 2001/03/12 19:50:05
@@ -21,7 +21,7 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* This describes the machine the compiler is hosted on. */
+/* Unlike MVS and OE, i370-linux uses IEEE floating point. */
#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
#define HOST_WORDS_BIG_ENDIAN
===================================================================
Index: config/i370/xm-oe.h
--- config/i370/xm-oe.h 2001/03/12 06:31:39 1.10
+++ config/i370/xm-oe.h 2001/03/12 19:50:05
@@ -22,8 +22,6 @@ Boston, MA 02111-1307, USA. */
/* This describes the machine the compiler is hosted on. */
-/* ??? Is this a typo? */
-#define HOST_BITS_PER_LONGLONG 32
#define HOST_FLOAT_FORMAT IBM_FLOAT_FORMAT
#define HOST_EBCDIC 1
===================================================================
Index: config/ia64/xm-ia64.h
--- config/ia64/xm-ia64.h 2001/03/06 14:33:03 1.6
+++ config/ia64/xm-ia64.h 2001/03/12 19:50:05
@@ -23,8 +23,3 @@ Boston, MA 02111-1307, USA. */
#ifdef __BIG_ENDIAN__
#define HOST_WORDS_BIG_ENDIAN
#endif
-
-/* ??? This depends on the as yet unimplemented ILP32 option. */
-
-/* A C expression for the number of bits in `long' on the host machine. */
-#define HOST_BITS_PER_LONG 64
===================================================================
Index: config/mips/xm-iris6.h
--- config/mips/xm-iris6.h Mon Mar 12 11:50:08 2001
+++ config/mips/xm-iris6.h Tue May 5 13:32:27 1998
@@ -1,2 +0,0 @@
-#undef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG _MIPS_SZLONG
===================================================================
Index: config/mips/xm-mips.h
--- config/mips/xm-mips.h 2001/03/12 06:31:40 1.11
+++ config/mips/xm-mips.h 2001/03/12 19:50:05
@@ -23,9 +23,3 @@ Boston, MA 02111-1307, USA. */
#if !defined(MIPSEL) && !defined(__MIPSEL__)
#define HOST_WORDS_BIG_ENDIAN
#endif
-
-/* A code distinguishing the floating point format of the host
- machine. There are three defined values: IEEE_FLOAT_FORMAT,
- VAX_FLOAT_FORMAT, and UNKNOWN_FLOAT_FORMAT. */
-
-#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
===================================================================
Index: config/mn10200/xm-mn10200.h
--- config/mn10200/xm-mn10200.h Mon Mar 12 11:50:08 2001
+++ config/mn10200/xm-mn10200.h Tue May 5 13:32:27 1998
@@ -1,23 +0,0 @@
-/* Configuration for Matsushita MN10200.
- Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC 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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_INT 16
===================================================================
Index: config/pa/xm-pa64hpux.h
--- config/pa/xm-pa64hpux.h Mon Mar 12 11:50:08 2001
+++ config/pa/xm-pa64hpux.h Tue May 5 13:32:27 1998
@@ -1,26 +0,0 @@
-/* Configuration for GNU C-compiler for PA-RISC.
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC 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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This describes the machine the compiler is hosted on. */
-#define HOST_BITS_PER_LONG 64
-
-/* Doubles are stored in memory with the high order word first. This
- matters when cross-compiling. */
-#define HOST_WORDS_BIG_ENDIAN 1
===================================================================
Index: config/sparc/xm-sp64.h
--- config/sparc/xm-sp64.h Mon Mar 12 11:50:08 2001
+++ config/sparc/xm-sp64.h Tue May 5 13:32:27 1998
@@ -1,25 +0,0 @@
-/* Configuration for GCC for Sparc v9 running 64-bit native.
- Copyright (C) 1997 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC 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.
-
-GNU CC 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 GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This describes the machine the compiler is hosted on. */
-#if defined(__arch64__) || defined(__sparcv9)
-#undef HOST_BITS_PER_LONG
-#define HOST_BITS_PER_LONG 64
-#endif