diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-11-29 15:50:06 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-11-29 17:01:32 +0000 |
commit | cca06f0d6d76b08ed4ddb7667eda93e2e9f2589e (patch) | |
tree | 3e22e09174f7995e1cb27b3e830aca9e419d170a /gcc/fortran/simplify.cc | |
parent | 81cf0354d5f81f2c7600a3bc7ae4600757286995 (diff) | |
download | gcc-cca06f0d6d76b08ed4ddb7667eda93e2e9f2589e.zip gcc-cca06f0d6d76b08ed4ddb7667eda93e2e9f2589e.tar.gz gcc-cca06f0d6d76b08ed4ddb7667eda93e2e9f2589e.tar.bz2 |
libstdc++: Avoid bogus warning in std::vector::insert [PR107852]
GCC assumes that any global variable might be modified by operator new,
and so in the testcase for this PR all data members get reloaded after
allocating new storage. By making local copies of the _M_start and
_M_finish members we avoid that, and then the compiler has enough info
to remove the dead branches that trigger bogus -Warray-bounds warnings.
libstdc++-v3/ChangeLog:
PR libstdc++/107852
PR libstdc++/106199
PR libstdc++/100366
* include/bits/vector.tcc (vector::_M_fill_insert): Copy
_M_start and _M_finish members before allocating.
(vector::_M_default_append): Likewise.
(vector::_M_range_insert): Likewise.
Diffstat (limited to 'gcc/fortran/simplify.cc')
0 files changed, 0 insertions, 0 deletions