[Bug tree-optimization/126733] New: [16/17 Regression] -Warray-bounds false positive under -finline-small-functions

"gnu.ojxq8 at dralias dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126733

            Bug ID: 126733
           Summary: [16/17 Regression] -Warray-bounds false positive under
                    -finline-small-functions
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gnu.ojxq8 at dralias dot com
  Target Milestone: ---

The minimal reproducer code comes from a fuzz target loop, where the resize
call could be called several times.

Flags to repro:

-O3 or
-O1 -finline-small-functions --param early-inlining-insns=8 -std=c++11 -Wall
-Wextra -Warray-bounds

Code to repro:

#include <vector>
// Minimal repro; Reduced from a fuzz loop
void fuzz_target() {
    std::vector<unsigned char> data;
    for (int i = 8; i > 0; --i) {
        data.resize(1);
    }
}


https://godbolt.org/z/h93vhrq9b
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.