[arch-commits] Commit in avr-gcc/trunk (PKGBUILD fix_instructions_out_of_range.patch)

Anatol Pomozov anatolik at archlinux.org
Thu Feb 25 18:03:40 UTC 2016


    Date: Thursday, February 25, 2016 @ 19:03:40
  Author: anatolik
Revision: 163436

FS#47959 Pull upstream patch that fixes 'invalid asm code' issue

Added:
  avr-gcc/trunk/fix_instructions_out_of_range.patch
Modified:
  avr-gcc/trunk/PKGBUILD

-------------------------------------+
 PKGBUILD                            |   19 +++++---
 fix_instructions_out_of_range.patch |   80 ++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-02-25 17:01:43 UTC (rev 163435)
+++ PKGBUILD	2016-02-25 18:03:40 UTC (rev 163436)
@@ -8,8 +8,8 @@
 
 pkgname=avr-gcc
 pkgver=5.3.0
-pkgrel=1
-#_snapshot=5-20150519
+pkgrel=2
+_snapshot=5-20160223
 _islver=0.15
 pkgdesc='The GNU AVR Compiler Collection'
 arch=(i686 x86_64)
@@ -18,12 +18,14 @@
 depends=(avr-binutils gcc-libs libmpc)
 optdepends=('avr-libc: Standard C library for Atmel AVR development')
 options=(!emptydirs !strip)
-source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2
-        #ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2
+source=(#ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2
+        ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2
         http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2
+        fix_instructions_out_of_range.patch
        )
-sha1sums=('0612270b103941da08376df4d0ef4e5662a2e9eb'
-          '1e30e09a5fc2c9e1aa4bdb8c9c21fdff20a7cd12')
+sha1sums=('13b7c4de9da654ef968e658c77e32b265aa4eb5b'
+          '1e30e09a5fc2c9e1aa4bdb8c9c21fdff20a7cd12'
+          'e1f8295d2c0507cf798a641877fdce7a69681739')
 
 if [ -n "${_snapshot}" ]; then
   _basedir=gcc-${_snapshot}
@@ -31,6 +33,11 @@
   _basedir=gcc-${pkgver}
 fi
 
+prepare() {
+  cd $_basedir
+  patch -p1 < ../fix_instructions_out_of_range.patch
+}
+
 build() {
     cd ${srcdir}/${_basedir} 
 

Added: fix_instructions_out_of_range.patch
===================================================================
--- fix_instructions_out_of_range.patch	                        (rev 0)
+++ fix_instructions_out_of_range.patch	2016-02-25 18:03:40 UTC (rev 163436)
@@ -0,0 +1,80 @@
+commit 8c1cab24c7ef8ec53c374bcfe2286250155f1db3
+Author: denisc <denisc at 138bc75d-0d04-0410-961f-82ee72b054a4>
+Date:   Wed Oct 28 17:35:27 2015 +0000
+
+    gcc/ChangeLog
+    
+    	PR target/67839
+    	* config/avr/predicates.md (low_io_address_operand): Don't
+    	consider MODE when computing upper bound.
+    	(io_address_operand): Likewise.
+    
+    gcc/testsuite/ChangeLog
+    
+    	PR target/67839
+    	* gcc.target/avr/pr67839.c: New test.
+    
+    
+    
+    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229495 138bc75d-0d04-0410-961f-82ee72b054a4
+
+ 2015-10-28  Jan Hubicka  <hubicka at ucw.cz>
+ 
+ 	* fold-const.c (operand_equal_p): Do not verify that types are
+diff --git a/gcc/config/avr/predicates.md b/gcc/config/avr/predicates.md
+index 2d12bc6..622bc0b 100644
+--- a/gcc/config/avr/predicates.md
++++ b/gcc/config/avr/predicates.md
+@@ -46,7 +46,7 @@
+ (define_special_predicate "low_io_address_operand"
+   (ior (and (match_code "const_int")
+ 	    (match_test "IN_RANGE (INTVAL (op) - avr_arch->sfr_offset,
+-				   0, 0x20 - GET_MODE_SIZE (mode))"))
++				   0, 0x1F)"))
+        (and (match_code "symbol_ref")
+ 	    (match_test "SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_IO_LOW"))))
+ 
+@@ -60,7 +60,7 @@
+ (define_special_predicate "io_address_operand"
+   (ior (and (match_code "const_int")
+ 	    (match_test "IN_RANGE (INTVAL (op) - avr_arch->sfr_offset,
+-				   0, 0x40 - GET_MODE_SIZE (mode))"))
++				   0, 0x3F)"))
+        (and (match_code "symbol_ref")
+ 	    (match_test "SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_IO"))))
+ 
+diff --git a/gcc/testsuite/gcc.target/avr/pr67839.c b/gcc/testsuite/gcc.target/avr/pr67839.c
+new file mode 100644
+index 0000000..604ab4b
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/avr/pr67839.c
+@@ -0,0 +1,29 @@
++/* { dg-do compile } */
++/* { dg-options "-Os" } */
++/* { dg-final { scan-assembler "sbi 0x1f,0" } } */
++/* { dg-final { scan-assembler "cbi 0x1f,0" } } */
++/* { dg-final { scan-assembler-not "sbi 0x20,0" } } */
++/* { dg-final { scan-assembler-not "cbi 0x20,0" } } */
++/* { dg-final { scan-assembler "in r\\d+,__SREG__" } } */
++/* { dg-final { scan-assembler "out __SREG__,r\\d+" } } */
++/* { dg-final { scan-assembler-not "in r\\d+,0x40" } } */
++/* { dg-final { scan-assembler-not "out 0x40, r\\d+" } } */
++
++/* This testcase verifies that SBI/CBI/SBIS/SBIC
++   and IN/OUT instructions are not generated for
++   an IO addresses outside the valid range.
++*/
++#define IO_ADDR(x) (*((volatile char *)x + __AVR_SFR_OFFSET__))
++int main ()
++{
++  IO_ADDR(0x1f) |= 1;
++  IO_ADDR(0x1f) &= 0xFE;
++
++  IO_ADDR(0x20) |= 1;
++  IO_ADDR(0x20) &= 0xFE;
++
++  IO_ADDR(0x3f) = IO_ADDR(0x3f);
++
++  IO_ADDR(0x40) = IO_ADDR(0x40);
++  return 0;
++}



More information about the arch-commits mailing list