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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
            Summary|-Wanalyzer-out-of-bounds    |-Wanalyzer-out-of-bounds
                   |false negative with `return |false negative with `return
                   |l_1322[9];`                 |l_1322[9];` at -O1 and
                   |                            |above
   Last reconfirmed|                            |2023-09-06

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug.

This looks similar to bug 111213.

Adding -fdump-ipa-analyzer=stderr shows that at -O1 and above, the entire body
of the function is optimized away before the analyzer even sees it (presumably
due to undefined behavior).

My hypothesis is that the optimizer sees the undefined behavior and optimizes
the function away (but I haven't checked the details).

If that's the case, that's a strong argument that the analyzer should run
earlier. I'll open a bug about that.

Reply via email to