public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-4725] doc: Fix documentation for __builtin_dynamic_object_size
Date: Thu, 15 Dec 2022 17:53:28 +0000 (GMT)	[thread overview]
Message-ID: <20221215175328.0431F3833098@sourceware.org> (raw)

https://gcc.gnu.org/g:f5300d28bfa18485cfe7aca15eb5e8c193376ba0

commit r13-4725-gf5300d28bfa18485cfe7aca15eb5e8c193376ba0
Author: Siddhesh Poyarekar <siddhesh@gotplt.org>
Date:   Thu Dec 15 11:45:17 2022 -0500

    doc: Fix documentation for __builtin_dynamic_object_size
    
    __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 <siddhesh@gotplt.org>

Diff:
---
 gcc/doc/extend.texi | 10 ++++++++--
 gcc/doc/passes.texi | 15 +++++++++------
 2 files changed, 17 insertions(+), 8 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..a248c5d9006 100644
--- a/gcc/doc/passes.texi
+++ b/gcc/doc/passes.texi
@@ -843,12 +843,15 @@ 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}
-
-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
+@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 upper or lower bound for the size
+of the object can be computed at compile-time.  It also tries to replace
+calls to @code{__builtin_dynamic_object_size} with an expression that
+evaluates the upper or lower bound for the size of the object.  This
+pass is located in @file{tree-object-size.cc} and is described by
 @code{pass_object_sizes}.
 
 @item Loop invariant motion

                 reply	other threads:[~2022-12-15 17:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221215175328.0431F3833098@sourceware.org \
    --to=siddhesh@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).