public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100442] New: Spurious -Wstringop-overread error with odd boundaries
@ 2021-05-06  6:09 andres at anarazel dot de
  2021-05-06  8:54 ` [Bug tree-optimization/100442] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: andres at anarazel dot de @ 2021-05-06  6:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100442

            Bug ID: 100442
           Summary: Spurious -Wstringop-overread error with odd boundaries
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andres at anarazel dot de
  Target Milestone: ---

Hi,

When compiling one of postgres' source files with -O3 I see the following:

gcc-11 -O3 -Wall -o /dev/null -c tsvector_op.i

In function 'tsCompareString',
    inlined from 'tsCompareString' at
/home/andres/src/postgresql/src/backend/utils/adt/tsvector_op.c:1147:1,
    inlined from 'tsvector_bsearch' at
/home/andres/src/postgresql/src/backend/utils/adt/tsvector_op.c:410:9:
/home/andres/src/postgresql/src/backend/utils/adt/tsvector_op.c:1164:23:
warning: 'memcmp' specified bound [18446744073709551612, 18446744073709551615]
exceeds maximum object size 9223372036854775807 [-Wstringop-overread]
 1164 |                 cmp = memcmp(a, b, Min(lena, lenb));
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                   

which does not seem plausible ;). As far as I can tell the values actually
passed to memcmp are reasonable.

I've attached both the preprocessed source file. I tried to reduce it using
creduce - but it hung and reported a bug (which I did, an hour ago).

andres@awork3:~/src/postgresql$ gcc-11 --version
gcc-11 (Debian 11.1.0-1) 11.1.0

This also happens with gcc-10 (except reported as -Wstringop-overflow=), but
not 9.


Regards,

Andres

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-15 22:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  6:09 [Bug c/100442] New: Spurious -Wstringop-overread error with odd boundaries andres at anarazel dot de
2021-05-06  8:54 ` [Bug tree-optimization/100442] " pinskia at gcc dot gnu.org
2021-05-06  9:45 ` andres at anarazel dot de
2021-05-06 15:39 ` msebor at gcc dot gnu.org
2022-02-15 22:54 ` andres at anarazel dot de

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).