On Mon, Oct 11, 2021 at 3:21 PM Martin Liška <mli...@suse.cz> wrote:
>
> On 10/11/21 15:05, Richard Biener wrote:
> >> +  if (!opts_set->x_flag_var_tracking)
> >> +    opts->x_flag_var_tracking = optimize >= 1;
> > That's still not equivalent to the old code for -fvar-tracking-uninit which
> > sets opts->x_flag_var_tracking to 1 and the old code checked that
> > for AUTOINIT_VALUE but you override it here for -O0.
> >
>
> Do you mean the newly added code:
>
> +  if (!opts_set->x_flag_var_tracking)
>
> +    opts->x_flag_var_tracking = optimize >= 1;
>
>
> that should be equivalent to:
>
> -  if (flag_var_tracking == AUTODETECT_VALUE)
>
> -    flag_var_tracking = optimize >= 1;
>
>
> ? Or do I miss something?

Yes.  I think to be equivalent it would need to be

   if (!opts_set->x_flag_var_tracking_uninit
       && !opts_set->x_flag_var_tracking)
     opts->x_flag_var_tracking = optimize >= 1;

see how in the old code the order of the tests makes a difference
because we test flag_* we also set.  Please double-check the change
with regard to that.

Btw, I'd be more comfortable when the move of the code would be
independent of the adjustment to not rely on AUTODETECT_VALUE.
Can we do the latter change first (IIRC the former one failed already)?

Richard.

>
> Thanks,
> Martin

Reply via email to