From patchwork Mon Oct 7 09:39:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1172679 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510387-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Y8ihfRET"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Qr+ze+OB"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46mwRt4Dpnz9sCJ for ; Mon, 7 Oct 2019 20:39:36 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=c8cnS880n4bJiGt2XM2lBzywuQlUzLRve8ZHVHJl8YejZhi9tT mw+ri17j29LqcjC5ST8lscL1TvAde3uMgmpx0sU99My348vA935DuX4vid4U9UkQ j8xypXpUsOj0R7mlKB3fzot54E/lwQa80fhhw7u4+Z9elnfdVQhSHOo1k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=ScqQ2f1UPIyFlhkKeTtzR2KcYnw=; b=Y8ihfRETJA+yY5qyft6J MhndYUXXpiLKfa/YZNaiQU8H+tOcjzOCIIRBEj6tKjJoKt9nfAl3tX3+MOcDL1GO mBU7CyUl3G0t+Ewioc2w73cd3u1GDJooHk7UTq3eOpnp1L4v/K4ZqPvadoFdAWXY 4R2fJXOgjHBtHWosJYdB8KI= Received: (qmail 5809 invoked by alias); 7 Oct 2019 09:39:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 5641 invoked by uid 89); 7 Oct 2019 09:39:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 09:39:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570441166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=wFPF4grECBdt4ALBwy+SZYuCbisksBPOowdADQRnf4c=; b=Qr+ze+OBZ0h0pEhISIPru9AblmIPgMY/0pvlku7opr9K4uBqILNIF0FoEfrxuZpOZ6H36I E2SBQN6ydYqTZRazHlyNPQs+8WRFCEArOYlzm00H/zmAdXAUHbrg1u+cveCQhxQCHX7ihd /mhglCD4EOglCUg4tUASF32mOmaw/00= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-eqed0DXvNTuHtSZPtlk1fg-1; Mon, 07 Oct 2019 05:39:23 -0400 Received: by mail-wr1-f70.google.com with SMTP id b6so7299843wrw.2 for ; Mon, 07 Oct 2019 02:39:22 -0700 (PDT) Received: from abulafia.quesejoda.com (136.red-2-139-5.dynamicip.rima-tde.net. [2.139.5.136]) by smtp.gmail.com with ESMTPSA id s12sm18389559wrn.90.2019.10.07.02.39.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Oct 2019 02:39:20 -0700 (PDT) To: gcc-patches From: Aldy Hernandez Subject: [committed] use value_range_base::num_pairs in singleton_p Message-ID: <553fda8a-6bc3-b560-c90a-f0068c3cbc49@redhat.com> Date: Mon, 7 Oct 2019 05:39:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-IsSubscribed: yes Instead of looking inside a range to determine if it has one sub-range, use the API. Committed as obvious. Aldy commit 93d4733dd1f8ce8ca4959f4584cec4bdd96d063e Author: Aldy Hernandez Date: Mon Oct 7 09:15:30 2019 +0200 Use value_range_base::num_pairs instead of vrp_val_is* to check if a range has one sub-range. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 798d16cf0c6..fbb1634cbae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-10-07 Aldy Hernandez + + * tree-vrp.c (value_range_base::singleton_p): Use + value_range_base::num_pairs instead of vrp_val_is* to check + if a range has one sub-range. + diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index a2ab4a21925..86e4dace073 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -379,10 +379,7 @@ value_range_base::singleton_p (tree *result) const } return false; } - - /* An anti-range that includes an extreme, is just a range with - one sub-range. Use the one sub-range. */ - if (vrp_val_is_min (m_min, true) || vrp_val_is_max (m_max, true)) + if (num_pairs () == 1) { value_range_base vr0, vr1; ranges_from_anti_range (this, &vr0, &vr1, true);