From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46959 invoked by alias); 26 Feb 2018 12:27:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 46945 invoked by uid 89); 26 Feb 2018 12:27:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-lf0-f45.google.com Received: from mail-lf0-f45.google.com (HELO mail-lf0-f45.google.com) (209.85.215.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Feb 2018 12:27:50 +0000 Received: by mail-lf0-f45.google.com with SMTP id o145so18698719lff.0 for ; Mon, 26 Feb 2018 04:27:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JBsn9P+j+f7NwwMKiC2JaS7vaQynR9zfZVLp7A8yKV4=; b=o+QkTofNLR7zWd4G8sUvpAiu02mEmFLiTWdVlp85sTB97MQvstm6u1eLkYudV3OS86 sVehcnqv7/GwCJD529GXLTyazbnfiPmLzZIYnqHN9rWhSup5GZ+b00wJhl9BIavHfxxP 7+gX64E4Mp28tOUEVbYiDc4mXo7xug4oObAQSeN/hLAGS6RmWN+34mJy0rXmvw9ltmWU z09ZYORdfGkKOGzqw7nApyiqFkXll15LsIVzwUcf7nmQSUPv0ppfSERQknIi/OznKLKF ryHC7eIuiRM/sVmKsn8jPllwbj+Y9deOUP++C9sFG64yszx2M2Igx5LVvZx5R5Bi3nuE ITQQ== X-Gm-Message-State: APf1xPCErQhmgCZ6eUveV0puK1BK7s/gB8lkiaxCWtuOAqPmpH2VVgAb gFXp9RIjQ1u1iBGaJUe2EdFOfj/0dQeA0DUCfYEeO4tb X-Google-Smtp-Source: AG47ELucu+Lk7LUd+kzVJ2bOOYCXmn+cVPhQIGTKlnPbw4x6ocI/y4/Z/ypNNkoO3RX3wjoXK2eHSOHCplVGruC5yP0= X-Received: by 10.46.82.16 with SMTP id g16mr7296273ljb.67.1519648068145; Mon, 26 Feb 2018 04:27:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.95.143 with HTTP; Mon, 26 Feb 2018 04:27:47 -0800 (PST) In-Reply-To: <8ab6de14-3e50-37bb-4c15-f25b788875d8@redhat.com> References: <8ab6de14-3e50-37bb-4c15-f25b788875d8@redhat.com> From: Richard Biener Date: Mon, 26 Feb 2018 12:27:00 -0000 Message-ID: Subject: Re: [PATCH][committed][PR tree-optimization/82123] 01/06 Do nothing in EVRP analyzer is not optimizing To: Jeff Law Cc: gcc-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg01416.txt.bz2 On Tue, Feb 20, 2018 at 7:49 PM, Jeff Law wrote: > This is part #1 of the patches to fix 81592/82123. The changes aren't > particularly large or invasive, but I already had them broken down > internally into distinct chunks, so I'm going to send them out that way. > > This patch allows the EVRP range analyzer to be safely called even when > not optimizing. It does no analysis in that case. This prevents > problems if we were to ask for sprintf warnings but not have the > optimizer enabled. I don't really understand the issue -- when called from sprintf warnings the evrp analyzer shouldn't "optimize" anything, it only does analysis. How is that ever a problem when not optimizing? You're basically saying that with !optimize you don't want value-ranges to be analyzed but you still use the evrp analyzing domwalk to drive sprintf warnings? Then that is the problem. Don't use evrp analysis if you don't want it. So instead guard the evrp_range_analyzer.enter/leave () calls in sprintf_dom_walker? The sprinkled !optimize tests in analysis infrastructure look bad. Richard. > Bootstrapped and regression tested on x86_64-linux-gnu. > > Jeff > > * gimple-ssa-evrp-analyze.c (evrp_range_analyzer::enter): Do nothing > if not optimizing. > (evrp_range_analyzer::record_ranges_from_stmt): Likewise. > (evrp_range_analyzer::pop_to_marker): Likewise. > > diff --git a/gcc/gimple-ssa-evrp-analyze.c b/gcc/gimple-ssa-evrp-analyze.c > index 2eb2769..b9dcf90 100644 > --- a/gcc/gimple-ssa-evrp-analyze.c > +++ b/gcc/gimple-ssa-evrp-analyze.c > @@ -69,6 +69,8 @@ evrp_range_analyzer::push_marker () > void > evrp_range_analyzer::enter (basic_block bb) > { > + if (!optimize) > + return; > push_marker (); > record_ranges_from_incoming_edge (bb); > record_ranges_from_phis (bb); > @@ -279,6 +281,9 @@ evrp_range_analyzer::record_ranges_from_stmt (gimple *stmt, bool temporary) > { > tree output = NULL_TREE; > > + if (!optimize) > + return; > + > if (dyn_cast (stmt)) > ; > else if (stmt_interesting_for_vrp (stmt)) > @@ -390,6 +395,8 @@ evrp_range_analyzer::pop_to_marker (void) > void > evrp_range_analyzer::leave (basic_block bb ATTRIBUTE_UNUSED) > { > + if (!optimize) > + return; > pop_to_marker (); > } > >