RE: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-18 Thread Robert Suchanek
Hi, > > gcc/ > > * config/mips/mips-protos.h (mips_hard_regno_rename_ok): New > > prototype. > > * config/mips/mips.c (mips_hard_regno_rename_ok): New > > function. > > (mips_hard_regno_scratch_ok): Likewise. > > (TARGET_HARD_REGNO_SCRATCH_OK): Define macro. > > * config/mips/m

Re: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-15 Thread Mike Stump
On Aug 15, 2015, at 9:19 AM, Richard Sandiford wrote: > Mike Stump writes: >> On Aug 15, 2015, at 3:32 AM, Richard Sandiford >> wrote: >>> >>> The port is only buggy if they have define_peephole2s with match_scratches >>> and those match_scratches require a register that would be saved by >>>

Re: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-15 Thread Richard Sandiford
Mike Stump writes: > On Aug 15, 2015, at 3:32 AM, Richard Sandiford > wrote: >> >> The port is only buggy if they have define_peephole2s with match_scratches >> and those match_scratches require a register that would be saved by >> an interrupt function. In other cases defining T_H_R_S_O would

Re: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-15 Thread Mike Stump
On Aug 15, 2015, at 3:32 AM, Richard Sandiford wrote: > > The port is only buggy if they have define_peephole2s with match_scratches > and those match_scratches require a register that would be saved by > an interrupt function. In other cases defining T_H_R_S_O would have > no effect (but still

Re: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-15 Thread Richard Sandiford
Robert Suchanek writes: >> > You also need to do the same thing for TARGET_HARD_REGNO_SCRATCH_OK, >> > to stop peephole2 from using unsaved registers as scratch registers. >> > >> > I should dig out my patches to clean up this interface. It's just >> > too brittle to have two macros that say what

RE: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-14 Thread Moore, Catherine
> -Original Message- > From: Robert Suchanek [mailto:robert.sucha...@imgtec.com] > Sent: Friday, August 14, 2015 8:01 AM > To: Mike Stump; Richard Sandiford > Cc: Moore, Catherine; Matthew Fortune; gcc-patches@gcc.gnu.org > Subject: RE: [PATCH][MIPS] Fix regist

RE: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-14 Thread Robert Suchanek
Hi, > > You also need to do the same thing for TARGET_HARD_REGNO_SCRATCH_OK, > > to stop peephole2 from using unsaved registers as scratch registers. > > > > I should dig out my patches to clean up this interface. It's just > > too brittle to have two macros that say what registers can be used >

Re: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-13 Thread Mike Stump
On Aug 13, 2015, at 12:54 PM, Richard Sandiford wrote: > >> It was discovered that with the attached test case compiled with -O2 >> -funroll-loops, the regrename pass renamed one of the registers ($2) >> to $8 that was not saved by the prologue. >> >> The attached patch fixes it by defining mac

Re: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-13 Thread Richard Sandiford
Robert Suchanek writes: > Hi, > > It was discovered that with the attached test case compiled with -O2 > -funroll-loops, the regrename pass renamed one of the registers ($2) > to $8 that was not saved by the prologue. > > The attached patch fixes it by defining macro HARD_REGNO_RENAME_OK > that re

RE: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-13 Thread Moore, Catherine
> -Original Message- > From: Matthew Fortune [mailto:matthew.fort...@imgtec.com] > Sent: Thursday, August 13, 2015 7:20 AM > To: Robert Suchanek; Moore, Catherine > Cc: gcc-patches@gcc.gnu.org > Subject: RE: [PATCH][MIPS] Fix register renaming in the interrupt handler

RE: [PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-13 Thread Matthew Fortune
I'd like to give Catherine chance to review this, I notice a couple of formatting nits in the test case: Robert Suchanek writes: > a/gcc/testsuite/gcc.target/mips/interrupt_handler-bug-1.c > b/gcc/testsuite/gcc.target/mips/interrupt_handler-bug-1.c > new file mode 100644 > index 000..877d00c

[PATCH][MIPS] Fix register renaming in the interrupt handlers

2015-08-13 Thread Robert Suchanek
Hi, It was discovered that with the attached test case compiled with -O2 -funroll-loops, the regrename pass renamed one of the registers ($2) to $8 that was not saved by the prologue. The attached patch fixes it by defining macro HARD_REGNO_RENAME_OK that returns zero iff the current function is