diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-26 08:19:02 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-26 08:19:02 +0000 |
commit | 1c8ad86a7b27987d2d1d620c665bfb6a28d5325d (patch) | |
tree | e28b8ab33b2de7eaa12479bdb8dfb1291a7f26d0 /libcpp | |
parent | a142dffd4a046460b3e2d05481b93d5263aef6a5 (diff) | |
download | gcc-1c8ad86a7b27987d2d1d620c665bfb6a28d5325d.tar.gz |
2014-05-26 Richard Biener <rguenther@suse.de>
libcpp/
* configure.ac: Remove long long and __int64 type checks,
add check for uint64_t and fail if that wasn't found.
* include/cpplib.h (cpp_num_part): Use uint64_t.
* config.in: Regenerate.
* configure: Likewise.
gcc/
* configure.ac: Drop __int64 type check. Insist that we
found uint64_t and int64_t.
* hwint.h (HOST_BITS_PER___INT64): Remove.
(HOST_BITS_PER_WIDE_INT): Define to 64 and remove
__int64 case.
(HOST_WIDE_INT_PRINT_*): Remove 32bit case.
(HOST_WIDEST_INT*): Define to HOST_WIDE_INT*.
(HOST_WIDEST_FAST_INT): Remove __int64 case.
* vmsdbg.h (struct _DST_SRC_COMMAND): Use int64_t
for dst_q_src_df_rms_cdt.
* configure: Regenerate.
* config.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210928 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 8 | ||||
-rw-r--r-- | libcpp/config.in | 21 | ||||
-rwxr-xr-x | libcpp/configure | 141 | ||||
-rw-r--r-- | libcpp/configure.ac | 6 | ||||
-rw-r--r-- | libcpp/include/cpplib.h | 18 |
5 files changed, 85 insertions, 109 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 323a75786a6..8288423941d 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,11 @@ +2014-05-26 Richard Biener <rguenther@suse.de> + + * configure.ac: Remove long long and __int64 type checks, + add check for uint64_t and fail if that wasn't found. + * include/cpplib.h (cpp_num_part): Use uint64_t. + * config.in: Regenerate. + * configure: Likewise. + 2014-05-21 Marek Polacek <polacek@redhat.com> PR c/61212 diff --git a/libcpp/config.in b/libcpp/config.in index 1d69a75a2df..8df00ec2357 100644 --- a/libcpp/config.in +++ b/libcpp/config.in @@ -180,9 +180,6 @@ /* 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 @@ -231,9 +228,6 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* 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 @@ -264,12 +258,6 @@ /* 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. @@ -340,6 +328,11 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE +/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + /* Define to empty if `const' does not conform to ANSI C. */ #undef const @@ -361,6 +354,10 @@ /* Define to `int' if <sys/types.h> does not define. */ #undef ssize_t +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + /* Define to the type of an unsigned integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ #undef uintptr_t diff --git a/libcpp/configure b/libcpp/configure index 6b0f6dc4a72..096ac8b5f21 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -1822,6 +1822,58 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_type +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) -1 >> ($2 - 1) == 1)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval as_val=\$$3 + if test "x$as_val" = x""no; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_find_uintX_t + # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -5566,92 +5618,23 @@ _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; } +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) +$as_echo "#define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF -#define SIZEOF___INT64 $ac_cv_sizeof___int64 +#define uint64_t $ac_cv_c_uint64_t _ACEOF +;; + esac - +if test x"$ac_cv_c_uint64_t" = x"no"; then + as_fn_error "uint64_t not found" "$LINENO" 5 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 : diff --git a/libcpp/configure.ac b/libcpp/configure.ac index 93616add3bd..5f008a4a67f 100644 --- a/libcpp/configure.ac +++ b/libcpp/configure.ac @@ -64,8 +64,10 @@ 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_TYPE_UINT64_T +if test x"$ac_cv_c_uint64_t" = x"no"; then + AC_MSG_ERROR([uint64_t not found]) +fi AC_STRUCT_TM AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 594c89940df..a83452b9145 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -820,23 +820,9 @@ 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. */ -/* Find a type with at least 64bit precision, mimicking hwint.h. - This type has to be equal to unsigned HOST_WIDE_INT, see +/* 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 uint64_t cpp_num_part; typedef struct cpp_num cpp_num; struct cpp_num { |