This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] MIPS: Add option to pass return address location to _mcount.


David Daney <ddaney@caviumnetworks.com> writes:
> Richard Sandiford wrote:
>> David Daney <ddaney@caviumnetworks.com> writes:
>>> +@option{-mmcount-raaddr} can be used in conjunction with @option{-pg}
>>> +and a specially coded @code{_mcount} function to record function exit
>> 
>> Doc conventions require "specially-coded", I think.  We should
>> mention the $12 register too, and the treatment of leaf functions.
>> How about:
>> 
>> --------------------------
>> Allow (do not allow) @code{_mcount} to modify the calling function's
>> return address.  When enabled, this option extends the usual @code{_mcount}
>> interface with a new @var{ra-address} parameter, which has type
>> @code{intptr_t *} and is passed in register @code{$12}.  @code{_mcount}
>> can then modify the return address by doing both of the following:
>> @itemize
>> @item
>> Returning the new address in register @code{$31}.
>> @item
>> Storing the new address in @code{*@var{ra-address}},
>> if @var{ra-address} is nonnull.
>> @end @itemize
>> 
>> The default is @option{-mno-mcount-ra-address}.
>> --------------------------
>
> Ok.  I took a couple of liberties, but used essentially what you suggest.

Yeah, the reworked version looks good, thanks, but I noticed a typo:

> +Emit (do not emit) code that allows @code{_mcount} to modify the
> +colling function's return address.  When enabled, this option extends
   ^^^^^^^

Fixed as follows and applied.

Richard


gcc/
	* doc/invoke.texi: Fix typo.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	2009-11-03 21:25:03.000000000 +0000
+++ gcc/doc/invoke.texi	2009-11-03 21:25:03.000000000 +0000
@@ -14216,7 +14216,7 @@ assembler and the linker alone without h
 @opindex mmcount-ra-address
 @opindex mno-mcount-ra-address
 Emit (do not emit) code that allows @code{_mcount} to modify the
-colling function's return address.  When enabled, this option extends
+calling function's return address.  When enabled, this option extends
 the usual @code{_mcount} interface with a new @var{ra-address}
 parameter, which has type @code{intptr_t *} and is passed in register
 @code{$12}.  @code{_mcount} can then modify the return address by


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]