public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Richard Biener <rguenther@suse.de>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix PR80776
Date: Mon, 27 Nov 2017 17:29:00 -0000	[thread overview]
Message-ID: <3d3fbb88-52a5-4cd9-71c3-5d12cfaaf8c5@redhat.com> (raw)
In-Reply-To: <alpine.LSU.2.20.1711271436550.12252@zhemvz.fhfr.qr>

On 11/27/2017 06:39 AM, Richard Biener wrote:
> 
> The following avoids -Wformat-overflow false positives by teaching
> EVRP the trick about __builtin_unreachable () "other" edges and
> attaching range info to SSA names.  EVRP does a better job in keeping
> ranges for every SSA name from conditional info (VRP "optimizes" its
> costly ASSERT_EXPR insertion process).
> 
> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
> 
> This will also fix the testcase from PR83072 but it doesn't really
> fix all cases I want to fix with a fix for it.  OTOH it might be
> this is enough for stage3.
> 
> Richard.
> 
> 2017-11-27  Richard Biener  <rguenther@suse.de>
> 
> 	PR tree-optimization/80776
> 	* gimple-ssa-evrp-analyze.h (evrp_range_analyzer::set_ssa_range_info):
> 	Declare.
> 	* gimple-ssa-evrp-analyze.c (evrp_range_analyzer::set_ssa_range_info):
> 	New function.
> 	(evrp_range_analyzer::record_ranges_from_incoming_edges):
> 	If the incoming edge is an effective fallthru because the other
> 	edge only reaches a __builtin_unreachable () then record ranges
> 	derived from the controlling condition in SSA info.
> 	(evrp_range_analyzer::record_ranges_from_phis): Use set_ssa_range_info.
> 	(evrp_range_analyzer::record_ranges_from_stmt): Likewise.
> 
> 	* gcc.dg/pr80776-1.c: New testcase.
> 	* gcc.dg/pr80776-2.c: Likewise.
So the thing to make sure of here is that the range information we
reflect back into the SSA_NAME actually applies everywhere the SSA_NAME
can appear.  ie, it's globally valid.

This means we can't reflect anything we derive from conditionals or
things like a *p making the range non-null back to the SSA_NAME.

I'd be concerned about the change to record_ranges_from_incoming_edge.

Jeff


  reply	other threads:[~2017-11-27 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 14:34 Richard Biener
2017-11-27 17:29 ` Jeff Law [this message]
2017-11-28  9:49   ` Richard Biener
2017-11-28 15:15     ` Jeff Law

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=3d3fbb88-52a5-4cd9-71c3-5d12cfaaf8c5@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).