On Thu, Oct 21, 2021 at 4:51 PM Martin Sebor <mse...@gmail.com> wrote:
> I'd like to see gimple-ssa-array-bounds invoked from the access > pass too (instead of from VRP), and eventually -Wrestrict as well. You can do that right now. The pass has been converted to the new API and it would just require calling it with a ranger instead of the vr_values from VRP: array_bounds_checker array_checker (fun, &vrp_vr_values); array_checker.check (); That is, move it where you want and pass it a fresh new gimple_ranger. If there are any regressions, we'd be glad to look at them. > I'm not sure about the strlen/sprintf warnings; those might need > to stay where they are because they run as part of the optimizers > there. > > (By the way, I don't see range info in the access pass at -O0. > Should I?) I assume you mean you don't see anything in the dump files. None of the VRP passes (evrp included) run at -O0, so you wouldn't see anything in the IL. You *may* be able to see some global ranges that DOM's use of the evrp engine exported, but I'm not sure. You're going to have to instantiate a gimple_ranger and use it if you want to have range info available, but that's not going to show up in the IL, even after you use it, because it doesn't export global ranges by default. What are you trying to do? Aldy