From 469026a8a3ed5582a66c47057c4c10dacb398476 Mon Sep 17 00:00:00 2001 From: Brandon Bergren Date: Sun, 2 Feb 2020 19:16:52 +0000 Subject: [PATCH] [PowerPC] Fix feholdexcept() on powerpc referencing the wrong struct member In r355656, endianness handling of the floating point environment was fixed in the PowerPC code to work as intended. However, one bit got missed, causing feholdexcept() to mis-save the fenv. Submitted by: Renato Riolino Differential Revision: https://reviews.freebsd.org/D23382 --- lib/msun/powerpc/fenv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msun/powerpc/fenv.h b/lib/msun/powerpc/fenv.h index 3e2a11c48c50..22bc4e0f902f 100644 --- a/lib/msun/powerpc/fenv.h +++ b/lib/msun/powerpc/fenv.h @@ -217,7 +217,7 @@ feholdexcept(fenv_t *__envp) union __fpscr __r; __mffs(&__r); - *__envp = __r.__d; + *__envp = __r.__bits.__reg; __r.__bits.__reg &= ~(FE_ALL_EXCEPT | _ENABLE_MASK); __mtfsf(__r); return (0);