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

            Bug ID: 106931
           Summary: -Wstringop-overflow false positive
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kasper93 at gmail dot com
  Target Milestone: ---

Created attachment 53572
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53572&action=edit
minimal test case

Hello,

I noticed increased amount of -Wstringop-overflow warnings on FFmpeg build with
gcc 12.2.0, doesn't happen with gcc 11.3.0. At first glance most of them are
bogus and happen only when specific set of compiler flags are used.

I minimized one case, see attachment, it is pretty simple. I think gcc should
handle this properly. Happens with this specific command
gcc -O3 -fno-tree-vectorize -Wstringop-overflow -c test.c

Attached case is minimized cbs_av1.c. For more cases which looks like gcc12
regression you can compile FFmpeg
./configure --enable-lto
make

Note that lto has to be enabled, without lto it doesn't produce those warnings.
I can minimize more cases, but frankly I don't want to spend time minimizing it
only to see the same pattern at the end. So maybe let's work on this first.

Tested with FFmpeg 60d8c2019f

Thanks,
Kacper

Reply via email to