summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorvonPalitroque2016-09-12 17:06:58 -0400
committervonPalitroque2016-09-12 17:06:58 -0400
commitfac899282743854ce3e9939d55860e874eebb547 (patch)
treecd4f48ec0b695805590201f8f0ac3848e02e0c84
parent53182074d0c7f1fcb0155542ba0a9cb5f255eb9f (diff)
downloadaur-fac899282743854ce3e9939d55860e874eebb547.tar.gz
Fixed bug in delay_cycles_32x insn.
There is a bug in the insn that generates the delay loop for the instrinsic __delay_cycles() function. This bug is noticeable under some circumstances, where the target is an MSP430X core and the cycle count is representable as a 32 bit number. This bug results in the corruption of r14 in a function that utilizes the instrinsic under the above conditions. A bug report has been filed at [1] with a patch submitted. The same patch is applied here. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77570
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD10
-rw-r--r--fix-insn-delay_cycles_32x.patch21
3 files changed, 32 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 571cedf48f2f..a9388feba0ad 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Sat Aug 27 22:11:54 UTC 2016
+# Mon Sep 12 21:06:56 UTC 2016
pkgbase = msp430-elf-gcc
pkgdesc = The GNU Compiler Collection for the msp430-elf target.
pkgver = 6.2.0
@@ -25,8 +25,10 @@ pkgbase = msp430-elf-gcc
options = !strip
source = ftp://gcc.gnu.org/pub/gcc/releases/gcc-6.2.0/gcc-6.2.0.tar.bz2
source = http://isl.gforge.inria.fr/isl-0.17.tar.bz2
+ source = fix-insn-delay_cycles_32x.patch
sha256sums = 9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5
sha256sums = 439b322f313aef562302ac162caccb0b90daedf88d49d62e00a5db6b9d83d6bb
+ sha256sums = 0cd87771d1fd8ec5d0c413ae8c18b9b2599f2c66a0fa8b5fd4aa2f01ac1b5f86
pkgname = msp430-elf-gcc
diff --git a/PKGBUILD b/PKGBUILD
index 5e6376bdeac3..3b92ae5ad187 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,15 +15,21 @@ conflicts=("${_target}-gcc-stage1")
replaces=("${_target}-gcc-stage1")
provides=("${_target}-gcc-stage1")
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2
- http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2)
+ http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2
+ fix-insn-delay_cycles_32x.patch)
sha256sums=('9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5'
- '439b322f313aef562302ac162caccb0b90daedf88d49d62e00a5db6b9d83d6bb')
+ '439b322f313aef562302ac162caccb0b90daedf88d49d62e00a5db6b9d83d6bb'
+ '0cd87771d1fd8ec5d0c413ae8c18b9b2599f2c66a0fa8b5fd4aa2f01ac1b5f86')
prepare() {
cd "${srcdir}/gcc-${pkgver}"
[[ -L isl ]] && rm -f isl
ln -s ../isl-${_islver} isl
+ # fix for:
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77570
+ patch -p1 < ../fix-insn-delay_cycles_32x.patch
+
[[ -d gcc-build ]] && rm -rf gcc-build
mkdir gcc-build
}
diff --git a/fix-insn-delay_cycles_32x.patch b/fix-insn-delay_cycles_32x.patch
new file mode 100644
index 000000000000..4da202bc57ed
--- /dev/null
+++ b/fix-insn-delay_cycles_32x.patch
@@ -0,0 +1,21 @@
+diff -rupN gcc-6.2.0-pristine/gcc/config/msp430/msp430.md gcc-6.2.0-changed/gcc/config/msp430/msp430.md
+--- gcc-6.2.0-pristine/gcc/config/msp430/msp430.md 2016-02-11 18:53:54.000000000 -0500
++++ gcc-6.2.0-changed/gcc/config/msp430/msp430.md 2016-09-12 16:42:58.843149306 -0400
+@@ -1442,7 +1442,7 @@
+ (match_operand 1 "immediate_operand" "i")
+ ] UNS_DELAY_32X)]
+ ""
+- "PUSHM.A #2,r13
++ "PUSHM.A #2,r14
+ MOV.W %A0, r13
+ MOV.W %B0, r14
+ 1: SUB.W #1, r13
+@@ -1450,7 +1450,7 @@
+ JNE 1b
+ TST.W r13
+ JNE 1b
+- POPM.A #2,r13"
++ POPM.A #2,r14"
+ )
+
+ (define_insn "delay_cycles_16"