https://gcc.gnu.org/g:151928e52f59adaaac082e6b5dd6f6aba04b0b95
commit r17-5645-g151928e52f59adaaac082e6b5dd6f6aba04b0b95 Author: Kael Andrew Alonzo Franco <[email protected]> Date: Tue Oct 27 07:49:13 2026 -0400 gcc: Remove HAVE_LONG_LONG in gcc/configure.ac. [PR112422] GCC require C++14 or above and long long is needed. Bootstrapped and regtested on x86_64-pc-linux-gnu. PR bootstrap/112422 gcc/ChangeLog: * configure.ac: Remove AC_CHECK_TYPES long long. * config.in: Regenerate. * configure: Regenerate. * hwint.h (sizeof_long_long_must_be_8): Remove. (USE_LONG_LONG_FOR_WIDEST_FAST_INT) Remove HAVE_LONG_LONG. * final.cc: Remove HAVE_LONG_LONG. * wide-int.h: Ditto. * asan.cc (set_asan_shadow_offset): Ditto. gcc/fortran/ChangeLog: * gfortran.h (gfc_char_t): Remove HAVE_LONG_LONG and HOST_BITS_PER_LONGLONG >= 32 since it is at least 64 according to C++14 standard. Signed-off-by: Kael Andrew Franco <[email protected]> Diff: --- gcc/asan.cc | 4 -- gcc/config.in | 6 --- gcc/configure | 121 +++++++++++++++++++++++-------------------------- gcc/configure.ac | 2 +- gcc/final.cc | 2 - gcc/fortran/gfortran.h | 4 +- gcc/hwint.h | 27 ++--------- gcc/wide-int.h | 2 - 8 files changed, 61 insertions(+), 107 deletions(-) diff --git a/gcc/asan.cc b/gcc/asan.cc index 278c414c0dab..c29c4a112795 100644 --- a/gcc/asan.cc +++ b/gcc/asan.cc @@ -317,11 +317,7 @@ set_asan_shadow_offset (const char *val) char *endp; errno = 0; -#ifdef HAVE_LONG_LONG asan_shadow_offset_value = strtoull (val, &endp, 0); -#else - asan_shadow_offset_value = strtoul (val, &endp, 0); -#endif if (!(*val != '\0' && *endp == '\0' && errno == 0)) return false; diff --git a/gcc/config.in b/gcc/config.in index abc197fa3dda..1027a45a207b 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1771,12 +1771,6 @@ #endif -/* Define to 1 if the system has the type `long long'. */ -#ifndef USED_FOR_TARGET -#undef HAVE_LONG_LONG -#endif - - /* Define to 1 if the system has the type `long long int'. */ #ifndef USED_FOR_TARGET #undef HAVE_LONG_LONG_INT diff --git a/gcc/configure b/gcc/configure index 66b2f8c153bb..14c9b39d9cec 100755 --- a/gcc/configure +++ b/gcc/configure @@ -2556,60 +2556,6 @@ rm -f conftest.val } # ac_fn_cxx_compute_int -# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES -# --------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_cxx_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -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; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_type - # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR @@ -2732,6 +2678,60 @@ fi } # ac_fn_cxx_try_link +# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES +# --------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_cxx_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_type + # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR @@ -6625,13 +6625,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -ac_fn_cxx_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = xyes; 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]];'. @@ -6665,8 +6658,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -fi - ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" case $ac_cv_c_int8_t in #( no|yes) ;; #( @@ -22097,7 +22088,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 22100 "configure" +#line 22091 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -22203,7 +22194,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 22206 "configure" +#line 22197 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 36a8e52fee23..06b23d6de419 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -522,7 +522,7 @@ AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) -AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)]) +AC_CHECK_SIZEOF(long long) GCC_STDINT_TYPES if test x"$ac_cv_c_uint64_t" = x"no" -o x"$ac_cv_c_int64_t" = x"no"; then AC_MSG_ERROR([uint64_t or int64_t not found]) diff --git a/gcc/final.cc b/gcc/final.cc index 0204332ee34b..ab7fba831760 100644 --- a/gcc/final.cc +++ b/gcc/final.cc @@ -3982,7 +3982,6 @@ asm_fprintf (FILE *file, const char *p, ...) case 'l': *q++ = c; -#ifdef HAVE_LONG_LONG if (*p == 'l') { *q++ = *p++; @@ -3991,7 +3990,6 @@ asm_fprintf (FILE *file, const char *p, ...) fprintf (file, buf, va_arg (argptr, long long)); } else -#endif { *q++ = *p++; *q = 0; diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 7433de7c1c85..87c20fa7699d 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1135,10 +1135,8 @@ symbol_attribute; typedef unsigned int gfc_char_t; #elif HOST_BITS_PER_LONG >= 32 typedef unsigned long gfc_char_t; -#elif defined(HAVE_LONG_LONG) && (HOST_BITS_PER_LONGLONG >= 32) -typedef unsigned long long gfc_char_t; #else -# error "Cannot find an integer type with at least 32 bits" +typedef unsigned long long gfc_char_t; #endif diff --git a/gcc/hwint.h b/gcc/hwint.h index 94df889a0e85..673a30ac0b98 100644 --- a/gcc/hwint.h +++ b/gcc/hwint.h @@ -15,6 +15,7 @@ #define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT) #define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG) #define HOST_BITS_PER_PTR (CHAR_BIT * SIZEOF_VOID_P) +#define HOST_BITS_PER_LONGLONG (CHAR_BIT * SIZEOF_LONG_LONG) /* The string that should be inserted into a printf style format to indicate a "long" operand. */ @@ -28,24 +29,6 @@ #define HOST_LONG_LONG_FORMAT "ll" #endif -/* If HAVE_LONG_LONG and SIZEOF_LONG_LONG aren't defined, but - GCC_VERSION >= 3000, assume this is the second or later stage of a - bootstrap, we do have long long, and it's 64 bits. (This is - required by C99; we do have some ports that violate that assumption - but they're all cross-compile-only.) Just in case, force a - constraint violation if that assumption is incorrect. */ -#if !defined HAVE_LONG_LONG -# if GCC_VERSION >= 3000 -# define HAVE_LONG_LONG 1 -# define SIZEOF_LONG_LONG 8 -extern char sizeof_long_long_must_be_8[sizeof (long long) == 8 ? 1 : -1]; -# endif -#endif - -#ifdef HAVE_LONG_LONG -# define HOST_BITS_PER_LONGLONG (CHAR_BIT * SIZEOF_LONG_LONG) -#endif - /* Set HOST_WIDE_INT, this should be always 64 bits. The underlying type is matched to that of int64_t and assumed to be either long or long long. */ @@ -144,12 +127,8 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__; for details. */ #ifdef USE_LONG_LONG_FOR_WIDEST_FAST_INT -# ifdef HAVE_LONG_LONG -# define HOST_WIDEST_FAST_INT long long -# define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONGLONG -# else -# error "Your host said it wanted to use long long but that does not exist" -# endif +# define HOST_WIDEST_FAST_INT long long +# define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONGLONG #else # define HOST_WIDEST_FAST_INT long # define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONG diff --git a/gcc/wide-int.h b/gcc/wide-int.h index 9c30f320b91d..6c39ce176985 100644 --- a/gcc/wide-int.h +++ b/gcc/wide-int.h @@ -1948,7 +1948,6 @@ namespace wi struct int_traits <unsigned long> : public primitive_int_traits <unsigned long, false> {}; -#if defined HAVE_LONG_LONG template <> struct int_traits <long long> : public primitive_int_traits <long long, true> {}; @@ -1956,7 +1955,6 @@ namespace wi template <> struct int_traits <unsigned long long> : public primitive_int_traits <unsigned long long, false> {}; -#endif } namespace wi
