Remove ad-hoc range canonicalization from determine_block_size.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 4 Aug 2020 04:41:03 +0000 (06:41 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 4 Aug 2020 05:23:41 +0000 (07:23 +0200)
Anti ranges of ~[MIN,X] are automatically canonicalized to [X+1,MAX],
at creation time.  There is no need to handle them specially.

Tested by adding a gcc_unreachable and bootstrapping/testing.

gcc/ChangeLog:

* builtins.c (determine_block_size): Remove ad-hoc range canonicalization.

gcc/builtins.c

index 228db78f32bfdcce31e23850e878843d7a45adcc..beb56e06d8a3d9240412762df621f05a96e255cb 100644 (file)
@@ -3287,12 +3287,6 @@ determine_block_size (tree len, rtx len_rtx,
        }
       else if (range_type == VR_ANTI_RANGE)
        {
-         /* Anti range 0...N lets us to determine minimal size to N+1.  */
-         if (min == 0)
-           {
-             if (wi::fits_uhwi_p (max) && max.to_uhwi () + 1 != 0)
-               *min_size = max.to_uhwi () + 1;
-           }
          /* Code like
 
             int n;
@@ -3302,7 +3296,7 @@ determine_block_size (tree len, rtx len_rtx,
             Produce anti range allowing negative values of N.  We still
             can use the information and make a guess that N is not negative.
             */
-         else if (!wi::leu_p (max, 1 << 30) && wi::fits_uhwi_p (min))
+         if (!wi::leu_p (max, 1 << 30) && wi::fits_uhwi_p (min))
            *probable_max_size = min.to_uhwi () - 1;
        }
     }