summaryrefslogtreecommitdiffstats
path: root/toolchain/gcc/4.2.1/905-avr32-fix-folding-machine-reorg-optimizations.patch
blob: 7a160d6e95bdfea9305ecdafda21bdf77cb36499 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Index: a/gcc/config/avr32/avr32.c
===================================================================
--- a/gcc/config/avr32/avr32.c	(revision 31997)
+++ b/gcc/config/avr32/avr32.c	(working copy)
@@ -6323,25 +6323,26 @@
                 /* If used any other place than as a pointer or as the
 	         destination register we failed */
                 if (!(single_set (scan)
-                    && GET_CODE (PATTERN (scan)) == SET
-                    && ((MEM_P (SET_DEST (PATTERN (scan)))
-                        && REG_P (XEXP (SET_DEST (PATTERN (scan)), 0))
-                        && REGNO (XEXP (SET_DEST (PATTERN (scan)), 0)) ==
-                          REGNO (reg)) || (MEM_P (SET_SRC (PATTERN (scan)))
-                              &&
-                              REG_P (XEXP
-                                  (SET_SRC (PATTERN (scan)),
-                                      0))
-                                      &&
-                                      REGNO (XEXP
-                                          (SET_SRC (PATTERN (scan)),
-                                              0)) == REGNO (reg))))
-                                              && !(GET_CODE (PATTERN (scan)) == SET
-                                                  && REG_P (SET_DEST (PATTERN (scan)))
-                                                  && !regno_use_in (REGNO (reg),
-                                                      SET_SRC (PATTERN (scan)))))
+                      && GET_CODE (PATTERN (scan)) == SET
+                      && ((MEM_P (SET_DEST (PATTERN (scan)))
+                           && REG_P (XEXP (SET_DEST (PATTERN (scan)), 0))
+                           && REGNO (XEXP (SET_DEST (PATTERN (scan)), 0)) == REGNO (reg))
+                          || (MEM_P (SET_SRC (PATTERN (scan)))
+                              && REG_P (XEXP (SET_SRC (PATTERN (scan)), 0))
+                              && REGNO (XEXP
+                                        (SET_SRC (PATTERN (scan)), 0)) == REGNO (reg))))
+                    && !(GET_CODE (PATTERN (scan)) == SET
+                         && REG_P (SET_DEST (PATTERN (scan)))
+                         && !regno_use_in (REGNO (reg),
+                                           SET_SRC (PATTERN (scan)))))
                   break;
 
+                /* We cannot replace the pointer in TImode insns
+                   as these has a differene addressing mode than the other
+                   memory insns. */
+                if ( GET_MODE (SET_DEST (PATTERN (scan))) == TImode )
+                  break;
+
                 /* Check if register is dead or set in this insn */
                 if (dead_or_set_p (scan, reg))
                   {