]> Savannah Git Hosting - gnulib.git/commitdiff
intprops: work around nvc 22.1 bug
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 15 Jan 2022 02:50:48 +0000 (18:50 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 15 Jan 2022 02:52:03 +0000 (18:52 -0800)
Problem reported by Olivier Cessenat (Bug#53256).
* lib/intprops.h (_GL_HAS_BUILTIN_ADD_OVERFLOW) [__EDG__]:
Define to 0, since __builtin_add_overflow doesn’t work
on NVIDIA HPC SDK 22.1.

ChangeLog
lib/intprops.h

index a900fec78d57dae7f58d257057d18637c04648c9..cf22140d44ed281accc3fbc8c5d0765de920f556 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2022-01-14  Paul Eggert  <eggert@cs.ucla.edu>
 
+       intprops: work around nvc 22.1 bug
+       Problem reported by Olivier Cessenat (Bug#53256).
+       * lib/intprops.h (_GL_HAS_BUILTIN_ADD_OVERFLOW) [__EDG__]:
+       Define to 0, since __builtin_add_overflow doesn’t work
+       on NVIDIA HPC SDK 22.1.
+
        copy-file-range: work around Linux kernel bug
        This workaround is adapted from Coreutils.
        * lib/copy-file-range.c [__linux__ && HAVE_COPY_FILE_RANGE]:
index 68d6daa57067976d03deb5ae9322567121a62872..d4a917f72a0689d528f3df586d0710c0e602fc58 100644 (file)
 
 /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
    (A, B, P) work when P is non-null.  */
-#if defined __has_builtin
+#ifdef __EDG__
+/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned
+   <https://bugs.gnu.org/53256>.  */
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
+#elif defined __has_builtin
 # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
 /* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
    see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>.  */
-#elif 7 <= __GNUC__ && !defined __EDG__
+#elif 7 <= __GNUC__
 # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
 #else
 # define _GL_HAS_BUILTIN_ADD_OVERFLOW 0