From albin.ahlback at gmail.com Tue Sep 3 11:58:51 2024 From: albin.ahlback at gmail.com (=?UTF-8?Q?Albin_Ahlb=C3=A4ck?=) Date: Tue, 3 Sep 2024 11:58:51 +0200 Subject: Bug in Clang on macOS related to __builtin_subc Message-ID: <494c6ebc-8e6d-458d-b6aa-7e26ee6622fe@gmail.com> Hello, In FLINT, we recently got a bug report related to our `longlong.h` header yielding incorrect results on ARM64 macOS [1]. The problem seems to be a compiler bug with __builtin_subc, an intrinsic for subtraction with borrow, on the following version of Clang and XCode: $ clang --version Apple clang version 14.0.3 (clang-1403.0.22.14.1) Target: arm64-apple-darwin22.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin $ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables package-id: com.apple.pkg.CLTools_Executables version: 14.3.1.0.1.1683849156 volume: / location: / install-time: 1707543067 I know this intrinsics is neither in GMP nor MPFR, but I know it is in MPFR's TODO list. Thought I'd just let you know. Best, Albin [1]: https://github.com/flintlib/flint/issues/2048