From patchwork Tue Oct 24 00:33:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 23773 Received: (qmail 27950 invoked by alias); 24 Oct 2017 00:34:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 27936 invoked by uid 89); 24 Oct 2017 00:34:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Tue, 24 Oct 2017 00:33:58 +0000 From: Joseph Myers To: Subject: Update x86 fix-fp-int-compare-invalid.h for GCC 8 [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) The glibc implementation of iseqsig relies on ordered comparison operators raising the "invalid" exception for quiet NaN operands, with a workaround on platforms where a GCC bug means that exception is not raised. For x86, that bug has now been fixed for GCC 8, so this patch disables the workaround in that case. If and when the corresponding bugs for powerpc and s390 are fixed, the headers for those platforms should of course be updated similarly. Tested for x86_64 and x86, including with GCC mainline. Note that other failures appear with GCC mainline because of spurious use of ordered comparison instructions for unordered operations . Committed. 2017-10-24 Joseph Myers * sysdeps/x86/fpu/fix-fp-int-compare-invalid.h (FIX_COMPARE_INVALID): Define to 0 if [__GNUC_PREREQ (8, 0)]. diff --git a/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h b/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h index bda247d..842c945 100644 --- a/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h +++ b/sysdeps/x86/fpu/fix-fp-int-compare-invalid.h @@ -20,9 +20,13 @@ #ifndef FIX_FP_INT_COMPARE_INVALID_H #define FIX_FP_INT_COMPARE_INVALID_H 1 -/* As of GCC 5, both x87 and SSE comparisons use unordered comparison +/* Before GCC 8, both x87 and SSE comparisons use unordered comparison instructions when they should use ordered comparisons . */ -#define FIX_COMPARE_INVALID 1 +#if __GNUC_PREREQ (8, 0) +# define FIX_COMPARE_INVALID 0 +#else +# define FIX_COMPARE_INVALID 1 +#endif #endif /* fix-fp-int-compare-invalid.h */