Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-18 Thread Richard Sandiford
Richard Sandiford rdsandif...@googlemail.com writes: I think a cleaner way of doing it would be to have helper functions that switch in and out of the eliminated form, storing the old form in fields of a new structure (either separate from address_info, or a local inheritance of it). We

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-16 Thread Robert Suchanek
; Vladimir Makarov; gcc-patches@gcc.gnu.org; Kyrill Tkachov Subject: Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend Robert Suchanek robert.sucha...@imgtec.com writes: Are you working on the solution to fix the breakage? I'm about to look into this and wanted to find out how far we got

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-15 Thread Robert Suchanek
Ping. From: Robert Suchanek Sent: 14 May 2014 14:24 To: Richard Sandiford; Matthew Fortune Cc: Vladimir Makarov; gcc-patches@gcc.gnu.org; Kyrill Tkachov Subject: RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend Hi Richard, Are you working

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-15 Thread Richard Sandiford
Robert Suchanek robert.sucha...@imgtec.com writes: Are you working on the solution to fix the breakage? I'm about to look into this and wanted to find out how far we got with this. You mean the cleaner way I suggested, or something else? If you want to have a go then feel free. Otherwise I'll

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-14 Thread Robert Suchanek
Cc: Vladimir Makarov; Robert Suchanek; gcc-patches@gcc.gnu.org; Kyrill Tkachov Subject: Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend Thanks for looking at this. Matthew Fortune matthew.fort...@imgtec.com writes: Hi all, This caused some testsuite failures on arm: FAIL

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-10 Thread Richard Sandiford
Thanks for looking at this. Matthew Fortune matthew.fort...@imgtec.com writes: Hi all, This caused some testsuite failures on arm: FAIL: gcc.target/arm/vfp-ldmdbd.c scan-assembler fldmdbd FAIL: gcc.target/arm/vfp-ldmdbs.c scan-assembler fldmdbs FAIL: gcc.target/arm/vfp-ldmiad.c

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-09 Thread Matthew Fortune
Richard/Vlad, Richard Sandiford rdsandif...@googlemail.com writes: Kyrill Tkachov kyrylo.tkac...@arm.com writes: On 03/05/14 20:21, Richard Sandiford wrote: ...snip... Hi all, This caused some testsuite failures on arm: FAIL: gcc.target/arm/vfp-ldmdbd.c scan-assembler fldmdbd FAIL:

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-06 Thread Kyrill Tkachov
On 03/05/14 20:21, Richard Sandiford wrote: Vladimir Makarov vmaka...@redhat.com writes: Not sure how the constraint would/should exclude $sp-based address in LRA. In this particular case, a spilled pseudo is changed to memory giving the following RTL form: (insn 30 29 31 4 (set (reg:SI 4 $4)

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-06 Thread Richard Sandiford
Kyrill Tkachov kyrylo.tkac...@arm.com writes: On 03/05/14 20:21, Richard Sandiford wrote: Vladimir Makarov vmaka...@redhat.com writes: Not sure how the constraint would/should exclude $sp-based address in LRA. In this particular case, a spilled pseudo is changed to memory giving the

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-05-03 Thread Richard Sandiford
Vladimir Makarov vmaka...@redhat.com writes: Not sure how the constraint would/should exclude $sp-based address in LRA. In this particular case, a spilled pseudo is changed to memory giving the following RTL form: (insn 30 29 31 4 (set (reg:SI 4 $4) (and:SI (mem/c:SI (plus:SI

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-23 Thread Robert Suchanek
Yeah, I think the lack of elimination is the problem. process_address eliminates $frame temporarily before checking whether the address is valid, but the places that check EXTRA_CONSTRAINT_STR pass the original uneliminated address. So the legitimate_address_p hook sees the $sp-based

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-23 Thread Richard Sandiford
Robert Suchanek robert.sucha...@imgtec.com writes: If we were going to XFAIL the test then it would apply specifically for -mips16 -O1. In any other combination it appears to work. Would that be a stopper? Hmm, in that case maybe we should just leave it failing. The alternative would be to

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-23 Thread Robert Suchanek
Hmm, in that case maybe we should just leave it failing. The alternative would be to skip the test altogther for MIPS, with a PR referencing it, but that seems a bit over-the-top. I'd leave it as it is for now until the consensus regarding the 'X' constraint is reached. Please use comments

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-23 Thread Vladimir Makarov
On 2014-04-21, 8:23 AM, Richard Sandiford wrote: Robert Suchanek robert.sucha...@imgtec.com writes: Did you see the failures even after your mips_regno_mode_ok_for_base_p change? LRA should know how to reload a W address. Yes but I realize there is more. It fails because $sp is now included

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-21 Thread Richard Sandiford
Robert Suchanek robert.sucha...@imgtec.com writes: Did you see the failures even after your mips_regno_mode_ok_for_base_p change? LRA should know how to reload a W address. Yes but I realize there is more. It fails because $sp is now included in BASE_REG_CLASS and W is based on it.

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-16 Thread Robert Suchanek
Did you see the failures even after your mips_regno_mode_ok_for_base_p change? LRA should know how to reload a W address. Yes but I realize there is more. It fails because $sp is now included in BASE_REG_CLASS and W is based on it. However, I suppose that it would be too eager to say

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-15 Thread Richard Sandiford
Robert Suchanek robert.sucha...@imgtec.com writes: Hmm, marking them fixed was supposed to be a temporary reload-only thing, until the move to LRA. It should never be worse to spill to these GPRs over spilling to the stack, if the value isn't live across a call. I would say this also affects

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-14 Thread Robert Suchanek
So yeah, I agree this is right after all, sorry. Let's delete the comment starting at There are two problems here: at the same time. Ok. mips_regno_to_class should then map $sp to the new class, since it's now the smallest containing class. (We really should set that up automatically one

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-10 Thread Richard Sandiford
Richard Sandiford rdsandif...@googlemail.com writes: Robert Suchanek robert.sucha...@imgtec.com writes: I'm not particularly happy with this either. This was an attempt to fix an ICE for the following RTL (gcc.dg/torture/asm-subreg-1.c compiled with -mips32r2 -mips16 -O1): (insn 9 8 0 2

RE: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-09 Thread Robert Suchanek
FYI, all other targets that have LRA optionally selectable or deselectable use -mno-lra for this (even when -mlra is the default), it would be better for consistency not to invent new switch names for that. Agreed. -return !strict_p || GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode)

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-04-09 Thread Richard Sandiford
Robert Suchanek robert.sucha...@imgtec.com writes: FYI, all other targets that have LRA optionally selectable or deselectable use -mno-lra for this (even when -mlra is the default), it would be better for consistency not to invent new switch names for that. Agreed. -return !strict_p ||

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-03-29 Thread Richard Sandiford
First of all, thanks a lot for doing this. Robert Suchanek robert.sucha...@imgtec.com writes: diff --git gcc/config/mips/mips.c gcc/config/mips/mips.c index 143169b..f27a801 100644 --- gcc/config/mips/mips.c +++ gcc/config/mips/mips.c @@ -2255,7 +2255,7 @@ mips_regno_mode_ok_for_base_p (int

Re: [RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-03-29 Thread Jakub Jelinek
On Sat, Mar 29, 2014 at 01:07:40AM +, Robert Suchanek wrote: This patch enables LRA by default for MIPS. The classic reload is still available and can be enabled via -mreload switch. FYI, all other targets that have LRA optionally selectable or deselectable use -mno-lra for this (even when

[RFC][PATCH][MIPS] Patch to enable LRA for MIPS backend

2014-03-28 Thread Robert Suchanek
Hi All, This patch enables LRA by default for MIPS. The classic reload is still available and can be enabled via -mreload switch. All regression are fixed, with one exception described below. There was a necessary change in the LRA core as I believe there was a genuine unhandled case in LRA