Module Name:    src
Committed By:   matt
Date:           Thu Feb  2 13:32:18 UTC 2012

Modified Files:
        src/gnu/dist/gcc4/gcc/config/vax: vax.c

Log Message:
Fix a bug in movmemsi in which couldn't handle sym(reg) expressions properly.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/gnu/dist/gcc4/gcc/config/vax/vax.c

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

Modified files:

Index: src/gnu/dist/gcc4/gcc/config/vax/vax.c
diff -u src/gnu/dist/gcc4/gcc/config/vax/vax.c:1.15 src/gnu/dist/gcc4/gcc/config/vax/vax.c:1.16
--- src/gnu/dist/gcc4/gcc/config/vax/vax.c:1.15	Fri Apr 20 16:30:32 2007
+++ src/gnu/dist/gcc4/gcc/config/vax/vax.c	Thu Feb  2 13:32:17 2012
@@ -1545,8 +1545,29 @@ mkrtx(enum rtx_code code, enum machine_m
 
   if (GET_CODE (base) == PLUS)
     {
-      off += INTVAL (XEXP (base, 1));
-      base = XEXP (base, 0);
+      rtx a = XEXP (base, 0);
+      rtx b = XEXP (base, 1);
+      if (GET_CODE (b) == CONST_INT)
+	{
+          off += INTVAL (b);
+          base = a;
+	}
+      else if (GET_CODE (a) == REG && GET_CODE (b) == SYMBOL_REF)
+	{
+	  if (off != 0)
+	    {
+	      base = gen_rtx_PLUS (Pmode, a, plus_constant(b, off));
+	      off = 0;
+	    }
+	}
+      else if (GET_CODE (a) == REG && GET_CODE (b) == PLUS)
+	{
+          off += INTVAL (XEXP (b, 1));
+	  base = gen_rtx_PLUS (Pmode, a, plus_constant(XEXP (b, 0), off));
+	  off = 0;
+	}
+      else
+	gcc_assert(0);
     }
   if (code == POST_INC)
     tmp = gen_rtx_POST_INC (SImode, base);

Reply via email to