[PATCH v3] LoongArch: fix missing trap for enabled exceptions on narrowing operation
Yury Khrustalev
yury.khrustalev@arm.com
Wed Jul 8 12:58:03 GMT 2026
On Wed, Jul 08, 2026 at 07:51:19PM +0800, Xi Ruoyao wrote:
> On Tue, 2026-07-07 at 15:06 +0100, Yury Khrustalev wrote:
> >
> > ...
> >
> > This simple fix should work I think.
> >
> > diff --git a/math/test-narrowing-trap.c b/math/test-narrowing-trap.c
> > index 6d21357913..5871cb33fc 100644
> > --- a/math/test-narrowing-trap.c
> > +++ b/math/test-narrowing-trap.c
> > @@ -29,14 +29,14 @@ do_test (void)
> > �#ifdef FE_INVALID
> > �� pid_t pid;
> > �
> > -� if (!EXCEPTION_ENABLE_SUPPORTED (FE_INVALID))
> > -��� FAIL_UNSUPPORTED ("feenableexcept (FE_INVALID) not supported");
> > -
> > �� pid = xfork ();
> > �� if (pid == 0)
> > ���� {
> > ������ int r = feenableexcept (FE_INVALID);
> > �
> > +����� if (!EXCEPTION_ENABLE_SUPPORTED (FE_INVALID) && (r == -1))
>
> The parentheses around r == -1 is redundant. Otherwise OK to me.
I don't think it's redundant, it's the most meaningful part. Also other
math tests have it.
Yury
More information about the Libc-alpha
mailing list