On Thu, Dec 15, 2022 at 11:58:14AM -0500, Siddhesh Poyarekar wrote: > --- 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)
The above is ok. > 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 Can be computed at compile-time is only true for __bos, for __bdos is if it can be computed. > +is located in @file{tree-object-size.cc} and is described by > @code{pass_object_sizes}. > > @item Loop invariant motion Otherwise LGTM. Jakub