This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] hppa: fix __O_SYNC to match the kernel
- From: John David Anglin <dave dot anglin at bell dot net>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org, carlos at systemhalted dot org
- Date: Sun, 1 Mar 2015 14:55:09 -0500
- Subject: Re: [PATCH] hppa: fix __O_SYNC to match the kernel
- Authentication-results: sourceware.org; auth=none
- References: <1424755185-27627-1-git-send-email-vapier at gentoo dot org> <BLU436-SMTP185F8B8082D09E2C4A6E5EF97160 at phx dot gbl> <20150227065339 dot GO29461 at vapier>
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
>> the Debian glibc
>> patches and see what else needs sending.
> this should be an easy one:
I started to write a ChangeLog entry and realized that there is a problem with the change
to feholdexcept.c. I believe the second set of bufptr needs to be removed.
> if you could provide context, i could shepherd it through.
The patch is intended to fix problems in accessing and updating the floating-point status register
and exception registers.
Originally, the routines were written to save and restore the status register and the entire set of
(all seven) exception registers. At some point, the code was changed to just manipulate the status
register and the first exception register. A couple of bugs were introduced when this was done.
In fesetenv.c, the post increment of bufptr was retained in the first asm but the constraint for it
does not indicate that bufptr is modified. As a result, GCC miscompiled fesetenv. 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 the code was changed
to only update the status and first exception registers. The offset used in the statement is also off
by a factor two, so it probably never worked correctly. With the current patch, the code loads zero to
the status and exception register. As a result, the T bit is not set properly.
I will test a revised change to feholdexcept and get back to you.
John David Anglin email@example.com