aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-05-20 08:01:32 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-05-20 08:01:32 +0000
commit54da09ee2062f41141dbfd116975ee20509a96e3 (patch)
treeb0ae04d799914545c090c859c13d25a91264e970 /libcpp
parent74145685ed423198e739bc1eba4ebed843207341 (diff)
downloadgcc-54da09ee2062f41141dbfd116975ee20509a96e3.zip
gcc-54da09ee2062f41141dbfd116975ee20509a96e3.tar.gz
gcc-54da09ee2062f41141dbfd116975ee20509a96e3.tar.bz2
config.gcc: Remove need_64bit_hwint.
2014-05-20 Richard Biener <rguenther@suse.de> gcc/ * config.gcc: Remove need_64bit_hwint. * configure.ac: Do not define NEED_64BIT_HOST_WIDE_INT. * hwint.h: Do not check NEED_64BIT_HOST_WIDE_INT but assume it to be true. * config.in: Regenerate. * configure: Likewise. libcpp/ * configure.ac: Copy gcc logic of detecting a 64bit type. Remove HOST_WIDE_INT define. * include/cpplib.h: typedef cpp_num_part to a 64bit type, similar to how hwint.h does it. * config.in: Regenerate. * configure: Likewise. From-SVN: r210632
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog9
-rw-r--r--libcpp/config.in14
-rwxr-xr-xlibcpp/configure121
-rw-r--r--libcpp/configure.ac35
-rw-r--r--libcpp/include/cpplib.h19
5 files changed, 126 insertions, 72 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 619dfd8..e767aa5 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,12 @@
+2014-05-20 Richard Biener <rguenther@suse.de>
+
+ * configure.ac: Copy gcc logic of detecting a 64bit type.
+ Remove HOST_WIDE_INT define.
+ * include/cpplib.h: typedef cpp_num_part to a 64bit type,
+ similar to how hwint.h does it.
+ * config.in: Regenerate.
+ * configure: Likewise.
+
2014-05-09 Joey Ye <joey.ye@arm.com>
* files.c (find_file_in_dir): Always try to shorten for DOS
diff --git a/libcpp/config.in b/libcpp/config.in
index 1b0b255..1d69a75 100644
--- a/libcpp/config.in
+++ b/libcpp/config.in
@@ -180,6 +180,9 @@
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
@@ -228,9 +231,8 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define to the widest efficient host integer type at least as wide as the
- target's size_t type. */
-#undef HOST_WIDE_INT
+/* Define to 1 if the system has the type `__int64'. */
+#undef HAVE___INT64
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
@@ -262,6 +264,12 @@
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `__int64', as computed by sizeof. */
+#undef SIZEOF___INT64
+
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
diff --git a/libcpp/configure b/libcpp/configure
index a9472f3..6b0f6dc 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -5566,6 +5566,92 @@ _ACEOF
fi
+ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"
+if test "x$ac_cv_type_long_long" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LONG_LONG 1
+_ACEOF
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (long long)
+See \`config.log' for more details." "$LINENO" 5; }; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_type "$LINENO" "__int64" "ac_cv_type___int64" "$ac_includes_default"
+if test "x$ac_cv_type___int64" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE___INT64 1
+_ACEOF
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5
+$as_echo_n "checking size of __int64... " >&6; }
+if test "${ac_cv_sizeof___int64+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type___int64" = yes; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "cannot compute sizeof (__int64)
+See \`config.log' for more details." "$LINENO" 5; }; }
+ else
+ ac_cv_sizeof___int64=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5
+$as_echo "$ac_cv_sizeof___int64" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF___INT64 $ac_cv_sizeof___int64
+_ACEOF
+
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
if test "${ac_cv_struct_tm+set}" = set; then :
@@ -7151,41 +7237,6 @@ $as_echo "#define ENABLE_CANONICAL_SYSTEM_HEADERS 1" >>confdefs.h
fi
-
-case $target in
- aarch64*-*-* | \
- alpha*-*-* | \
- arm*-*-* | \
- x86_64-*-* | \
- ia64-*-* | \
- hppa*64*-*-* | \
- i[34567]86-*-* | x86_64-*-solaris2.1[0-9]* | \
- mips*-*-* | \
- mmix-*-* | \
- powerpc*-*-* | \
- rs6000*-*-* | \
- s390*-*-* | \
- sparc*-*-* | \
- spu-*-* | \
- sh[123456789lbe]*-*-* | sh-*-* | \
- tilegx*-*-* | tilepro*-*-* )
- need_64bit_hwint=yes ;;
- *)
- need_64bit_hwint=yes ;;
-esac
-
-case $need_64bit_hwint:$ac_cv_sizeof_long in
- *:8 | no:*) host_wide_int=long ;;
- *) host_wide_int='long long' ;;
-esac
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define HOST_WIDE_INT $host_wide_int
-_ACEOF
-
-
case $target in
i?86-* | x86_64-*)
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index f2bca1f..93616ad 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -64,6 +64,8 @@ AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINTPTR_T
AC_CHECK_TYPE(ptrdiff_t, int)
+AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)])
+AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)])
AC_STRUCT_TM
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
@@ -180,39 +182,6 @@ if test $enable_canonical_system_headers != no; then
1, [Define to enable system headers canonicalization.])
fi
-m4_changequote(,)
-case $target in
- aarch64*-*-* | \
- alpha*-*-* | \
- arm*-*-* | \
- x86_64-*-* | \
- ia64-*-* | \
- hppa*64*-*-* | \
- i[34567]86-*-* | x86_64-*-solaris2.1[0-9]* | \
- mips*-*-* | \
- mmix-*-* | \
- powerpc*-*-* | \
- rs6000*-*-* | \
- s390*-*-* | \
- sparc*-*-* | \
- spu-*-* | \
- sh[123456789lbe]*-*-* | sh-*-* | \
- tilegx*-*-* | tilepro*-*-* )
- need_64bit_hwint=yes ;;
- *)
- need_64bit_hwint=yes ;;
-esac
-
-case $need_64bit_hwint:$ac_cv_sizeof_long in
- *:8 | no:*) host_wide_int=long ;;
- *) host_wide_int='long long' ;;
-esac
-m4_changequote([,])
-
-AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
-[Define to the widest efficient host integer type at least
- as wide as the target's size_t type.])
-
case $target in
i?86-* | x86_64-*)
AC_TRY_COMPILE([], [asm ("pcmpestri %0, %%xmm0, %%xmm1" : : "i"(0))],
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index a9db7ab..594c899 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -819,7 +819,24 @@ extern int cpp_defined (cpp_reader *, const unsigned char *, int);
/* A preprocessing number. Code assumes that any unused high bits of
the double integer are set to zero. */
-typedef unsigned HOST_WIDE_INT cpp_num_part;
+
+/* Find a type with at least 64bit precision, mimicking hwint.h.
+ This type has to be equal to unsigned HOST_WIDE_INT, see
+ gcc/c-family/c-lex.c. */
+#if SIZEOF_LONG >= 8
+typedef unsigned long cpp_num_part;
+#else
+# if SIZEOF_LONG_LONG >= 8
+typedef unsigned long long cpp_num_part;
+# else
+# if SIZEOF___INT64 >= 8
+typedef unsigned __int64 cpp_num_part;
+# else
+ #error "This line should be impossible to reach"
+# endif
+# endif
+#endif
+
typedef struct cpp_num cpp_num;
struct cpp_num
{