Module Name:    src
Committed By:   martin
Date:           Tue Dec 19 12:24:21 UTC 2023

Modified Files:
        src/external/gpl3/gcc/dist/gcc [netbsd-10]: reload1.c

Log Message:
Pull up following revision(s) (requested by kalvisd in ticket #507):

        external/gpl3/gcc.old/dist/gcc/reload1.c: revision 1.12
        (applied to external/gpl3/gcc/dist/gcc/reload1.c)

gcc: vax: gcc/reload1.c: PR port-vax/57646
    Where an output register might be reloaded, and it is a memory
    reference, and the address is auto-incremented, any previously
    reloaded copy of the address must be invalidated.
    XXXKD: Hidden within ``#ifdef NB_FIX_VAX_BACKEND'' and enabled
    only for vax at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.6.1 src/external/gpl3/gcc/dist/gcc/reload1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/reload1.c
diff -u src/external/gpl3/gcc/dist/gcc/reload1.c:1.9 src/external/gpl3/gcc/dist/gcc/reload1.c:1.9.6.1
--- src/external/gpl3/gcc/dist/gcc/reload1.c:1.9	Sun Apr 11 00:02:11 2021
+++ src/external/gpl3/gcc/dist/gcc/reload1.c	Tue Dec 19 12:24:21 2023
@@ -8377,6 +8377,44 @@ emit_reload_insns (class insn_chain *cha
 		reg_last_reload_reg[out_regno + k] = 0;
 	    }
 	}
+
+#ifdef NB_FIX_VAX_BACKEND
+#if AUTO_INC_DEC
+      /* Where an output register might be reloaded, and it is a
+	 memory reference, and the address is auto-incremented, any
+	 previously reloaded copy of the address must be
+	 invalidated. */
+      if (i < 0
+	  && rld[r].out != 0
+	  && MEM_P (rld[r].out))
+	{
+	  rtx out = XEXP (rld[r].out, 0); /* address expression */
+	  enum rtx_code code = GET_CODE (out);
+
+	  if (code != POST_INC && code != POST_DEC
+	      && code != PRE_INC && code != PRE_DEC)
+	    {
+	      /* do nothing */
+	    }
+	  else
+	    {
+	      int out_regno = REGNO (XEXP (out, 0));
+	      machine_mode mode = GET_MODE (XEXP (out, 0));
+
+	      /* for the moment, handle only the case where out_regno
+		 is a hardware register */
+
+	      if (HARD_REGISTER_NUM_P (out_regno))
+		{
+		  int k, out_nregs = hard_regno_nregs (out_regno, mode);
+
+		  for (k = 0; k < out_nregs; k++)
+		    reg_last_reload_reg[out_regno + k] = 0;
+		}
+	    }
+	}
+#endif /* AUTO_INC_DEC */
+#endif
     }
   reg_reloaded_dead |= reg_reloaded_died;
 }

Reply via email to