* ipa-prop.c (ipa_vr::nonzero_p): Add TYPE_UNSIGNED check.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 7 Oct 2019 11:53:40 +0000 (11:53 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Mon, 7 Oct 2019 11:53:40 +0000 (11:53 +0000)
From-SVN: r276655

gcc/ChangeLog
gcc/ipa-prop.c

index 83ad001..db122e2 100644 (file)
@@ -1,5 +1,9 @@
 2019-10-07  Aldy Hernandez  <aldyh@redhat.com>
 
+       * ipa-prop.c (ipa_vr::nonzero_p): Add TYPE_UNSIGNED check.
+
+2019-10-07  Aldy Hernandez  <aldyh@redhat.com>
+
        * ipa-prop.c (ipa_vr::nonzero_p): New.
        (ipcp_update_vr): Use nonzero_p instead of open-coding check for
        non-zero range.
index 20a0bdd..5020f4a 100644 (file)
@@ -5117,6 +5117,7 @@ ipa_vr::nonzero_p (tree expr_type) const
 
   unsigned prec = TYPE_PRECISION (expr_type);
   return (type == VR_RANGE
+         && TYPE_UNSIGNED (expr_type)
          && wi::eq_p (min, wi::one (prec))
          && wi::eq_p (max, wi::max_value (prec, TYPE_SIGN (expr_type))));
 }