[newlib-cygwin] Fix ARM fegetexceptflag.c

Richard Earnshaw rearnsha@sourceware.org
Fri Oct 17 10:30:45 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=29b8692a49e7de8c8131ab4ecff5f2ce007200c3

commit 29b8692a49e7de8c8131ab4ecff5f2ce007200c3
Author: Matt Reynolds <mreynolds@aurora.tech>
Date:   Thu Oct 16 22:08:34 2025 +0000

    Fix ARM fegetexceptflag.c
    
    The ARM fegetexceptflag() implementation was accidentally replaced with
    fesetexceptflag() during refactoring in b7a6e02dc6a5289bfa489c0e7b6539abd281e2c6.
    Restore the original implementation.
    
    Tested on Cortex-M7.

Diff:
---
 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);
 }


More information about the Newlib-cvs mailing list