Blame SOURCES/gcc48-rh1469697-15.patch

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