Blame SOURCES/gcc48-rh1469697-15.patch

13f101
commit 54a2f1efc188660df9da78523b6925aab4c3a668
13f101
Author: rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
13f101
Date:   Tue Jan 13 14:11:15 2015 +0000
13f101
13f101
    gcc/
13f101
            * config/aarch64/aarch64.md (subsi3, *subsi3_uxtw, subdi3)
13f101
            (*sub_<optab><ALLX:mode>_<GPI:mode>, *sub_<optab><SHORT:mode>_si_uxtw)
13f101
            (*sub_<optab><ALLX:mode>_shft_<GPI:mode>)
13f101
            (*sub_<optab><SHORT:mode>_shft_si_uxtw, *sub_<optab><mode>_multp2)
13f101
            (*sub_<optab>si_multp2_uxtw, *sub_uxt<mode>_multp2)
13f101
            (*sub_uxtsi_multp2_uxtw): Add stack pointer sources.
13f101
    
13f101
    gcc/testsuite/
13f101
            * gcc.target/aarch64/subsp.c: New test.
13f101
    
13f101
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219533 138bc75d-0d04-0410-961f-82ee72b054a4
13f101
13f101
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
13f101
index 17082486ac8..a085c6acaf5 100644
13f101
--- a/gcc/config/aarch64/aarch64.md
13f101
+++ b/gcc/config/aarch64/aarch64.md
13f101
@@ -1610,8 +1610,8 @@
13f101
 
13f101
 (define_insn "subsi3"
13f101
   [(set (match_operand:SI 0 "register_operand" "=rk")
13f101
-	(minus:SI (match_operand:SI 1 "register_operand" "r")
13f101
-		   (match_operand:SI 2 "register_operand" "r")))]
13f101
+	(minus:SI (match_operand:SI 1 "register_operand" "rk")
13f101
+		  (match_operand:SI 2 "register_operand" "r")))]
13f101
   ""
13f101
   "sub\\t%w0, %w1, %w2"
13f101
   [(set_attr "v8type" "alu")
13f101
@@ -1622,7 +1622,7 @@
13f101
 (define_insn "*subsi3_uxtw"
13f101
   [(set (match_operand:DI 0 "register_operand" "=rk")
13f101
 	(zero_extend:DI
13f101
-         (minus:SI (match_operand:SI 1 "register_operand" "r")
13f101
+         (minus:SI (match_operand:SI 1 "register_operand" "rk")
13f101
 		   (match_operand:SI 2 "register_operand" "r"))))]
13f101
   ""
13f101
   "sub\\t%w0, %w1, %w2"
13f101
@@ -1632,7 +1632,7 @@
13f101
 
13f101
 (define_insn "subdi3"
13f101
   [(set (match_operand:DI 0 "register_operand" "=rk,!w")
13f101
-	(minus:DI (match_operand:DI 1 "register_operand" "r,!w")
13f101
+	(minus:DI (match_operand:DI 1 "register_operand" "rk,!w")
13f101
 		   (match_operand:DI 2 "register_operand" "r,!w")))]
13f101
   ""
13f101
   "@
13f101
@@ -1725,7 +1725,7 @@
13f101
 
13f101
 (define_insn "*sub_<optab><ALLX:mode>_<GPI:mode>"
13f101
   [(set (match_operand:GPI 0 "register_operand" "=rk")
13f101
-	(minus:GPI (match_operand:GPI 1 "register_operand" "r")
13f101
+	(minus:GPI (match_operand:GPI 1 "register_operand" "rk")
13f101
 		   (ANY_EXTEND:GPI
13f101
 		    (match_operand:ALLX 2 "register_operand" "r"))))]
13f101
   ""
13f101
@@ -1738,7 +1738,7 @@
13f101
 (define_insn "*sub_<optab><SHORT:mode>_si_uxtw"
13f101
   [(set (match_operand:DI 0 "register_operand" "=rk")
13f101
 	(zero_extend:DI
13f101
-         (minus:SI (match_operand:SI 1 "register_operand" "r")
13f101
+         (minus:SI (match_operand:SI 1 "register_operand" "rk")
13f101
 		   (ANY_EXTEND:SI
13f101
 		    (match_operand:SHORT 2 "register_operand" "r")))))]
13f101
   ""
13f101
@@ -1749,7 +1749,7 @@
13f101
 
13f101
 (define_insn "*sub_<optab><ALLX:mode>_shft_<GPI:mode>"
13f101
   [(set (match_operand:GPI 0 "register_operand" "=rk")
13f101
-	(minus:GPI (match_operand:GPI 1 "register_operand" "r")
13f101
+	(minus:GPI (match_operand:GPI 1 "register_operand" "rk")
13f101
 		   (ashift:GPI (ANY_EXTEND:GPI
13f101
 				(match_operand:ALLX 2 "register_operand" "r"))
13f101
 			       (match_operand 3 "aarch64_imm3" "Ui3"))))]
13f101
@@ -1763,7 +1763,7 @@
13f101
 (define_insn "*sub_<optab><SHORT:mode>_shft_si_uxtw"
13f101
   [(set (match_operand:DI 0 "register_operand" "=rk")
13f101
 	(zero_extend:DI
13f101
-         (minus:SI (match_operand:SI 1 "register_operand" "r")
13f101
+         (minus:SI (match_operand:SI 1 "register_operand" "rk")
13f101
 		   (ashift:SI (ANY_EXTEND:SI
13f101
 			       (match_operand:SHORT 2 "register_operand" "r"))
13f101
 			      (match_operand 3 "aarch64_imm3" "Ui3")))))]
13f101
@@ -1775,7 +1775,7 @@
13f101
 
13f101
 (define_insn "*sub_<optab><mode>_multp2"
13f101
   [(set (match_operand:GPI 0 "register_operand" "=rk")
13f101
-	(minus:GPI (match_operand:GPI 4 "register_operand" "r")
13f101
+	(minus:GPI (match_operand:GPI 4 "register_operand" "rk")
13f101
 		   (ANY_EXTRACT:GPI
13f101
 		    (mult:GPI (match_operand:GPI 1 "register_operand" "r")
13f101
 			      (match_operand 2 "aarch64_pwr_imm3" "Up3"))
13f101
@@ -1791,7 +1791,7 @@
13f101
 (define_insn "*sub_<optab>si_multp2_uxtw"
13f101
   [(set (match_operand:DI 0 "register_operand" "=rk")
13f101
 	(zero_extend:DI
13f101
-         (minus:SI (match_operand:SI 4 "register_operand" "r")
13f101
+         (minus:SI (match_operand:SI 4 "register_operand" "rk")
13f101
 		   (ANY_EXTRACT:SI
13f101
 		    (mult:SI (match_operand:SI 1 "register_operand" "r")
13f101
 			     (match_operand 2 "aarch64_pwr_imm3" "Up3"))
13f101
@@ -1805,7 +1805,7 @@
13f101
 
13f101
 (define_insn "*sub_uxt<mode>_multp2"
13f101
   [(set (match_operand:GPI 0 "register_operand" "=rk")
13f101
-	(minus:GPI (match_operand:GPI 4 "register_operand" "r")
13f101
+	(minus:GPI (match_operand:GPI 4 "register_operand" "rk")
13f101
 		   (and:GPI
13f101
 		    (mult:GPI (match_operand:GPI 1 "register_operand" "r")
13f101
 			      (match_operand 2 "aarch64_pwr_imm3" "Up3"))
13f101
@@ -1823,7 +1823,7 @@
13f101
 (define_insn "*sub_uxtsi_multp2_uxtw"
13f101
   [(set (match_operand:DI 0 "register_operand" "=rk")
13f101
 	(zero_extend:DI
13f101
-         (minus:SI (match_operand:SI 4 "register_operand" "r")
13f101
+         (minus:SI (match_operand:SI 4 "register_operand" "rk")
13f101
 		   (and:SI
13f101
 		    (mult:SI (match_operand:SI 1 "register_operand" "r")
13f101
 			     (match_operand 2 "aarch64_pwr_imm3" "Up3"))
13f101
diff --git a/gcc/testsuite/gcc.target/aarch64/subsp.c b/gcc/testsuite/gcc.target/aarch64/subsp.c
13f101
new file mode 100644
13f101
index 00000000000..70d848c59d1
13f101
--- /dev/null
13f101
+++ b/gcc/testsuite/gcc.target/aarch64/subsp.c
13f101
@@ -0,0 +1,19 @@
13f101
+/* { dg-options "-O" } */
13f101
+
13f101
+int foo (void *);
13f101
+
13f101
+int
13f101
+f1 (int *x, long y)
13f101
+{
13f101
+  return foo (__builtin_alloca (y));
13f101
+}
13f101
+
13f101
+int
13f101
+f2 (int *x, int y)
13f101
+{
13f101
+  char a[y + 1][16];
13f101
+  return foo (a);
13f101
+}
13f101
+
13f101
+/* { dg-final { scan-assembler "sub\tsp, sp, x\[0-9\]*\n" } } */
13f101
+/* { dg-final { scan-assembler "sub\tsp, sp, x\[0-9\]*, sxtw 4\n" } } */