This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] hppa: fix __O_SYNC to match the kernel

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 
>> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]