public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Trevor Saunders <tbsaunde@tbsaunde.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 4/4] poison input_location and cfun in one spot
Date: Wed, 30 Jun 2021 11:02:17 +0200	[thread overview]
Message-ID: <CAFiYyc39P5Ygu4j=mZUsWUu-9ax5T6BYJ+_i+sda1UEefT0TGw@mail.gmail.com> (raw)
In-Reply-To: <20210630053529.26581-4-tbsaunde@tbsaunde.org>

On Wed, Jun 30, 2021 at 7:37 AM Trevor Saunders <tbsaunde@tbsaunde.org> wrote:
>
> This simply confirms we can poison them in a small region.
>
> boostrapped and regtested on x86_64-linux-gnu, ok?

So this shows the approach doesn't really scale since it's necessarily
at most function-scope granularity rather than file-scope as possible
with the existing #pragma (maybe add the possibility to un-poison
identifiers or a push/pop mechanism).

> Trev
>
> gcc/ChangeLog:
>
>         * gimple-range.cc (disable_ranger): Prevent access to cfun and
>         input_location.
> ---
>  gcc/gimple-range.cc | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
> index 1851339c528..d4a3a6e46be 100644
> --- a/gcc/gimple-range.cc
> +++ b/gcc/gimple-range.cc
> @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3.  If not see
>  #include "config.h"
>  #include "system.h"
>  #include "coretypes.h"
> +#include "poison.h"
>  #include "backend.h"
>  #include "tree.h"
>  #include "gimple.h"
> @@ -509,6 +510,8 @@ enable_ranger (struct function *fun)
>  void
>  disable_ranger (struct function *fun)
>  {
> +  auto_poison<location_t> pil (input_location);
> +  auto_poison<function *> pcfun (cfun_poison);
>    delete fun->x_range_query;
>
>    fun->x_range_query = &global_ranges;
> --
> 2.20.1
>

      reply	other threads:[~2021-06-30  9:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30  5:35 [PATCH 1/4] add utility to poison globals that should not be used Trevor Saunders
2021-06-30  5:35 ` [PATCH 2/4] allow poisoning input_location in ranges it " Trevor Saunders
2021-06-30  9:00   ` Richard Biener
2021-06-30 12:33     ` Trevor Saunders
2021-06-30 19:09       ` Richard Biener
2021-07-01 10:23         ` Trevor Saunders
2021-07-01 12:48           ` Richard Biener
2021-06-30 15:13   ` David Malcolm
2021-06-30 19:34     ` Jason Merrill
2021-07-01 10:16     ` Trevor Saunders
2021-07-01 12:53       ` Richard Biener
2021-07-01 15:40         ` David Malcolm
2021-07-01 16:04           ` David Malcolm
2021-07-01 21:51             ` [committed] input.c: move file caching globals to a new file_cache class David Malcolm
2021-07-11 16:58               ` Lewis Hyatt
2021-07-14 22:53                 ` David Malcolm
2021-07-02  0:44           ` [PATCH 2/4] allow poisoning input_location in ranges it should not be used Trevor Saunders
2021-07-02 15:46       ` Jason Merrill
2021-07-02 23:23         ` Trevor Saunders
2021-07-02 19:20   ` Martin Sebor
2021-07-02 23:47     ` Trevor Saunders
2021-07-06 20:53       ` Martin Sebor
2021-06-30  5:35 ` [PATCH 3/4] allow poisoning cfun Trevor Saunders
2021-06-30  5:35 ` [PATCH 4/4] poison input_location and cfun in one spot Trevor Saunders
2021-06-30  9:02   ` Richard Biener [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='CAFiYyc39P5Ygu4j=mZUsWUu-9ax5T6BYJ+_i+sda1UEefT0TGw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tbsaunde@tbsaunde.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).