https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0e6690a92ccda8b2d6a759bc1649c6160137d170
commit 0e6690a92ccda8b2d6a759bc1649c6160137d170 Author: Liu Hao <[email protected]> Date: Sun Aug 30 13:56:31 2020 +0200 Cygwin: math/modfl.c: Fix segment faults in modfl(). Reference: https://sourceforge.net/p/mingw-w64/bugs/478/ Signed-off-by: Liu Hao <[email protected]> Diff: --- winsup/cygwin/math/modfl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/math/modfl.c b/winsup/cygwin/math/modfl.c index af75a8b8c..ef1ab16ce 100644 --- a/winsup/cygwin/math/modfl.c +++ b/winsup/cygwin/math/modfl.c @@ -21,7 +21,7 @@ modfl (long double value, long double* iptr) "fldcw (%%rsp)\n" "frndint\n" "fldcw 4(%%rsp)\n" - "addq $8, %%rsp\n" : "=t" (int_part) : "0" (value)); /* round */ + "addq $8, %%rsp\n" : "=t" (int_part) : "0" (value) : "eax"); /* round */ #elif defined(_X86_) || defined(__i386__) asm ("push %%eax\n\tsubl $8, %%esp\n" "fnstcw 4(%%esp)\n" @@ -31,7 +31,7 @@ modfl (long double value, long double* iptr) "fldcw (%%esp)\n" "frndint\n" "fldcw 4(%%esp)\n" - "addl $8, %%esp\n\tpop %%eax\n" : "=t" (int_part) : "0" (value)); /* round */ + "addl $8, %%esp\n\tpop %%eax\n" : "=t" (int_part) : "0" (value) : "eax"); /* round */ #else int_part = truncl(value); #endif
