Blame SOURCES/gcc48-rh1469697-15.patch

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