ToT build error with ToT GCC on Aarch64
Jeff Law
law@redhat.com
Mon Jul 23 20:36:00 GMT 2018
On 07/23/2018 02:31 PM, Jeff Law wrote:
> On 07/23/2018 12:51 PM, Martin Sebor wrote:
>> On 07/23/2018 12:29 PM, Martin Sebor wrote:
>>> On 07/23/2018 11:26 AM, Florian Weimer wrote:
>>>> On 07/23/2018 06:19 PM, Jeff Law wrote:
>>>>> On 07/23/2018 09:51 AM, Steve Ellcey wrote:
>>>>>> I have run into a problem when building the ToT glibc with the ToT
>>>>>> GCC on
>>>>>> Aarch64. I haven't dug into this enough to know if this is a GCC
>>>>>> problem,
>>>>>> a glibc problem, or just a message that needs to be ignored but I
>>>>>> wanted to
>>>>>> send out an email in case this is something that needs to be addressed
>>>>>> before GCC 2.28 is released.
>>>>
>>>>> Martin S. and I are already looking at this and I've already asked
>>>>> Martin to bring in Carlos and Florian.
>>>>
>>>> Would it be possible to print the full inlining stack for these GCC
>>>> warnings? I don't see a %K format specifier (or whatever is used for
>>>> this).
>>>>
>>>> I think it would make it a bit easier to track these down.
>>>
>>> It's one of my own pet peeves with the -Warray-bounds warnings
>>> that they don't do that. I've quickly hacked GCC to print
>>> the inlining stack. It doesn't look to me like it helps that
>>> much but I'll let you be the judge:
>>>
>>> In file included from fnmatch.c:244:
>>> In function âfindidxwcâ,
>>> Â Â Â inlined from âinternal_fnwmatchâ at fnmatch_loop.c:404:10:
>>> ../locale/weightwc.h:124:28: warning: array subscript 1 is outside array
>>> bounds of âwint_t[1]â {aka âunsigned int[1]â} [-Warray-bounds]
>>
>> Here's a bit more context showing the variable being referenced
>> (for simplicity, GCC takes singleton objects as arrays of one
>> element):
>>
>> In file included from fnmatch.c:244:
>> In function âfindidxwcâ,
>> Â Â Â inlined from âinternal_fnwmatchâ at fnmatch_loop.c:404:10:
>> ../locale/weightwc.h:124:28: error: array subscript 1 is outside array
>> bounds of âwint_t[1]â {aka âunsigned int[1]â} [-Werror=array-bounds]
>> Â Â Â if (cp[nhere - 1] > usrc[nhere -1])
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ~~~~^~~~~~~~~~
>> In file included from fnmatch.c:315:
>> fnmatch_loop.c: In function âinternal_fnwmatchâ:
>> fnmatch_loop.c:342:13: note: while referencing âstrâ
>> Â Â Â Â Â Â UCHAR str;
>> Â Â Â Â Â Â Â Â Â Â Â Â ^~~
>>
>> There's an interesting comment above the declaration:
>>
>> Â Â Â /* It's important that STR be a scalar variable rather
>> Â Â Â Â Â Â than a one-element array, because GCC (at least 4.9.2
>> Â Â Â Â Â Â -O2 on x86-64) can be confused by the array and
>> Â Â Â Â Â Â diagnose a "used initialized" in a dead branch in the
>>       findidx function. */
>> Â Â Â UCHAR str;
> And it gets even more interesting if you dig into the history of this code.
>
> https://sourceware.org/ml/libc-alpha/2014-11/msg00459.html
>
> The implication is this is dead code in the case we're looking at.
>
> I wonder if the solution here is to disable the oob warning along with
> the uninit warning.
A key follow-up from Joseph (easy to get lost in the thread...)
https://sourceware.org/ml/libc-alpha/2014-11/msg00616.html
https://sourceware.org/ml/libc-alpha/2014-11/msg00635.html
Leading to...
https://sourceware.org/ml/libc-alpha/2014-11/msg00639.html
Jeff
More information about the Libc-alpha
mailing list