https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109438
Bug ID: 109438 Summary: Excessive Duplication of -Wanalyzer-out-of-bounds warnings Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: priour.be at gmail dot com CC: priour.be at gmail dot com Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Build: 13.0.1 20230328 (experimental) The reproducer below demonstrates an excessive duplication of the same warning -Wanalyzer-out-of-bounds. The warning appears duplicated thrice, at points (1), (2) and (3), yet none appear at (4) (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109437) See https://godbolt.org/z/Tcrv8h614 for live warnings on trunk, both gcc and g++. int consecutive_oob_in_frame () // one warning from analysis of initial EN { int arr[] = {1,2,3,4,5,6,7}; int y1 = arr[9]; // injurious line (1) return y1; } int goo () { int x = consecutive_oob_in_frame (); // causes another warning (2) return 2 * x; } int main () { goo (); // causes another warning (3) consecutive_oob_in_frame (); // silent (4) return 0; } Currently the expected behavior would be to see it appear whenever when consecutive_oob_in_frame is called directly. It means that the above should rather emits at points (2) and (4).