This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Warnings in string/stratcliff.c, wcsmbs/wcsatcliff.c with GCC 7 -O3
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sun, 20 Aug 2017 09:50:38 -0700
- Subject: Re: Warnings in string/stratcliff.c, wcsmbs/wcsatcliff.c with GCC 7 -O3
- Authentication-results: sourceware.org; auth=none
- References: <ddc73696-7ae8-a98f-1d51-18ed4f758b92@linux.vnet.ibm.com> <c6790ccf-f792-d863-c73a-3cd288659713@linux.vnet.ibm.com> <009080d7-9a74-419f-344f-e24aa25a115a@linux.vnet.ibm.com>
On Thu, Mar 23, 2017 at 4:16 AM, Stefan Liebler <stli@linux.vnet.ibm.com> wrote:
> On 03/22/2017 03:53 PM, Wainer dos Santos Moschetta wrote:
>>
>>
>> On 03/22/2017 11:29 AM, Stefan Liebler wrote:
>>>
>>> Hi,
>>>
>>> Compiling string/stratcliff.c with GCC 7 and -O3 leads to the following
>>> warning/errors on s390x / x86_64:
>>> ../test-skeleton.c: In function ‘legacy_test_function’:
>>> cc1: error: assuming signed overflow does not occur when assuming that (X
>>> - c) <= X is always true [-Werror=strict-overflow]
>>
>>
>> https://sourceware.org/ml/libc-alpha/2017-03/msg00422.html
>> Could you give a try with above patch in?
>>
>> It updates the string tests to the support test driver. Above error occurs
>> in the legacy test skeleton. Otherwise the support test-driver will need a
>> fix too.
>>
>
> The error does not occur in the legacy test skeleton. Instead one of the
> errors occur in do_test in string/stratcliff.c around line 96:
> /* strlen/wcslen test */
> for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
> {
> for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
> {
>
> I've applied your patch and build the test with GCC 7 -O3:
> stratcliff.c: In function ‘do_test’:
> cc1: error: assuming signed overflow does not occur when assuming that (X -
> c) <= X is always true [-Werror=strict-overflow]
> ...
I opened:
https://sourceware.org/bugzilla/show_bug.cgi?id=21982
--
H.J.