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