public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work008)] Adjust simplify_conversion_using_ranges for irange API.
@ 2020-08-06 17:52 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2020-08-06 17:52 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:70be5895658d9da5135957bd9af7b14ba4a82a70

commit 70be5895658d9da5135957bd9af7b14ba4a82a70
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Tue Aug 4 07:13:44 2020 +0200

    Adjust simplify_conversion_using_ranges for irange API.
    
    gcc/ChangeLog:
    
            * vr-values.c (simplify_conversion_using_ranges): Convert to irange API.

Diff:
---
 gcc/vr-values.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/vr-values.c b/gcc/vr-values.c
index e78b25596b0..38c9a657dad 100644
--- a/gcc/vr-values.c
+++ b/gcc/vr-values.c
@@ -3969,11 +3969,14 @@ simplify_conversion_using_ranges (gimple_stmt_iterator *gsi, gimple *stmt)
   /* Get the value-range of the inner operand.  Use get_range_info in
      case innerop was created during substitute-and-fold.  */
   wide_int imin, imax;
-  if (!INTEGRAL_TYPE_P (TREE_TYPE (innerop))
-      || get_range_info (innerop, &imin, &imax) != VR_RANGE)
+  value_range vr;
+  if (!INTEGRAL_TYPE_P (TREE_TYPE (innerop)))
     return false;
-  innermin = widest_int::from (imin, TYPE_SIGN (TREE_TYPE (innerop)));
-  innermax = widest_int::from (imax, TYPE_SIGN (TREE_TYPE (innerop)));
+  get_range_info (innerop, vr);
+  if (vr.undefined_p () || vr.varying_p ())
+    return false;
+  innermin = widest_int::from (vr.lower_bound (), TYPE_SIGN (TREE_TYPE (innerop)));
+  innermax = widest_int::from (vr.upper_bound (), TYPE_SIGN (TREE_TYPE (innerop)));
 
   /* Simulate the conversion chain to check if the result is equal if
      the middle conversion is removed.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-06 17:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 17:52 [gcc(refs/users/meissner/heads/work008)] Adjust simplify_conversion_using_ranges for irange API Michael Meissner

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).