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] Record that -gtoggle is already used in gcc_options.
Date: Thu, 4 Nov 2021 14:09:20 +0100	[thread overview]
Message-ID: <CAFiYyc1-o9jp0x5+1nwRmXo+EOjpsNFzpiZas_qCf+D68Y7cPg@mail.gmail.com> (raw)
In-Reply-To: <907365ec-75d5-ff39-56d1-c10b6985abd3@suse.cz>

On Thu, Nov 4, 2021 at 1:51 PM Martin Liška <mliska@suse.cz> wrote:
>
> On 11/2/21 17:45, Richard Biener wrote:
> > On Tue, Nov 2, 2021 at 4:11 PM Martin Liška <mliska@suse.cz> wrote:
> >>
> >> On 11/2/21 15:33, Richard Biener wrote:
> >>> I think -gtoggle matches a Defered option and thus should be processed
> >>> in handle_common_deferred_options.
> >>
> >> Well, that's quite problematic as I handle_common_deferred_options is called
> >> after decode_options (that calls finish_options).
> >>
> >> Note there's direct dependency at very end of finish_options in between -gtoggle
> >> and debug_nonbind_markers_p:
> >>
> >>
> >>     if (flag_gtoggle)
> >>       {
> >>         if (debug_info_level == DINFO_LEVEL_NONE)
> >>          {
> >>            debug_info_level = DINFO_LEVEL_NORMAL;
> >>
> >>            if (write_symbols == NO_DEBUG)
> >>              write_symbols = PREFERRED_DEBUGGING_TYPE;
> >>          }
> >>         else
> >>          debug_info_level = DINFO_LEVEL_NONE;
> >>       }
> >>
> >>     if (!OPTION_SET_P (debug_nonbind_markers_p))
> >>       debug_nonbind_markers_p
> >>         = (optimize
> >>           && debug_info_level >= DINFO_LEVEL_NORMAL
> >>           && dwarf_debuginfo_p ()
> >>           && !(flag_selective_scheduling || flag_selective_scheduling2));
> >>
> >> I don't see who you mean the possible fix?
> >
> > So at first I thought we might have a place that post-processes
> > 'decoded_options' so we could reflect -gtoggle on those but
> > out-of-order (removing/adding -g).  But that's going to be mightly
> > complicated as well.
>
> That would be very complicated.
>
> >
> > I wonder what the original issue is you fix?  You say we ap;ly
> > it for a second time but we should apply it onto the same
> > state as previously since we restore that for optimize attribute
> > processing?
>
> Well, finish_options is always called once we parse options and we want to finalize them.
> So that happens from toplev where we create initial global options. Later on, after the pragma
> is parsed (where we start with current global options), the finish_options is called.

But we shouldn't start with the current global options but with ones
we saved for
optimize attribute/pragma processing, no?

> Problem of -gtoggle is that it does not directly influence an option, but it negates it.
>
> That said, I think my patch with gtoggle_used is a reasonable workaround.

Well, then we could as well unset flag_gtoggle after processing it, no?

Thanks,
Richard.

> Cheers,
> Martin
>
> >
> > Richard.
> >
> >>
> >> Martin
>

  reply	other threads:[~2021-11-04 13:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 14:10 Martin Liška
2021-11-02 14:33 ` Richard Biener
2021-11-02 15:11   ` Martin Liška
2021-11-02 16:45     ` Richard Biener
2021-11-04 12:51       ` Martin Liška
2021-11-04 13:09         ` Richard Biener [this message]
2021-11-04 15:11           ` Martin Liška
2021-11-05 10:23             ` Richard Biener
2021-11-05 12:01               ` Martin Liška
2021-11-02 22:49 ` Andrew Pinski

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=CAFiYyc1-o9jp0x5+1nwRmXo+EOjpsNFzpiZas_qCf+D68Y7cPg@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).