summaryrefslogtreecommitdiffstats
path: root/toolchain/gcc/4.2.1/905-avr32-fix-folding-machine-reorg-optimizations.patch
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/gcc/4.2.1/905-avr32-fix-folding-machine-reorg-optimizations.patch')
-rw-r--r--toolchain/gcc/4.2.1/905-avr32-fix-folding-machine-reorg-optimizations.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/toolchain/gcc/4.2.1/905-avr32-fix-folding-machine-reorg-optimizations.patch b/toolchain/gcc/4.2.1/905-avr32-fix-folding-machine-reorg-optimizations.patch
new file mode 100644
index 000000000..7a160d6e9
--- /dev/null
+++ b/toolchain/gcc/4.2.1/905-avr32-fix-folding-machine-reorg-optimizations.patch
@@ -0,0 +1,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))
+ {