[Bug tree-optimization/86223] missing -Warray-bounds on an access to an implicitly zeroed out array
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 21 08:51:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86223
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-06-21
CC| |rguenth at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
We gimplify g to
a = {};
_2 = a[i];
but h to
a[0] = 0;
a[1] = 0;
a[2] = 0;
_2 = a[i];
that is IMHO a missed optimization. With the g IL we fold a[i] to zero
while with the h IL we do not (that's somewhat inconsistent I agree).
If you do
int a[3] = { 1 };
you get the desired warning.
More information about the Gcc-bugs
mailing list