From: Jeff Law <law@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 0/2] Make option-lookup macros explicit
Date: Wed, 14 May 2014 18:31:00 -0000 [thread overview]
Message-ID: <5373B68F.70307@redhat.com> (raw)
In-Reply-To: <1399670087-18991-1-git-send-email-dmalcolm@redhat.com>
On 05/09/14 15:14, David Malcolm wrote:
> GCC's code is full of references to options like:
>
> static bool
> gate_vrp (void)
> {
> return flag_tree_vrp != 0;
> }
>
> where "flag_tree_vrp" is actually an autogenerated macro to:
>
> global_options.x_flag_tree_vrp
>
> This is deeply confusing to a newbie (and indeed still to me after ~two
> years of working with GCC's internals) e.g. when stepping through code and
> trying to query the value in gdb - what is an actual variable, and what is
> an option? Why isn't tab-completion working? etc
>
> The idea of the following patch series is to replace the above with:
>
> static bool
> gate_vrp (void)
> {
> return GCC_OPTION (flag_tree_vrp) != 0;
> }
>
> thus making it obvious when macro magic is occurring.
Conceptually this patch seems fine to me. I think the macro magic
around flag_xxx is annoying, so this is definitely an improvement.
>
> From a global-state-removal perspective, it might be nice to associate
> options with a gcc::context, rather than have a single instance of options,
> though that isn't addressed in these patches.
> (e.g. perhaps explicitly adding a gcc::context arg to the macro???)
Should be done as a follow-up IMHO.
>
> The patches were successfully bootstrapped®rtested on top
> of r208714 (rather old, 2014-03-20) albeit just on x86_64-unknown-linux-gnu
> (Fedora 20), with
> --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto
> (i.e. every frontend, I think).
>
> OK for trunk, after 4.9.1 is released? (clearly I need to test on
> more targets first, given how much config/* code this touches, but I
> wanted to sound the idea out on this list).
Yea, definitely test out some other targets and wait for the 4.9.1
release. But I'm inclined to approve the patch as it stands plus any
trivial changes that have to be made due to 4.9.0->4.9.1 changes in
nearby code.
jeff
prev parent reply other threads:[~2014-05-14 18:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 21:12 David Malcolm
2014-05-09 21:12 ` [PATCH 2/2] Autogenerated part of introduction of GCC_OPTION macro David Malcolm
2014-05-10 5:42 ` Václav Zeman
2014-05-10 11:12 ` David Malcolm
2014-05-09 21:12 ` [PATCH 1/2] Handwritten " David Malcolm
2014-05-10 0:28 ` [PATCH 0/2] Make option-lookup macros explicit Trevor Saunders
2014-05-14 18:31 ` Jeff Law [this message]
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=5373B68F.70307@redhat.com \
--to=law@redhat.com \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/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).