patches/gcc/3.4.4/601-gcc34-arm-ldm-peephole2.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
yann@1
     1
The 30_all_gcc34-arm-ldm-peephole.patch from Debian was conflicting 
yann@1
     2
with the newer 36_all_pr16201-fix.patch, so i cut out the hunk from 
yann@1
     3
it that was causing problems and grabbed an updated version from 
yann@1
     4
upstream cvs.
yann@1
     5
yann@1
     6
Index: gcc/config/arm/arm.c
yann@1
     7
===================================================================
yann@1
     8
RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.c,v
yann@1
     9
retrieving revision 1.432
yann@1
    10
retrieving revision 1.433
yann@1
    11
diff -u -r1.432 -r1.433
yann@1
    12
--- gcc-3.4.4/gcc/config/arm/arm.c	29 Mar 2005 03:00:23 -0000	1.432
yann@1
    13
+++ gcc-3.4.4/gcc/config/arm/arm.c	1 Apr 2005 11:02:22 -0000	1.433
yann@1
    14
@@ -5139,6 +5139,10 @@
yann@1
    15
 int
yann@1
    16
 adjacent_mem_locations (rtx a, rtx b)
yann@1
    17
 {
yann@1
    18
+  /* We don't guarantee to preserve the order of these memory refs.  */
yann@1
    19
+  if (volatile_refs_p (a) || volatile_refs_p (b))
yann@1
    20
+    return 0;
yann@1
    21
+
yann@1
    22
   if ((GET_CODE (XEXP (a, 0)) == REG
yann@1
    23
        || (GET_CODE (XEXP (a, 0)) == PLUS
yann@1
    24
 	   && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
yann@1
    25
@@ -5178,6 +5182,17 @@
yann@1
    26
 	return 0;
yann@1
    27
 
yann@1
    28
       val_diff = val1 - val0;
yann@1
    29
+
yann@1
    30
+      if (arm_ld_sched)
yann@1
    31
+	{
yann@1
    32
+	  /* If the target has load delay slots, then there's no benefit
yann@1
    33
+	     to using an ldm instruction unless the offset is zero and
yann@1
    34
+	     we are optimizing for size.  */
yann@1
    35
+	  return (optimize_size && (REGNO (reg0) == REGNO (reg1))
yann@1
    36
+		  && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4)
yann@1
    37
+		  && (val_diff == 4 || val_diff == -4));
yann@1
    38
+	}
yann@1
    39
+
yann@1
    40
       return ((REGNO (reg0) == REGNO (reg1))
yann@1
    41
 	      && (val_diff == 4 || val_diff == -4));
yann@1
    42
     }