Blame SOURCES/gcc48-rh1469697-15.patch

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