On Thu, Sep 27, 2018 at 12:24 PM, Florian Weimer <fwei...@redhat.com> wrote: > * H. J. Lu: > >> +@item zero_caller_saved_regs("@var{choice}") >> +@cindex @code{zero_caller_saved_regs} function attribute, x86 >> +On x86 targets, the @code{zero_caller_saved_regs} attribute causes the >> +compiler to zero caller-saved integer registers at function return with >> +@var{choice}. @samp{skip} doesn't zero caller-saved integer registers. >> +@samp{used} zeros caller-saved integer registers which are used in >> +function. @samp{all} zeros all caller-saved integer registers. > > Perhaps “according to @var{choice}:”. And say that the default for the > attribute is controlled by @option{-mzero-caller-saved-regs}?
Sure. > (Maybe “skip” should be none?) I have no strong opinion here. > I assume we can check for this use __has_attribute? We would use this Yes. > in the implementation of explicit_bzero in glibc. Good to know. >> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi >> index 7ef4e7a449b..796477452d5 100644 >> --- a/gcc/doc/invoke.texi >> +++ b/gcc/doc/invoke.texi > >> @@ -28459,6 +28459,16 @@ not be reachable in the large code model. >> @opindex -mindirect-branch-register >> Force indirect call and jump via register. > >> +@item -mzero-caller-saved-regs=@var{choice} >> +@opindex -mzero-caller-saved-regs >> +Zero caller-saved integer registers at function return with @var{choice}. >> +The default is @samp{skip}, which doesn't zero caller-saved integer >> +registers. @samp{used} zeros caller-saved integer registers which are >> +used in function. @samp{all} zeros all caller-saved integer registers. >> +You can control this behavior for a specific function by using the >> +function attribute @code{zero_caller_saved_regs}. >> +@xref{Function Attributes}. > > See above regarding “with @var{choice}”. I will update it. Thanks. -- H.J.