diff mbox

[1/2] gcc: Add fix for pandaboard in order to solve #442

Message ID 106087c3e58745919309b414d5109c4e7424126d.1367926493.git.christian.braunersorensen@prevas.dk
State Accepted
Delegated to: Esben Haabendal
Headers show

Commit Message

christian.braunersorensen@prevas.dk May 7, 2013, 11:37 a.m. UTC
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

Taken from:
https://code.launchpad.net/~paul-codesourcery/gcc-linaro/fix-lp-605255
bugreport:
https://bugs.launchpad.net/gcc-linaro/+bug/605255
---
 recipes/crosstool-ng/gcc/pandaboard-thumb.patch | 134 ++++++++++++++++++++++++
 recipes/crosstool-ng/gcc_1.13.2.oe              |   4 +
 2 files changed, 138 insertions(+)
 create mode 100644 recipes/crosstool-ng/gcc/pandaboard-thumb.patch
diff mbox

Patch

diff --git a/recipes/crosstool-ng/gcc/pandaboard-thumb.patch b/recipes/crosstool-ng/gcc/pandaboard-thumb.patch
new file mode 100644
index 0000000..12e9b25
--- /dev/null
+++ b/recipes/crosstool-ng/gcc/pandaboard-thumb.patch
@@ -0,0 +1,134 @@ 
+--- gcc-4.5.3/gcc/config/arm/predicates.md	2011-03-28 10:32:09.000000000 +0000
++++ gcc-4.5.3-patched/gcc/config/arm/predicates.md	2013-05-01 08:00:22.973845128 +0000
+@@ -303,10 +303,9 @@
+        (and (match_code "reg,subreg,mem")
+ 	    (match_operand 0 "nonimmediate_soft_df_operand"))))
+ 
+-(define_predicate "const_shift_operand"
++(define_predicate "const_shift_count"
+   (and (match_code "const_int")
+-       (ior (match_operand 0 "power_of_two_operand")
+-	    (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 32"))))
++	    (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 32")))
+ 
+ 
+ (define_special_predicate "load_multiple_operation"
+--- gcc-4.5.3/gcc/config/arm/thumb2.md	2010-04-02 08:32:00.000000000 +0000
++++ gcc-4.5.3-patched/gcc/config/arm/thumb2.md	2013-05-01 08:05:04.969869649 +0000
+@@ -55,7 +55,7 @@
+   [(set (match_operand:SI 0 "s_register_operand" "=r")
+ 	(and:SI (not:SI (match_operator:SI 4 "shift_operator"
+ 			 [(match_operand:SI 2 "s_register_operand" "r")
+-			  (match_operand:SI 3 "const_int_operand" "M")]))
++			  (match_operand:SI 3 "const_shift_count" "M")]))
+ 		(match_operand:SI 1 "s_register_operand" "r")))]
+   "TARGET_THUMB2"
+   "bic%?\\t%0, %1, %2%S4"
+@@ -124,7 +124,7 @@
+   [(set (match_operand:SI 0 "s_register_operand" "=r")
+ 	(not:SI (match_operator:SI 3 "shift_operator"
+ 		 [(match_operand:SI 1 "s_register_operand" "r")
+-		  (match_operand:SI 2 "const_int_operand"  "M")])))]
++		  (match_operand:SI 2 "const_shift_count"  "M")])))]
+   "TARGET_THUMB2"
+   "mvn%?\\t%0, %1%S3"
+   [(set_attr "predicable" "yes")
+@@ -136,7 +136,7 @@
+   [(set (reg:CC_NOOV CC_REGNUM)
+ 	(compare:CC_NOOV (not:SI (match_operator:SI 3 "shift_operator"
+ 			  [(match_operand:SI 1 "s_register_operand" "r")
+-			   (match_operand:SI 2 "const_int_operand"  "M")]))
++			   (match_operand:SI 2 "const_shift_count"  "M")]))
+ 			 (const_int 0)))
+    (set (match_operand:SI 0 "s_register_operand" "=r")
+ 	(not:SI (match_op_dup 3 [(match_dup 1) (match_dup 2)])))]
+@@ -151,7 +151,7 @@
+   [(set (reg:CC_NOOV CC_REGNUM)
+ 	(compare:CC_NOOV (not:SI (match_operator:SI 3 "shift_operator"
+ 			  [(match_operand:SI 1 "s_register_operand" "r")
+-			   (match_operand:SI 2 "const_int_operand"  "M")]))
++			   (match_operand:SI 2 "const_shift_count"  "M")]))
+ 			 (const_int 0)))
+    (clobber (match_scratch:SI 0 "=r"))]
+   "TARGET_THUMB2"
+@@ -321,7 +321,7 @@
+ 	(compare:CC (match_operand:SI   0 "s_register_operand" "r")
+ 		    (match_operator:SI  3 "shift_operator"
+ 		     [(match_operand:SI 1 "s_register_operand" "r")
+-		      (match_operand:SI 2 "const_int_operand"  "M")])))]
++		      (match_operand:SI 2 "const_shift_count"  "M")])))]
+   "TARGET_THUMB2"
+   "cmp%?\\t%0, %1%S3"
+   [(set_attr "conds" "set")
+@@ -333,7 +333,7 @@
+   [(set (reg:CC_SWP CC_REGNUM)
+ 	(compare:CC_SWP (match_operator:SI 3 "shift_operator"
+ 			 [(match_operand:SI 1 "s_register_operand" "r")
+-			  (match_operand:SI 2 "const_int_operand" "M")])
++			  (match_operand:SI 2 "const_shift_count" "M")])
+ 			(match_operand:SI 0 "s_register_operand" "r")))]
+   "TARGET_THUMB2"
+   "cmp%?\\t%0, %1%S3"
+@@ -347,7 +347,7 @@
+ 	(compare:CC (match_operand:SI 0 "s_register_operand" "r")
+ 		    (neg:SI (match_operator:SI 3 "shift_operator"
+ 			     [(match_operand:SI 1 "s_register_operand" "r")
+-			      (match_operand:SI 2 "const_int_operand" "M")]))))]
++			      (match_operand:SI 2 "const_shift_count" "M")]))))]
+   "TARGET_THUMB2"
+   "cmn%?\\t%0, %1%S3"
+   [(set_attr "conds" "set")
+@@ -459,7 +459,7 @@
+         (match_operator:SI 1 "shiftable_operator"
+           [(match_operator:SI 3 "shift_operator"
+              [(match_operand:SI 4 "s_register_operand" "r")
+-              (match_operand:SI 5 "const_int_operand" "M")])
++              (match_operand:SI 5 "const_shift_count" "M")])
+            (match_operand:SI 2 "s_register_operand" "r")]))]
+   "TARGET_THUMB2"
+   "%i1%?\\t%0, %2, %4%S3"
+@@ -492,7 +492,7 @@
+         (compare:CC_NOOV (match_operator:SI 1 "shiftable_operator"
+ 		          [(match_operator:SI 3 "shift_operator"
+ 		            [(match_operand:SI 4 "s_register_operand" "r")
+-		             (match_operand:SI 5 "const_int_operand" "M")])
++		             (match_operand:SI 5 "const_shift_count" "M")])
+ 		           (match_operand:SI 2 "s_register_operand" "r")])
+ 			 (const_int 0)))
+    (set (match_operand:SI 0 "s_register_operand" "=r")
+@@ -510,7 +510,7 @@
+         (compare:CC_NOOV (match_operator:SI 1 "shiftable_operator"
+ 		          [(match_operator:SI 3 "shift_operator"
+ 		            [(match_operand:SI 4 "s_register_operand" "r")
+-		             (match_operand:SI 5 "const_int_operand" "M")])
++		             (match_operand:SI 5 "const_shift_count" "M")])
+ 		           (match_operand:SI 2 "s_register_operand" "r")])
+ 			 (const_int 0)))
+    (clobber (match_scratch:SI 0 "=r"))]
+@@ -526,7 +526,7 @@
+ 	(minus:SI (match_operand:SI 1 "s_register_operand" "r")
+ 		  (match_operator:SI 2 "shift_operator"
+ 		   [(match_operand:SI 3 "s_register_operand" "r")
+-		    (match_operand:SI 4 "const_int_operand" "M")])))]
++		    (match_operand:SI 4 "const_shift_count" "M")])))]
+   "TARGET_THUMB2"
+   "sub%?\\t%0, %1, %3%S2"
+   [(set_attr "predicable" "yes")
+@@ -540,7 +540,7 @@
+ 	 (minus:SI (match_operand:SI 1 "s_register_operand" "r")
+ 		   (match_operator:SI 2 "shift_operator"
+ 		    [(match_operand:SI 3 "s_register_operand" "r")
+-		     (match_operand:SI 4 "const_int_operand" "M")]))
++		     (match_operand:SI 4 "const_shift_count" "M")]))
+ 	 (const_int 0)))
+    (set (match_operand:SI 0 "s_register_operand" "=r")
+ 	(minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3)
+@@ -558,7 +558,7 @@
+ 	 (minus:SI (match_operand:SI 1 "s_register_operand" "r")
+ 		   (match_operator:SI 2 "shift_operator"
+ 		    [(match_operand:SI 3 "s_register_operand" "r")
+-		     (match_operand:SI 4 "const_int_operand" "M")]))
++		     (match_operand:SI 4 "const_shift_count" "M")]))
+ 	 (const_int 0)))
+    (clobber (match_scratch:SI 0 "=r"))]
+   "TARGET_THUMB2"
diff --git a/recipes/crosstool-ng/gcc_1.13.2.oe b/recipes/crosstool-ng/gcc_1.13.2.oe
index ca1d6b6..bd08151 100644
--- a/recipes/crosstool-ng/gcc_1.13.2.oe
+++ b/recipes/crosstool-ng/gcc_1.13.2.oe
@@ -39,10 +39,14 @@  require gcc.inc
 
 SRC_URI += "file://glibc-rpc-export-again.patch;apply=0"
 SRC_URI += "file://glibc-2.14.1-cpuid-1.patch;apply=0"
+SRC_URI += "file://pandaboard-thumb.patch;apply=0"
 
 do_unpack[postfuncs] += "do_unpack_mvpatches"
 do_unpack_mvpatches () {
 	mkdir -p ${S}/glibc/2.14
 	mv ${SRCDIR}/glibc-rpc-export-again.patch ${S}/glibc/2.14
 	mv ${SRCDIR}/glibc-2.14.1-cpuid-1.patch ${S}/glibc/2.14
+
+	mkdir -p ${S}/gcc/4.5.3
+	mv ${SRCDIR}/pandaboard-thumb.patch ${S}/gcc/4.5.3
 }