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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<r...@gcc.gnu.org>:

https://gcc.gnu.org/g:d1929ba18c1e4f0fa4212ec2181f8345896bb7e8

commit r13-9487-gd1929ba18c1e4f0fa4212ec2181f8345896bb7e8
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Fri Mar 28 15:41:41 2025 +0000

    libstdc++: Fix -Wstringop-overread warning in std::vector<bool> [PR114758]

    As in r13-4393-gcca06f0d6d76b0 and a few other commits, we can avoid
    bogus warnings in std::vector<bool> by hoisting some loads to before the
    allocation that calls operator new. This means that the compiler has
    enough info to remove the dead branches that trigger bogus warnings.

    On trunk this is only needed with -fno-assume-sane-operators-new-delete
    but it will help on the branches where that option doesn't exist.

    libstdc++-v3/ChangeLog:

            PR libstdc++/114758
            * include/bits/vector.tcc (vector<bool, A>::_M_fill_insert):
            Hoist loads of begin() and end() before allocation.
            * testsuite/23_containers/vector/bool/capacity/114758.cc: New
            test.

    Reviewed-by: Tomasz KamiÅski <tkami...@redhat.com>

    (cherry picked from commit 1f6c19f307c8de9830130a0ba071c24e3835beb3)
  • [Bug libstdc++/114758] [13 Regr... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to