From 1c86f7f3ffa2fd7584df3be376a5ab6a45dc96da Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 6 Dec 2021 17:47:05 +0100 Subject: [PATCH] intprops: Treat EDG-based compilers like Intel compilers. Reported by Ilya Kurdyukov in . * lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P): Define to 0 on EDG-based compilers. --- ChangeLog | 8 ++++++++ lib/intprops.h | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc8da213ee..52068d2aa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2021-12-06 Bruno Haible + + intprops: Treat EDG-based compilers like Intel compilers. + Reported by Ilya Kurdyukov in + . + * lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P): Define to 0 on EDG-based + compilers. + 2021-12-05 Bruno Haible sigsegv: Fix build on some more embedded CPUs. diff --git a/lib/intprops.h b/lib/intprops.h index 3fe64e82e9..b36e0bbed9 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -249,11 +249,12 @@ /* True if __builtin_add_overflow_p (A, B, C) works, and similarly for __builtin_sub_overflow_p and __builtin_mul_overflow_p. */ -#if defined __clang__ || defined __ICC +#if defined __clang__ || defined __ICC || defined __EDG__ /* Clang 11 lacks __builtin_mul_overflow_p, and even if it did it - would presumably run afoul of Clang bug 16404. ICC 2021.1's - __builtin_add_overflow_p etc. are not treated as integral constant - expressions even when all arguments are. */ + would presumably run afoul of Clang bug 16404. In ICC 2021.1 and + the EDG-based MCST Elbrus LCC compiler, __builtin_add_overflow_p etc. + are not treated as integral constant expressions even when all + arguments are. */ # define _GL_HAS_BUILTIN_OVERFLOW_P 0 #elif defined __has_builtin # define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p) -- 2.39.5