From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 24F75383F849; Sun, 30 Aug 2020 12:30:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24F75383F849 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: math/modfl.c: Fix segment faults in modfl(). X-Act-Checkin: newlib-cygwin X-Git-Author: Liu Hao X-Git-Refname: refs/heads/master X-Git-Oldrev: ec9734dbb5f7be24d9ea9cc5873d98d2b29087d4 X-Git-Newrev: 0e6690a92ccda8b2d6a759bc1649c6160137d170 Message-Id: <20200830123020.24F75383F849@sourceware.org> Date: Sun, 30 Aug 2020 12:30:20 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Aug 2020 12:30:20 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0e6690a92ccda8b2d6a759bc1649c6160137d170 commit 0e6690a92ccda8b2d6a759bc1649c6160137d170 Author: Liu Hao 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 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