From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 44823383542B for ; Wed, 30 Jun 2021 09:02:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 44823383542B Received: by mail-ej1-x62d.google.com with SMTP id v20so2954668eji.10 for ; Wed, 30 Jun 2021 02:02:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kvIu7BbKTaLgTvksKpa9Vw59z8siP62ibo+GTBlRohY=; b=POl9y88W93t9x96eklH3HiKDFrYuilPTrXhWzEK5hv21dVIKq4/CC/PyehNQMdYRvt bYYycryQMuCEl5nHPKEXzcTZ5tAkuNLZzaGpVyJp+ku8qnS47c+JPpZ1Z6j5kzuJm+4Q Tkdmf92hBflnYdDJ/eNcAe6zhvoJEy4rXtvSlUsCWuhTouQhTHMhH+8WyIJisJkBYNX9 8jMgoPN6qTelHy+SYbcWya9G+gcOBK0AjbvC1lW6909oxNCiB2bg0fCJ5t3WKfVSesve SFNo/ouOK+0B9u1zZjhKPGamOpnyMWf1xDC12In+JA5LEMK+pqbyrL+5liGTTxRDBL0g p5MQ== X-Gm-Message-State: AOAM531UMRNtfaGAHGzkeOEM8xm9dj60JiUWw4XnPLuU3BFPY88wOCWQ wsKCshSQaF0l7FWXmIdVXq2gNV1qljh0sEb/CA4= X-Google-Smtp-Source: ABdhPJwqAi03Lzo1LMYB5E/drHe6EtIQzT1piPpV1jqpD57rjZ/JXpH1zRcP70S4RTwrvWGGGiqrKMe7CL3zzTiFBC8= X-Received: by 2002:a17:906:240d:: with SMTP id z13mr33917402eja.118.1625043748409; Wed, 30 Jun 2021 02:02:28 -0700 (PDT) MIME-Version: 1.0 References: <20210630053529.26581-1-tbsaunde@tbsaunde.org> <20210630053529.26581-4-tbsaunde@tbsaunde.org> In-Reply-To: <20210630053529.26581-4-tbsaunde@tbsaunde.org> From: Richard Biener Date: Wed, 30 Jun 2021 11:02:17 +0200 Message-ID: Subject: Re: [PATCH 4/4] poison input_location and cfun in one spot To: Trevor Saunders Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2021 09:02:30 -0000 On Wed, Jun 30, 2021 at 7:37 AM Trevor Saunders 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 pil (input_location); > + auto_poison pcfun (cfun_poison); > delete fun->x_range_query; > > fun->x_range_query = &global_ranges; > -- > 2.20.1 >