On Mon, 28 Mar 2022, Richard Biener wrote: > On Mon, 28 Mar 2022, Jakub Jelinek wrote: > > > On Mon, Mar 28, 2022 at 03:16:24PM +0200, Richard Biener wrote: > > > When doing format diagnostics at -O0 we should make sure to make > > > SCEV available to avoid false positives due to ranges we otherwise > > > can trivially compute. > > > > > > Bootstrap and regtest running on x86_64-unknown-linux-gnu. > > > > > > OK if that succeeds? > > > > Doesn't this slow down -O0 compilation too much? > > Not if you do not enable the warning. If you enable it you > probably are set to pay for it. Are you specifically > concerned about the cases where SCEV / niter analysis take > a lot of time or are you concerned about the constant overhead > of enabling loops/SCEV?
One concern might be that loop_optimizer_init (LOOPS_NORMAL) changes the IL but the early pass just emits diagnostics so when disabled/enabled (based purely on diagnostic options) generated code could change. Note SCEV currently has (undocumented) contraints on loops so just AVOID_CFG_MANIPULATIONS doens't work there without putting it extra safety checks to give up. Richard. > Richard. > > > > 2022-03-28 Richard Biener <rguent...@suse.de> > > > > > > PR tree-optimization/105080 > > > * tree-ssa-strlen.cc (printf_strlen_execute): Always init > > > loops and SCEV. > > > > > > * gcc.dg/pr105080.c: New testcase. > > > > Jakub > > > > > > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg)