[Bug tree-optimization/105726] [10/11 Regression] spurious warning with -Warray-bounds
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 15 08:59:26 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105726
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:d76c15430f74024f1658be55cfcd2ed9f581f1bd
commit r11-10069-gd76c15430f74024f1658be55cfcd2ed9f581f1bd
Author: Richard Biener <rguenther@suse.de>
Date: Wed May 25 11:49:03 2022 +0200
tree-optimization/105726 - adjust array bound heuristic
There's heuristic to detect ptr[1].a[...] out of bound accesses
reasoning that if ptr points to an array of aggregates a trailing
incomplete array has to have size zero. The following more
thoroughly constrains the cases this applies to avoid false
positive diagnostics.
2022-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/105726
* gimple-ssa-warn-restrict.c (builtin_memref::set_base_and_offset):
Constrain array-of-flexarray case more.
* g++.dg/warn/Warray-bounds-27.C: New testcase.
(cherry picked from commit e7c482b08076bb299742883c4ffd65b31e33200c)
More information about the Gcc-bugs
mailing list