From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31057 invoked by alias); 14 May 2013 17:17:48 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 31043 invoked by uid 89); 14 May 2013 17:17:48 -0000 X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_FM,TW_MX autolearn=no version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 14 May 2013 17:17:47 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UcIrB-0007E2-Rj from joseph_myers@mentor.com for libc-ports@sourceware.org; Tue, 14 May 2013 10:17:45 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 14 May 2013 10:17:45 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Tue, 14 May 2013 18:17:44 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1UcIr9-0005c3-01 for libc-ports@sourceware.org; Tue, 14 May 2013 17:17:43 +0000 Date: Tue, 14 May 2013 17:17:00 -0000 From: "Joseph S. Myers" To: Subject: Stop ARM setjmp/longjmp saving/restoring fpscr (bug 14908) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-05/txt/msg00059.txt.bz2 This patch fixes bug 14908, ARM setjmp/longjmp wrongly saving and restoring fpscr. Tested in conjunction with my libc patch to add a testcase for this issue; will commit once the libc testcase is in. 2013-05-14 Joseph Myers [BZ #14908] * sysdeps/arm/setjmp.S (__sigsetjmp): Don't save fpscr. * sysdeps/arm/__longjmp.S (__longjmp): Don't restore fpscr. * sysdeps/arm/bits/setjmp.h (__jmp_buf): Don't mention fpscr in comment. diff --git a/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S index 8de9fa1..a5edede 100644 --- a/ports/sysdeps/arm/__longjmp.S +++ b/ports/sysdeps/arm/__longjmp.S @@ -83,11 +83,6 @@ ENTRY (__longjmp) /* Following instruction is vldmia ip!, {d8-d15}. */ sfi_breg r12, \ ldc p11, cr8, [\B], #64 - /* Restore the floating-point status register. */ - sfi_breg ip, \ - ldr a3, [\B], #4 - /* Following instruction is fmxr fpscr, a3. */ - mcr p10, 7, a3, cr1, cr0, 0 .Lno_vfp: #ifndef ARM_ASSUME_NO_IWMMXT diff --git a/ports/sysdeps/arm/bits/setjmp.h b/ports/sysdeps/arm/bits/setjmp.h index 21bbf7f..c8c3a9a 100644 --- a/ports/sysdeps/arm/bits/setjmp.h +++ b/ports/sysdeps/arm/bits/setjmp.h @@ -28,9 +28,9 @@ /* The exact set of registers saved may depend on the particular core in use, as some coprocessor registers may need to be saved. The C Library ABI requires that the buffer be 8-byte aligned, and - recommends that the buffer contain 64 words. The first 28 words - are occupied by v1-v6, sl, fp, sp, pc, d8-d15, and fpscr. (Note - that d8-15 require 17 words, due to the use of fstmx.) */ + recommends that the buffer contain 64 words. The first 27 words + are occupied by v1-v6, sl, fp, sp, pc, and d8-d15. (Note that + d8-15 require 17 words, due to the use of fstmx.) */ typedef int __jmp_buf[64] __attribute__((__aligned__ (8))); #endif diff --git a/ports/sysdeps/arm/setjmp.S b/ports/sysdeps/arm/setjmp.S index f750470..a6c161d 100644 --- a/ports/sysdeps/arm/setjmp.S +++ b/ports/sysdeps/arm/setjmp.S @@ -67,11 +67,6 @@ ENTRY (__sigsetjmp) /* Following instruction is vstmia ip!, {d8-d15}. */ sfi_breg ip, \ stc p11, cr8, [\B], #64 - /* Store the floating-point status register. */ - /* Following instruction is vmrs a4, fpscr. */ - mrc p10, 7, a4, cr1, cr0, 0 - sfi_breg ip, \ - str a4, [\B], #4 .Lno_vfp: #ifndef ARM_ASSUME_NO_IWMMXT -- Joseph S. Myers joseph@codesourcery.com