Module Name:    src
Committed By:   kalvisd
Date:           Mon Dec 18 21:11:43 UTC 2023

Modified Files:
        src/external/gpl3/gcc.old/dist/gcc: reload1.c

Log Message:
gcc.old: 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.11 -r1.12 src/external/gpl3/gcc.old/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.old/dist/gcc/reload1.c
diff -u src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.11 src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.12
--- src/external/gpl3/gcc.old/dist/gcc/reload1.c:1.11	Mon Feb 20 02:11:07 2023
+++ src/external/gpl3/gcc.old/dist/gcc/reload1.c	Mon Dec 18 21:11:42 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