On Thu, Mar 09, 2023 at 10:03:20AM -0800, Andrew Pinski via Gcc-patches wrote: > The problem here is after r13-4748-g2a27ae32fabf85, in some > cases we were calling inform without a corresponding warning. > This changes the logic such that we only cause that to happen > if there was a warning happened before hand. > > Changes since > * v1: Fix formating and dump message as suggested by Jakub. > > OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. > > gcc/ChangeLog: > > PR tree-optimization/108980 > * gimple-array-bounds.cc (array_bounds_checker::check_array_ref): > Reorgnize the call to warning for not strict flexible arrays > to be before the check of warned. > --- > gcc/gimple-array-bounds.cc | 41 ++++++++++++++++++++++++-------------- > 1 file changed, 26 insertions(+), 15 deletions(-)
It would be nice to have a testcase with dg-bogus for the messages, but seems we don't have one in the PR, so ok for trunk. Jakub