This is the mail archive of the libc-alpha@sourceware.org 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: Warnings in string/stratcliff.c, wcsmbs/wcsatcliff.c with GCC 7 -O3


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.


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