https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91463
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |c
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I believe the frontend should emit warnings for this kind of statically
determinable cases, VRP only runs at -O2+. It should be possible to
split out code like maybe_warn_array_bound (tree expr, bool addr_p, void
(*get_value_range) (tree name, wide_int &min, wide_int &max)) and use
that from the FE with a NULL get_value_range callback.