From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id C152B3844042 for ; Tue, 4 Aug 2020 06:35:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C152B3844042 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-154-5VtBwi8dNgKn3jir9HKvnA-1; Tue, 04 Aug 2020 02:35:45 -0400 X-MC-Unique: 5VtBwi8dNgKn3jir9HKvnA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B38E10059AA for ; Tue, 4 Aug 2020 06:35:44 +0000 (UTC) Received: from abulafia.quesejoda.com (ovpn-112-71.ams2.redhat.com [10.36.112.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE3A127CD0; Tue, 4 Aug 2020 06:35:43 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.15.2/8.15.2) with ESMTPS id 0746ZfGp518025 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 4 Aug 2020 08:35:42 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.15.2/8.15.2/Submit) id 0746ZfGW518024; Tue, 4 Aug 2020 08:35:41 +0200 From: Aldy Hernandez To: gcc-patches@gcc.gnu.org Subject: [PUSHED 1/8] Remove ad-hoc range canonicalization from determine_block_size. Date: Tue, 4 Aug 2020 08:34:37 +0200 Message-Id: <20200804063441.517123-2-aldyh@redhat.com> In-Reply-To: <20200804063441.517123-1-aldyh@redhat.com> References: <20200804063441.517123-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 06:35:47 -0000 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 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gcc/builtins.c b/gcc/builtins.c index 228db78f32b..beb56e06d8a 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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; } } -- 2.26.2