From: "H.J. Lu" <hjl.tools@gmail.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: GNU C Library <libc-alpha@sourceware.org>,
Jonathan Wakely <jwakely@redhat.com>,
Joseph Myers <joseph@codesourcery.com>
Subject: Re: [PATCH v2] Suppress -Wcast-qual warnings in bsearch
Date: Thu, 30 Sep 2021 10:54:40 -0700 [thread overview]
Message-ID: <CAMe9rOo197V4v+_kt26ac6pEbdfEZjDaab9FrUC01NNBumeL=g@mail.gmail.com> (raw)
In-Reply-To: <069fcec4-d81f-3ea8-d87c-ff3b281dbe71@linaro.org>
On Thu, Sep 30, 2021 at 7:49 AM Adhemerval Zanella via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
>
>
> On 30/09/2021 07:43, Florian Weimer via Libc-alpha wrote:
> > * Jonathan Wakely via Libc-alpha:
> >
> >> diff --git a/bits/stdlib-bsearch.h b/bits/stdlib-bsearch.h
> >> index 4132dc6af0..d688ed2e15 100644
> >> --- a/bits/stdlib-bsearch.h
> >> +++ b/bits/stdlib-bsearch.h
> >> @@ -29,14 +29,21 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
> >> while (__l < __u)
> >> {
> >> __idx = (__l + __u) / 2;
> >> - __p = (void *) (((const char *) __base) + (__idx * __size));
> >> + __p = (const void *) (((const char *) __base) + (__idx * __size));
> >> __comparison = (*__compar) (__key, __p);
> >> if (__comparison < 0)
> >> __u = __idx;
> >> else if (__comparison > 0)
> >> __l = __idx + 1;
> >> else
> >> +#if __GNUC_PREREQ(4, 6)
> >> +# pragma GCC diagnostic push
> >> +# pragma GCC diagnostic ignored "-Wcast-qual"
> >> +#endif
> >> return (void *) __p;
> >> +#if __GNUC_PREREQ(4, 6)
> >> +# pragma GCC diagnostic pop
> >> +#endif
> >> }
> >>
> >> return NULL;
> >
> > Patch looks okay, thanks.
> >
> > Reviewed-by: Florian Weimer <fweimer@redhat.com>
> >
> > Florian
> >
>
> I am seeing a lot of failure on x86_64 with gcc 11.1 after this
> patch landed:
>
> x86_64-linux-gnu$ grep ^FAIL tests.sum
> FAIL: catgets/de/libc.cat
> FAIL: catgets/test-gencat
> FAIL: catgets/test1.cat
> FAIL: catgets/tst-catgets
> FAIL: debug/tst-chk1
> FAIL: debug/tst-chk2
> FAIL: debug/tst-chk3
> FAIL: debug/tst-chk4
> FAIL: debug/tst-chk5
> FAIL: debug/tst-chk6
> FAIL: debug/tst-lfschk1
> FAIL: debug/tst-lfschk2
> FAIL: debug/tst-lfschk3
> FAIL: debug/tst-lfschk4
> FAIL: debug/tst-lfschk5
> FAIL: debug/tst-lfschk6
> [...]
>
> For instance some math tests shows ulps failures that does not
> make much sense:
>
> $ ./testrun.sh math/test-double-cacos
> testing double (without inline functions)
> Failure: Test: Imaginary part of: cacos_downward (-0x1p-52 - 0x1.0000000000001p+0 i)
> Result:
> is: 8.8137358701954271e-01 0x1.c34366179d424p-1
> should be: 8.8137358701954315e-01 0x1.c34366179d428p-1
> difference: 4.4408920985006261e-16 0x1.0000000000000p-51
> ulp : 4.0000
> max.ulp : 3.0000
> Failure: Test: Imaginary part of: cacos_downward (-0x1p-52 - 0x1.000002p+0 i)
> Result:
> is: 8.8137367131323707e-01 0x1.c34368ebb10d9p-1
> should be: 8.8137367131323751e-01 0x1.c34368ebb10ddp-1
> difference: 4.4408920985006261e-16 0x1.0000000000000p-51
> ulp : 4.0000
> max.ulp : 3.0000
> [...]
>
> Reverting fixes it.
I opened:
https://sourceware.org/bugzilla/show_bug.cgi?id=28400
I think the patch should be reverted.
--
H.J.
next prev parent reply other threads:[~2021-09-30 17:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 14:14 [PATCH] " Jonathan Wakely
2021-05-19 15:37 ` Joseph Myers
2021-05-19 15:50 ` Jonathan Wakely
2021-06-01 10:09 ` [PATCH v3] " Jonathan Wakely
2021-09-30 9:22 ` [PATCH v2] " Jonathan Wakely
2021-09-30 10:43 ` Florian Weimer
2021-09-30 14:49 ` Adhemerval Zanella
2021-09-30 15:07 ` Joseph Myers
2021-09-30 15:19 ` Adhemerval Zanella
2021-09-30 15:30 ` Andreas Schwab
2021-09-30 16:41 ` Florian Weimer
2021-09-30 16:42 ` Joseph Myers
2021-09-30 16:52 ` Jonathan Wakely
2021-09-30 17:54 ` H.J. Lu [this message]
2021-09-30 18:04 ` Florian Weimer
2021-09-30 18:09 ` H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMe9rOo197V4v+_kt26ac6pEbdfEZjDaab9FrUC01NNBumeL=g@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=adhemerval.zanella@linaro.org \
--cc=joseph@codesourcery.com \
--cc=jwakely@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).