On 10/11/2018 03:23 PM, Peter Bergner wrote:
On 10/11/18 1:18 PM, Peter Bergner wrote:
Ok, after working in gdb, I see that the PA-RISC port still uses reload
and not LRA, but it too seems to have the same issue of reusing input
regs that have REG_DEAD notes, so the question still stands.  It's just
that whatever fix we come up with will have to be to both LRA and reload.
On second thought, I'm thinking we should just leave reload alone and
only fix this in LRA.  That means we'd have to disable the reg copy
handling when not using LRA though, which might be another reason to
get targets to move to LRA?  I've verified the following patch gets
the PA-RISC test case to pass again.  Thoughts?

If ok, I still have to dig into the fails we're seeing on LRA targets.

I think it has a sense because even if LRA has the same problem, it will be hard to fix it in reload and LRA.  Nobody worked on reload pass for a long time and it is not worth to fix it because we are moving from reload.

I suspect that LRA might be immune to these failures because it generates new reload pseudos if it is necessary for insn constraints.  Plus there is some primitive value numbering in LRA which can avoid the problem.

In any case, the patch is ok for me.

        * ira-lives (non_conflicting_reg_copy_p): Disable for non LRA targets.

Index: gcc/ira-lives.c
===================================================================
--- gcc/ira-lives.c     (revision 264897)
+++ gcc/ira-lives.c     (working copy)
@@ -1064,6 +1064,10 @@ find_call_crossed_cheap_reg (rtx_insn *i
  rtx
  non_conflicting_reg_copy_p (rtx_insn *insn)
  {
+  /* Disallow this for non LRA targets.  */
+  if (!targetm.lra_p ())
+    return NULL_RTX;
+
    rtx set = single_set (insn);
/* Disallow anything other than a simple register to register copy


Reply via email to