From patchwork Thu Dec 15 16:58:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 33732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp479230wrn; Thu, 15 Dec 2022 08:59:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf4R0Xe/kncOFaUGkI7ccGIddInST/UVXnDUNdcCtj3MKfmmuT4scglOxYrWVUMlAyBvjdTb X-Received: by 2002:a17:906:70d0:b0:7c0:8371:97aa with SMTP id g16-20020a17090670d000b007c0837197aamr24837444ejk.28.1671123564667; Thu, 15 Dec 2022 08:59:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671123564; cv=pass; d=google.com; s=arc-20160816; b=FVP9YzjtenaYfSqLXzlcat/pIuRMgLnsmfOCa78czvJg6KTOtNTPgkXTLwtCUubz2C kDrF9fgr2a993pFr0ONTKUtwDRkTq4UWlNgCMYrSIPsgpY+rOUa/XhRUBrqGL+Fgd7JR KxDy0lIZdOW0fOxhVJXZ9aAHbIbjO0kC2vij/ced6ZmqAmy01sEcntunCjBuCJAEzh8m SrY+lVtz6/uZPERv4Q13mA/7ssPjDRj0w1WxOk8lOSI0DqYXq8prMOyvncljtFY8iQ6y k/fY8TMbHzuT/4acpahnG3XvDJ1kWDyVMQnsaFSCFUMGEzNv839h/BlNmzxDGZyxMXIp UxNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender: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 :dmarc-filter:delivered-to; bh=jSU0g/AfSnLByhkRCs1VT7+JnsD5CfPEWpcF+NcCl70=; b=W/B21NBX9ZU+t45AJB0VPoAwP7wmjP9D0zjf0Et78nBzEN+LFndYu82YiSMamLfPEn vSO0SGqWsWfH9BBAM8ImsvIYRBEofoEBd835UE6IFKN5xAeWgYjd57aHiYvi0EmxPjk9 sqXejlqeoVL4jym+2XolAEPB3rBg3qDzdqdULhkM6wfBFzm7FVUgcDvPp/uR45kn4OuK Cxv6UCsL9hJmGGf8C4BQQOlw2gxtSaVYvyoRFwLlI92UY428/AuFnW/X2XBwfT9+L+KO XLyzfTWPDBhejEG0zDMd4ltprHo6Dp4l3n0kS8A0Xr2jb2eE3cN5icwszyzLioF9R4Zb EmvA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gotplt.org header.s=dreamhost header.b="tex/sOBf"; 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" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id rn5-20020a170906d92500b0078d459a1ce9si11338924ejb.693.2022.12.15.08.59.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 08:59:24 -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=@gotplt.org header.s=dreamhost header.b="tex/sOBf"; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B28913850626 for ; Thu, 15 Dec 2022 16:59:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from aye.elm.relay.mailchannels.net (aye.elm.relay.mailchannels.net [23.83.212.6]) by sourceware.org (Postfix) with ESMTPS id 6A1A03858434 for ; Thu, 15 Dec 2022 16:58:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A1A03858434 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 2B8226C1906 for ; Thu, 15 Dec 2022 16:58:55 +0000 (UTC) Received: from pdx1-sub0-mail-a306.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BAB146C18E4 for ; Thu, 15 Dec 2022 16:58:54 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1671123534; a=rsa-sha256; cv=none; b=ecLT1TQnmiOa3MvFL3wwavkK82jWvnkmlYdTOPP/V5FW07KuapS1eu+giCvglzDd4SEhPI jUIugSj8KjA6J8/BCiTAshdn3IhS7t0XaLJfNgPriKZtRxhwqrG3N5P7NLBbP22Je7/6ab ZhigUeyc09T+dTw1LaffD9nBNXYukssvFQGGp30ab/y62MB40w5ZiZ5TI+cqPpwdENmVas Ru495CIEIIE9aB0Y3UMauI7NrvozQv2ylx1ipRljgRR+naO5qVi/sZEj9fvJ6+Vdvs40HQ 1260LL1uHecLfaWAkgdfFGbyrkqFckn2AM+Vbb5VMSaoPVqyH2SchkRE7aqcGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1671123534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=jSU0g/AfSnLByhkRCs1VT7+JnsD5CfPEWpcF+NcCl70=; b=xab/ef+A5BEpe3WyV5ba0K8nFNm4cHPNxHVSE/4AzCxv6y+yVeYDHcGOJWFDEm4yBUFJjn wy7ebZHj9S9hJVXKIkj0/rTtvlpjYpedqEcahs6LbyLH4C6h4kZchsXwGoc28+L8yiVHAG 0+OLWf+AMX9eN96wjg/x4gg3iuSrP6n8NSLh0VJw0dz4SD+WgibdfaHPWkpOZcWi2PPHo3 3kyUzRETmefr9+Wb8L08pDIICRHmkwUQ8nudoU1E6Vd+aWGFjz7OI9BwkpZnZSuOFHn4WN emerk5ySzGbowREuCRyR9RPMES67gIN4ufJIbeWg5CK7/j+4XGQDwr1zXTuetw== ARC-Authentication-Results: i=1; rspamd-d48c5ddb-whmsh; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Reign-Drop: 5a8983ff3acdb719_1671123534996_2326983529 X-MC-Loop-Signature: 1671123534996:1889344603 X-MC-Ingress-Time: 1671123534996 Received: from pdx1-sub0-mail-a306.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.109.138.37 (trex/6.7.1); Thu, 15 Dec 2022 16:58:54 +0000 Received: from fedora.redhat.com (bras-base-toroon4834w-grc-23-76-68-24-147.dsl.bell.ca [76.68.24.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a306.dreamhost.com (Postfix) with ESMTPSA id 4NXz322LFpz3K for ; Thu, 15 Dec 2022 08:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1671123534; bh=jSU0g/AfSnLByhkRCs1VT7+JnsD5CfPEWpcF+NcCl70=; h=From:To:Subject:Date:Content-Transfer-Encoding; b=tex/sOBfOAT3QGzHXNVsTrb2WZe1kSItqzEBzFQYOlVJWiULAznaMLqlqN+a9fVSn Lb8dREVmbLt9LzlTSvpahM79Pk+OXeW9eufi2frUUrkzgJqL+7kkmC9wFdcZva0rHO V5NA8RfPezw07i1LMutJfZc6N4HGtOxzcKhUIEOjxtUxDQeBfEJTo8vdYf6w9vCuad xBlDZyVF64V+y8WsgNuCtUdSJqI6aOSwic8V0FqfJDO3Bx/LSuBbrhAq1qtE3gACP9 1EgveSidzIcOX6iPuOxjydlgEqqKwAa0iFZBeiOkjOtnIm1hfeSsB/2wNYJcItbuxv Z7RxZDoWBsoSQ== From: Siddhesh Poyarekar To: gcc-patches@gcc.gnu.org Subject: [PATCH] doc: Fix documentation for __builtin_dynamic_object_size Date: Thu, 15 Dec 2022 11:58:14 -0500 Message-Id: <20221215165814.1808816-1-siddhesh@gotplt.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3037.1 required=5.0 tests=BAYES_00, 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.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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752300063006896224?= X-GMAIL-MSGID: =?utf-8?q?1752300063006896224?= __builtin_dynamic_object_size is missing from the full list of builtins, so add it. Also mention it alongside __builtin_object_size in the passes description. gcc/ChangeLog: * doc/extend.texi (__builtin_dynamic_object_size): Document builtin. * doc/passes.texi (Optimize calls to @code{__builtin_object_size}): Also mention __builtin_dynamic_object_size. Signed-off-by: Siddhesh Poyarekar --- gcc/doc/extend.texi | 10 ++++++++-- gcc/doc/passes.texi | 11 ++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index d3812fa55b0..608ff54f845 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -14291,8 +14291,14 @@ and GCC does not issue a warning. @end deftypefn @deftypefn {Built-in Function}{size_t} __builtin_object_size (const void * @var{ptr}, int @var{type}) -Returns the size of an object pointed to by @var{ptr}. @xref{Object Size -Checking}, for a detailed description of the function. +Returns a constant size estimate of an object pointed to by @var{ptr}. +@xref{Object Size Checking}, for a detailed description of the function. +@end deftypefn + +@deftypefn {Built-in Function}{size_t} __builtin_dynamic_object_size (const void * @var{ptr}, int @var{type}) +Similar to @code{__builtin_object_size} except that the return value +need not be a constant. @xref{Object Size Checking}, for a detailed +description of the function. @end deftypefn @deftypefn {Built-in Function} double __builtin_huge_val (void) diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi index 9e8b4f50ad6..d649db72bbe 100644 --- a/gcc/doc/passes.texi +++ b/gcc/doc/passes.texi @@ -843,12 +843,13 @@ foo()}, this pass tries to change the call so that the address of pass is located in @code{tree-nrv.cc} and is described by @code{pass_return_slot}. -@item Optimize calls to @code{__builtin_object_size} +@item Optimize calls to @code{__builtin_object_size} or +@code{__builtin_dynamic_object_size} -This is a propagation pass similar to CCP that tries to remove calls -to @code{__builtin_object_size} when the size of the object can be -computed at compile-time. This pass is located in -@file{tree-object-size.cc} and is described by +This is a propagation pass similar to CCP that tries to remove calls to +@code{__builtin_object_size} or @code{__builtin_dynamic_object_size} +when the size of the object can be computed at compile-time. This pass +is located in @file{tree-object-size.cc} and is described by @code{pass_object_sizes}. @item Loop invariant motion