]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
One last tweak before we move onto the new world/branch. devel/range-gen3
authorAldy Hernandez <aldyh@gcc.gnu.org>
Mon, 16 Apr 2018 17:23:40 +0000 (17:23 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Mon, 16 Apr 2018 17:23:40 +0000 (17:23 +0000)
From-SVN: r259404

gcc/gimple-ssa-warn-restrict.c

index 814797262d2d7616eabb8ac7ca5b9ddb0e2abb75..e6466f39786e81084f1ccfdb6c7e6b1193ab79af 100644 (file)
@@ -308,11 +308,17 @@ builtin_memref::extend_offset_range (tree offset)
   if (TREE_CODE (offset) == SSA_NAME)
     {
       wide_int min, max;
-      if (get_range_info (offset, &min, &max))
+      value_range_type rng = get_range_info_as_value_range (offset, &min, &max);
+      if (rng == VR_RANGE)
        {
          offrange[0] += offset_int::from (min, SIGNED);
          offrange[1] += offset_int::from (max, SIGNED);
        }
+      else if (rng == VR_ANTI_RANGE)
+       {
+         offrange[0] += offset_int::from (max + 1, SIGNED);
+         offrange[1] += offset_int::from (min - 1, SIGNED);
+       }
       else
        {
          gimple *stmt = SSA_NAME_DEF_STMT (offset);