public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] options: Fix variable tracking option processing.
Date: Thu, 14 Oct 2021 14:07:48 +0200	[thread overview]
Message-ID: <CAFiYyc0GW5WianHjBZ+Y5ZyLKtS8PfB-simDKXGipfL-Bfyhdg@mail.gmail.com> (raw)
In-Reply-To: <d87ed4a1-5bb2-b8e1-5b8a-5edb1027709f@suse.cz>

On Thu, Oct 14, 2021 at 1:10 PM Martin Liška <mliska@suse.cz> wrote:
>
> On 10/13/21 15:29, Richard Biener wrote:
> > On Wed, Oct 13, 2021 at 3:12 PM Martin Liška <mliska@suse.cz> wrote:
> >>
> >> On 10/13/21 14:50, Richard Biener wrote:
> >>> It does, yes.  But that's a ^ with flag_var_tracking_assignments_toggle;)
> >>>
> >>> It's also one of the more weird flags, so it could be applied after the
> >>> otherwise single set of flag_var_tracking_assignments ...
> >>
> >> Well, it's far from being simple.
> >> Can we please make a step and install the patch I sent? I mean the latest
> >> that does the removal of AUTODETECT_VALUE.
> >
> > But parts of the patch are not obvious and you've not explained why you
> > remove all Init(AUTODETECT_VALUE) but for flag_var_tracking you
> > change it to Init(1).  I count 4 assignments to flag_var_tracking in toplev.c
> > and one in nvptx.c and c6x.c each.
>
> All right. So the assignments in these target set flag_var_tracking = 0, which
> is fine.
>
> >
> >    if (flag_var_tracking_uninit == AUTODETECT_VALUE)
> >      flag_var_tracking_uninit = flag_var_tracking;
> >
> > can probably be handled by EnabledBy, but then we also have
> >
> >    if (flag_var_tracking_uninit == 1)
> >      flag_var_tracking = 1;
>
> Yep, I made:
>
> fvar-tracking
> Common Var(flag_var_tracking) PerFunction EnabledBy(fvar-tracking-uninit)
>
> and made fvar-tracking enabled with OPT_LEVELS_1_PLUS.
>
> >
> > which suggests the same the other way around.  I guess
>
> The other way around is problematic as leads to a cycle. I tried adding
> a cycle detection in common_handle_option_auto (using a bitmap). But it breaks
> case OPT_Wunused, which set sets various sub-values :/
>
>
> > positional handling might differ with say
> > -fvar-tracking -fno-var-tracking-uninit vs. -fno-var-tracking-uninit
> > -fvar-tracking
>
> I verified this is fine in debugger.
>
> > when using EnabledBy vs. the "explicit" code.
> >
> > +  else if (!OPTION_SET_P (flag_var_tracking) && flag_var_tracking)
> >       flag_var_tracking = optimize >= 1;
> >
> > I think _this_ should, instead of the Init(1), become an entry in
> > default_options_table with OPT_LEVELS_1_PLUS.
>
> Done.
>
> >
> > As said, besides flag_var_* the posted patch looks OK and is good to
> > commit.
>
> I'm sending an updated version that survives regression tests.
>
> Thoughts?

OK.

Thanks,
Richard.

> Martin
>
> >
> > Richard.
> >
> >>
> >> Martin

  reply	other threads:[~2021-10-14 12:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 11:01 Martin Liška
2021-10-11 13:05 ` Richard Biener
2021-10-11 13:21   ` Martin Liška
2021-10-11 13:45     ` Richard Biener
2021-10-12 15:21       ` Martin Liška
2021-10-13  8:47         ` Richard Biener
2021-10-13 11:59           ` Martin Liška
2021-10-13 12:50             ` Richard Biener
2021-10-13 13:12               ` Martin Liška
2021-10-13 13:29                 ` Richard Biener
2021-10-14 11:10                   ` Martin Liška
2021-10-14 12:07                     ` Richard Biener [this message]
2021-10-15 15:22                       ` Martin Liška
2021-10-19  9:12                         ` Richard Biener
2021-10-19  9:34                           ` Martin Liška
2021-10-19 10:53                             ` Richard Biener
2021-10-20  8:51                               ` Martin Liška
2021-10-21  9:57                                 ` Richard Biener
2021-10-21 13:14                                   ` Martin Liška
2021-10-21 13:17                                     ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc0GW5WianHjBZ+Y5ZyLKtS8PfB-simDKXGipfL-Bfyhdg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).