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: Add more restriction in 'peep2_find_free_register'


Anatoly Sokolov <aesok@post.ru> writes:

> This patch add two more check in 'peep2_find_free_register' function, which
> find free hard registers for use as scratch registers in peephole2.
>
>   * It is not allowed to use register that are being declared as global, as
>   scratch register.
>
>   * For an interrupt function it is safety to use only call-used registers
>   which are saved in prologue. In 'rename_registers' optimization pass this
>   check is done in HARD_REGNO_RENAME_OK macro. This patch add
>   HARD_REGNO_SCRATCH_OK macro for 'peephole2' pass. The
>   HARD_REGNO_SCRATCH_OK macro sould be difined for target which use interrupt
>   and 'match_scratch' in peephole2 (avr, m68k).

Please make a new target hook instead (I know that the existing
HARD_REGNO_RENAME_OK is still a macro).  Thanks.

Ian


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