When compiling for powerpc (classic hard-float), floating-point compares always use the fcmpu instructions that don't raise exceptions for unordered operands, never the exception-raising fcmpo variants. The correct behavior is to raise exceptions for comparisons such as "x < y", but not for "x == y" or "__builtin_isless (x, y)".
This is language-dependent. And the comparison insn must know which condition codes will be tested.
*** Bug 83759 has been marked as a duplicate of this bug. ***
Author: seurer Date: Tue Jan 30 16:51:14 2018 New Revision: 257190 URL: https://gcc.gnu.org/viewcvs?rev=257190&root=gcc&view=rev Log: [PATCH, rs6000] pr58684, pr83759 xfail test cases that fail on powerpc64. This patch xfails a few test cases on powerpc64 that fail after r256380 due to a longstanding issue with floating-point compares. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58684 for more information. 2018-01-30 Bill Seurer <seurer@linux.vnet.ibm.com> PR 58684 * gcc/testsuite/gcc.dg/torture/inf-compare-1.c: Add xfail. * gcc/testsuite/gcc.dg/torture/inf-compare-2.c: Add xfail. * gcc/testsuite/gcc.dg/torture/inf-compare-3.c: Add xfail. * gcc/testsuite/gcc.dg/torture/inf-compare-4.c: Add xfail. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/torture/inf-compare-1.c trunk/gcc/testsuite/gcc.dg/torture/inf-compare-2.c trunk/gcc/testsuite/gcc.dg/torture/inf-compare-3.c trunk/gcc/testsuite/gcc.dg/torture/inf-compare-4.c
I have a patch.
*** Bug 84366 has been marked as a duplicate of this bug. ***
Patch at https://gcc.gnu.org/ml/gcc-patches/2018-03/msg01405.html .
Can the bug be marked as resolved?
I see no sign of Segher's patch to fix the bug (as opposed to some XFAILs pending a fix) having been committed, and a trivial testcase still generates fcmpu instructions with a compiler from yesterday, so no.
It is not resolved yet no. That patch has some biggish issues still.
*** Bug 91331 has been marked as a duplicate of this bug. ***
The master branch has been updated by Alexandre Oliva <aoliva@gcc.gnu.org>: https://gcc.gnu.org/g:6e95dca31c6b4688e0f0a25c9c3aa8a0bedc9056 commit r15-20-g6e95dca31c6b4688e0f0a25c9c3aa8a0bedc9056 Author: Alexandre Oliva <oliva@adacore.com> Date: Sun Apr 28 04:30:24 2024 -0300 xfail fetestexcept test - ppc always uses fcmpu gcc.dg/torture/pr91323.c tests that a compare with NaNf doesn't set an exception using builtin compare intrinsics, and that it does when using regular compare operators. That doesn't seem to be expected to work on powerpc targets. It fails on GNU/Linux, it's marked to be skipped on AIX, and a similar test, gcc.dg/torture/pr93133.c, has the execution test xfailed for all of powerpc*-*-*. In this test, the functions that use intrinsics for the compare end up with the same code as the one that uses compare operators, using fcmpu, a floating compare that, unlike fcmpo, does not set the invalid operand exception for quiet NaN. I couldn't find any evidence that the rs6000 backend ever outputs fcmpo. Therefore, I'm adding the same execution xfail marker to this test. for gcc/testsuite/ChangeLog PR target/58684 * gcc.dg/torture/pr91323.c: Expect execution fail on powerpc*-*-*.