public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: 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 11:49:32 -0300	[thread overview]
Message-ID: <069fcec4-d81f-3ea8-d87c-ff3b281dbe71@linaro.org> (raw)
In-Reply-To: <87czoq4a44.fsf@oldenburg.str.redhat.com>



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.

  reply	other threads:[~2021-09-30 14:49 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 [this message]
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
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=069fcec4-d81f-3ea8-d87c-ff3b281dbe71@linaro.org \
    --to=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).