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/mips.h

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 rdsandif...@googlemail.com wrote: Mike Stump mikest...@comcast.net writes: On Aug 15, 2015, at 3:32 AM, Richard Sandiford rdsandif...@googlemail.com wrote: The port is only buggy if they have define_peephole2s with match_scratches and those

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

2015-08-15 Thread Richard Sandiford
Robert Suchanek robert.sucha...@imgtec.com 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

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 rdsandif...@googlemail.com 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

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

2015-08-15 Thread Richard Sandiford
Mike Stump mikest...@comcast.net writes: On Aug 15, 2015, at 3:32 AM, Richard Sandiford rdsandif...@googlemail.com 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

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 register renaming in the interrupt

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 after

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 robert.sucha...@imgtec.com 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

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 handlers I'd like to give

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 rdsandif...@googlemail.com 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

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

2015-08-13 Thread Richard Sandiford
Robert Suchanek robert.sucha...@imgtec.com 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