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: 1716202 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gotplt.org header.i=@gotplt.org header.a=rsa-sha256 header.s=dreamhost header.b=tex/sOBf; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NXz3M4qQgz23ym for ; Fri, 16 Dec 2022 03:59:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1F0138533C0 for ; Thu, 15 Dec 2022 16:59:09 +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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" __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