Add more restriction in 'peep2_find_free_register'

Ian Lance Taylor iant@google.com
Mon Jun 30 21:02:00 GMT 2008


"Anatoly Sokolov" <aesok@post.ru> writes:

> 2008-06-19  Anatoly Sokolov  <aesok@post.ru>
>
>         * target.h (struct gcc_target): Add hard_regno_scratch_ok field.
>         * target-def.h (TARGET_HARD_REGNO_SCRATCH_OK): New.
>         (TARGET_INITIALIZER): Use TARGET_HARD_REGNO_SCRATCH_OK.
>         * targhooks.c (default_hard_regno_scratch_ok): New function.
>         * targhooks.h (default_hard_regno_scratch_ok): Declare function.
>         * doc/tm.texi: Document TARGET_HARD_REGNO_SCRATCH_OK hook.
>         * recog.c (peep2_find_free_register): Add check for global regs. 
>          Add target specific check.


> +@deftypefn {Target Hook} bool TARGET_HARD_REGNO_SCRATCH_OK (unsigned int @var{regno})
> +This target hook should return 'true' if it is OK to use a hard register 
> +@var{regno} as scratch reg in peephole2.
> +
> +One common use of this macro is to prevent using of a register that 
> +is not saved by a prologue in an interrupt handler.
> +
> +TThe default version of this hook always returns 'true'.
> +@end deftypefn

Change 'true' => @code{true}, in two places.

Typo: "TThe" => "The".


This patch is OK with those changes.

Thanks.

Ian



More information about the Gcc-patches mailing list