[PATCH] Fix ARM fegetexceptflag.c

Matt Reynolds mreynolds@aurora.tech
Thu Oct 16 22:08:34 GMT 2025


The ARM fegetexceptflag() implementation was accidentally replaced with
fesetexceptflag() during refactoring in 3ca43259686187e081d317e2b406724a849c9d7b.
Restore the original implementation.

Tested on Cortex-M7.
---
 newlib/libm/machine/arm/fegetexceptflag.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/newlib/libm/machine/arm/fegetexceptflag.c b/newlib/libm/machine/arm/fegetexceptflag.c
index 2bfcb08ae..17b3a3d7d 100644
--- a/newlib/libm/machine/arm/fegetexceptflag.c
+++ b/newlib/libm/machine/arm/fegetexceptflag.c
@@ -37,9 +37,7 @@ int fegetexceptflag(fexcept_t *flagp, int excepts)
 	fexcept_t __fpsr;
 
 	vmrs_fpscr(__fpsr);
-	__fpsr &= ~excepts;
-	__fpsr |= *flagp & excepts;
-	vmsr_fpscr(__fpsr);
+	*flagp = __fpsr & excepts;
 #endif
 	return (0);
 }
-- 
2.34.1



More information about the Newlib mailing list