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: ToT build error with ToT GCC on Aarch64


On 07/23/2018 10:19 AM, 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.

Our initial read is that it's a valid warning, but neither of us knows
this code, so it's a very preliminary finding.

I spent some time reducing it to a smaller test case over
the weekend to better see what's going on here.  My reading
of the code is below but as Jeff already suggested, having
someone familiar with it either confirm it or point out what
I missed would be helpful.

internal_fnwmatch() has this:

    wint_t str;
    ...
    const wint_t *cp = (const wint_t *) &str;
    ...
    idx = findidxwc (table, indirect, extra, &cp, 1);

findidxwc (const int32_t *table, const int32_t *indirect,
           const wint_t *extra, const wint_t **cpp, size_t len)

has this (comments mine):

  wint_t ch = *(*cpp)++;   // advance *cpp past the end of &str
  ...
    const int32_t *usrc = (const int32_t *) *cpp;
    ...
    for (cnt = 0; cnt < nhere && cnt < len; ++cnt)
      if (cp[cnt] != usrc[cnt])   // access (&str + 1)[0]
         break;

It looks to me like the first and only iteration of the loop
accesses (&str + 1)[0].

Martin

PS The test case I boiled it down to is attached.

Attachment: fnmatch.c
Description: Text document


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