From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109084 invoked by alias); 1 Mar 2015 19:55:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 109073 invoked by uid 89); 1 Mar 2015 19:55:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: BLU004-OMC1S18.hotmail.com X-TMN: [PgMZb9ji/RZmejPRvmQwHZHEGUuH8brX] Message-ID: Subject: Re: [PATCH] hppa: fix __O_SYNC to match the kernel MIME-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset="us-ascii" From: John David Anglin In-Reply-To: <20150227065339.GO29461@vapier> Date: Sun, 01 Mar 2015 19:55:00 -0000 CC: libc-alpha@sourceware.org, carlos@systemhalted.org Content-Transfer-Encoding: quoted-printable References: <1424755185-27627-1-git-send-email-vapier@gentoo.org> <20150227065339.GO29461@vapier> To: Mike Frysinger X-SW-Source: 2015-03/txt/msg00006.txt.bz2 Hi Mike, On 2015-02-27, at 1:53 AM, Mike Frysinger wrote: > On 24 Feb 2015 09:48, John David Anglin wrote: >> Mike, thanks for sending this change. Reminds me I should go through=20 >> the Debian glibc >> patches and see what else needs sending. >=20 > this should be an easy one: > https://sourceware.org/git/?p=3Dglibc.git;a=3Dcommitdiff;h=3D1c1d3f4f11b4= a911a3b6ffab0aac61d5f8e02873 I started to write a ChangeLog entry and realized that there is a problem w= ith the change to feholdexcept.c. I believe the second set of bufptr needs to be removed. >=20 > if you could provide context, i could shepherd it through. The patch is intended to fix problems in accessing and updating the floatin= g-point status register and exception registers. Originally, the routines were written to save and restore the status regist= er and the entire set of=20 (all seven) exception registers. At some point, the code was changed to ju= st manipulate the status register and the first exception register. A couple of bugs were introduce= d when this was done. In fesetenv.c, the post increment of bufptr was retained in the first asm b= ut the constraint for it does not indicate that bufptr is modified. As a result, GCC miscompiled fe= setenv. We get better code by not modifying bufptr as GCC doesn't have to reload bufptr. The main bug in feholdexcept is the second set of bufptr. This existed to = the restore the exception registers in reverse order. This statement should have been removed when t= he code was changed to only update the status and first exception registers. The offset used i= n the statement is also off by a factor two, so it probably never worked correctly. With the current p= atch, the code loads zero to the status and exception register. As a result, the T bit is not set prope= rly. I will test a revised change to feholdexcept and get back to you. Dave -- John David Anglin dave.anglin@bell.net