Message ID | 20240208214932.2737795-1-jwakely@redhat.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp473391dyd; Thu, 8 Feb 2024 13:52:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVkwCbBvV5eNpummzuJGUlW0xTy1kab6bZ1TysvaYVH84whaP7/w4AN+0k2wjEMc9u808vo5Qj05ReCt7EIZI26zLKooA== X-Google-Smtp-Source: AGHT+IFPDKv5wI+o9AKgI13WOCXz0hkdf+5kBR36G+w7Nu38NroqxDaDaPV2AN547ciEvSBmsRA+ X-Received: by 2002:a05:6214:528f:b0:68c:c76a:10df with SMTP id kj15-20020a056214528f00b0068cc76a10dfmr692837qvb.12.1707429143395; Thu, 08 Feb 2024 13:52:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707429143; cv=pass; d=google.com; s=arc-20160816; b=wfzHwUykP0zIElkymCINy038UTlgfNJcEEvf3dDZQDNs0zsv45H68i87VgjZBYTEuB ZiYTuCwLHNpDvfWV2UrbIcBUJSOsRvbxGaWWAZxuBI2uIwASNHhBiU5VFnReo5CJ46f9 3woJh9BBcnkm6HMkZnFAveMfL/MQk0NvB9vgPayFanZG/WDBSJfGtMhVz3v0zo/xZXeX 6WtYS6PbcAVdXBw5jxkuZVOXeHoVgZpYZgK16OwB5SRBhb7ZAClCDLZJ/9vBduGW+TnB sK3XDwgmK0PrU0sWpebqJd/oblearS61XI2OfYC4fCVxnpZYSJGoMqp7lMwhX15yqU1m zJig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ZkMUlnZ/n/6SzjL3WdZefuPLFg29t4SswXPx6G9e8VE=; fh=ufauyucaB6mS7t+VcvYJ81t/dgVnCWnk53yMoqXZ/qM=; b=XKmotheNGeYR37itRzJ2MyGNy3m5G9mBqg3PX7efjVAyJmkrDz2HRjm42g9SjMtpKf BljhoFKKB8jLDWuRvMKgy56G85fshAJHitmlRNN9ncEnxBVb1ODjct9YufDS3jMAl3sS 87MsAi8zdx42omTGSANmmEMhVls0WFy+s+Fk8aFHBtRKcMTyx+IaFl+pP0f+0HTXEiej kn449fXnlMp0BKKYcfXJ+TwR9I5vVB7jxfq7uMoO+VDX3NDBdBUi0YJfKJ3vwvHZxfY8 5j6oMyxi0h6l3/B2BjleAOCIrJZ72tFYXc/KLZTtj+P2iO/0aLMlUmfAjUx7/FV42orS 8xBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AeAgQISS; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXRlasxmRcF/YWAca2C1Sjb17B3xJfLE6TBd4Ega4BFgz3fWaqm3nyOChJJFT+AJnbkvSzLyJeBB4RhlSL0jZ4hwnQVdQ== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gs12-20020a056214226c00b0068caf6856eesi502413qvb.205.2024.02.08.13.52.23 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 13:52:23 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AeAgQISS; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 11211385841C for <ouuuleilei@gmail.com>; Thu, 8 Feb 2024 21:52:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 6B7EE3858C78 for <gcc-patches@gcc.gnu.org>; Thu, 8 Feb 2024 21:49:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B7EE3858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6B7EE3858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707428984; cv=none; b=JPjAG+O3OAiF97O62h+Vp8L8Pv++UTijg+q2irLFXDlRpkF4J12beByR82/DJAoxU77BLNle/UtqU6Vfnskyo099WuIR8S0y2yHF6SK4udMVVNHbNr7EEn5k2izWpCx/WVunXBA7MRe03nb4JPY7Zu/YwK9BZEkJMCuFLCnQzJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707428984; c=relaxed/simple; bh=dm5UfFIk9ZjUaOiiYHQYn6WM9kqA5UAv3ET+/VtoqfU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=G6JWkbvP49lOnAu62jz9Erqu4LO5cL86i0XvNBLFmEqjoqAfLGA1ntK8WEVwzIsn76x7SN1NXJlDrO2qgzSC8n7d6gC82nIEiDDnxOcbtfClhiHqRNz9xQ9KNV+1yzWyIQ+ooDf63GfUeBjwbKneCJMt0Mrtsj5X7wRj0/fDNOc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707428977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZkMUlnZ/n/6SzjL3WdZefuPLFg29t4SswXPx6G9e8VE=; b=AeAgQISS7/ztgTOmMozogVX/89636SGEB+vDV9KprvN5ApeLyrTSjGeiLKbsr1U52fhRnP Li51/IiLTEeakTsz23foRZgDocSt9rzC0jSnVNfBby4Ux/q8NRMeQiwzutl90gfY6gSHln Fzqu2/8EV2X7RFAFgsCcSy4SphZZstM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-304-9kd-qiwDO76x8ZbxuXKrlw-1; Thu, 08 Feb 2024 16:49:34 -0500 X-MC-Unique: 9kd-qiwDO76x8ZbxuXKrlw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD2FE83B8E5; Thu, 8 Feb 2024 21:49:33 +0000 (UTC) Received: from localhost (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90FDEC1596E; Thu, 8 Feb 2024 21:49:33 +0000 (UTC) From: Jonathan Wakely <jwakely@redhat.com> To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add comment to gslice::operator=(const gslice&) [PR100147] Date: Thu, 8 Feb 2024 21:49:10 +0000 Message-ID: <20240208214932.2737795-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.9 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_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790369221482672896 X-GMAIL-MSGID: 1790369221482672896 |
Series |
[committed] libstdc++: Add comment to gslice::operator=(const gslice&) [PR100147]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Jonathan Wakely
Feb. 8, 2024, 9:49 p.m. UTC
Tested aarch64-linux. Pushed to trunk. -- >8 -- There's no need to check for self-assignment here, it would just add extra code for an unlikely case. Add a comment saying so. libstdc++-v3/ChangeLog: PR libstdc++/100147 * include/bits/gslice.h (operator=): Add comment about lack of self-assignment check. --- libstdc++-v3/include/bits/gslice.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/libstdc++-v3/include/bits/gslice.h b/libstdc++-v3/include/bits/gslice.h index 3d78da2bd75..d9a8b929a57 100644 --- a/libstdc++-v3/include/bits/gslice.h +++ b/libstdc++-v3/include/bits/gslice.h @@ -169,6 +169,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline gslice& gslice::operator=(const gslice& __g) { + // Safe for self-assignment. Checking for it would add overhead just to + // optimize a case that should never happen anyway. if (__g._M_index) __g._M_index->_M_increment_use(); if (_M_index && _M_index->_M_decrement_use() == 0)