From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 847193858023 for ; Wed, 26 Jul 2023 08:42:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 847193858023 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690360957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5lT+/tGmD4SrYEHrpNW+fvM/roBBT6E9eTyB6D1jw0s=; b=M3GCqOX+Tb1ZT4upW3dcucWf5oaK3mfByntEGIPg31ohu8gVuAgI5kbzqvfOrutXncp0Du gaAeE9KYNUMgD0SF1ifrqL0LTPXFPTHwpHNEehd1oZm8O23TfAjjDViFFeqDZyOpyvTTAH lXXqQc2b77pNwNN8ONoszDrSvK5qbxs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-592-M1ubJq4tOjeadlbNX727Ug-1; Wed, 26 Jul 2023 04:42:36 -0400 X-MC-Unique: M1ubJq4tOjeadlbNX727Ug-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1140A185A795 for ; Wed, 26 Jul 2023 08:42:36 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D9E1F782E; Wed, 26 Jul 2023 08:42:35 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 36Q8gXNw043442 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 10:42:33 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 36Q8gX3I043441; Wed, 26 Jul 2023 10:42:33 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] [range-ops] Handle bitmasks for BIT_NOT_EXPR. Date: Wed, 26 Jul 2023 10:42:16 +0200 Message-ID: <20230726084224.43416-2-aldyh@redhat.com> In-Reply-To: <20230726084224.43416-1-aldyh@redhat.com> References: <20230726084224.43416-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.4 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: gcc/ChangeLog: * range-op-mixed.h (class operator_bitwise_not): Add update_bitmask. * range-op.cc (operator_bitwise_not::update_bitmask): New. --- gcc/range-op-mixed.h | 2 ++ gcc/range-op.cc | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index 6944742ecbc..ead41ed0515 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -551,6 +551,8 @@ public: bool op1_range (irange &r, tree type, const irange &lhs, const irange &op2, relation_trio rel = TRIO_VARYING) const final override; + void update_bitmask (irange &r, const irange &lh, + const irange &rh) const final override; }; class operator_bitwise_xor : public range_operator diff --git a/gcc/range-op.cc b/gcc/range-op.cc index d959a3e93dc..13ba973a08d 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -4027,6 +4027,13 @@ operator_bitwise_not::op1_range (irange &r, tree type, return fold_range (r, type, lhs, op2); } +void +operator_bitwise_not::update_bitmask (irange &r, const irange &lh, + const irange &rh) const +{ + update_known_bitmask (r, BIT_NOT_EXPR, lh, rh); +} + bool operator_cst::fold_range (irange &r, tree type ATTRIBUTE_UNUSED, -- 2.41.0