]> Savannah Git Hosting - gnulib.git/commitdiff
intprops: Treat EDG-based compilers like Intel compilers.
authorBruno Haible <bruno@clisp.org>
Mon, 6 Dec 2021 16:47:05 +0000 (17:47 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 6 Dec 2021 16:47:05 +0000 (17:47 +0100)
Reported by Ilya Kurdyukov <ilyakurdyukov@altlinux.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00028.html>.

* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P): Define to 0 on EDG-based
compilers.

ChangeLog
lib/intprops.h

index bc8da213ee56160fd1134b86bb0c789300fcaca6..52068d2aa751d1f390df265a2c96741d748320f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-12-06  Bruno Haible  <bruno@clisp.org>
+
+       intprops: Treat EDG-based compilers like Intel compilers.
+       Reported by Ilya Kurdyukov <ilyakurdyukov@altlinux.org> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00028.html>.
+       * lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P): Define to 0 on EDG-based
+       compilers.
+
 2021-12-05  Bruno Haible  <bruno@clisp.org>
 
        sigsegv: Fix build on some more embedded CPUs.
index 3fe64e82e9f547cec0f5ebfeb1879522ae560155..b36e0bbed97d22262d0d664b7ec757bc12586028 100644 (file)
 
 /* 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)