public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: Jiufu Guo <guojiufu@linux.ibm.com>
Cc: Richard Biener <rguenther@suse.de>,
	gcc-patches@gcc.gnu.org, jeffreyalaw@gmail.com,
	richard.sandiford@arm.com, segher@kernel.crashing.org,
	dje.gcc@gmail.com, linkw@gcc.gnu.org, bergner@linux.ibm.com,
	aldyh@redhat.com
Subject: Re: [PATCH] Checking undefined_p before using the vr
Date: Fri, 15 Sep 2023 09:07:21 -0400	[thread overview]
Message-ID: <72665ae2-cc9f-518a-1d4d-6f992705bf6b@redhat.com> (raw)
In-Reply-To: <h48bke442ae.fsf@genoa.aus.stglabs.ibm.com>


On 9/14/23 22:07, Jiufu Guo wrote:
>>
>> undefined is a perfectly acceptable range.  It can be used to
>> represent either values which has not been initialized, or more
>> frequently it identifies values that cannot occur due to
>> conflicting/unreachable code.  VARYING means it can be any range,
>> UNDEFINED means this is unusable, so treat it accordingly.  Its
>> propagated like any other range.
> "undefined" means the ranger is unusable. So, for this ranger, it
> seems only "undefined_p ()" can be checked, and it seems no other
> functions of this ranger can be called.

not at all. It means ranger has determined that there is no valid range 
for the item you are asking about probably due to conflicting 
conditions, which imparts important information about the range.. or 
lack of range :-)

Quite frequently it means you are looking at a block of code that ranger 
knows is unreachable, but a pass of the compiler which removes such 
blocks has not been called yet.. so the awareness imparted is that there 
isn't much point in doing optimizations on it because its probably going 
to get thrown away by a following pass.

>
> I'm thinking that it may be ok to let "range_of_expr" return false
> if the "vr" is "undefined_p".  I know this may change the meaning
> of "range_of_expr" slightly :)

No.  That would be like saying NULL is not a valid value for a pointer.  
undefined_p has very specific meaning that we use.. it just has no type.

Andrew


  reply	other threads:[~2023-09-15 13:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07  2:02 Jiufu Guo
2023-09-12  9:46 ` Richard Biener
2023-09-13  1:42   ` Jiufu Guo
2023-09-13 13:07     ` Andrew MacLeod
2023-09-15  2:07       ` Jiufu Guo
2023-09-15 13:07         ` Andrew MacLeod [this message]
2023-09-26  3:09           ` Jiufu Guo

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=72665ae2-cc9f-518a-1d4d-6f992705bf6b@redhat.com \
    --to=amacleod@redhat.com \
    --cc=aldyh@redhat.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guojiufu@linux.ibm.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=linkw@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --cc=richard.sandiford@arm.com \
    --cc=segher@kernel.crashing.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).