$OpenBSD: patch-gcc_config_alpha_alpha_md,v 1.1 2014/01/18 11:38:22 pascal Exp $
--- gcc/config/alpha/alpha.md.orig	Sat Jan 18 12:08:20 2014
+++ gcc/config/alpha/alpha.md	Sat Jan 18 12:09:04 2014
@@ -1701,9 +1701,10 @@
 	(mem:DI (and:DI (match_operand:DI 1 "" "") (const_int -8))))
    (set (match_dup 4)
 	(ashift:DI (match_dup 3)
-		   (minus:DI (const_int 64)
+		   (minus:DI (const_int 56)
 			     (ashift:DI
-			      (and:DI (match_dup 2) (const_int 7))
+			      (and:DI (plus:DI (match_dup 2) (const_int -1))
+				      (const_int 7))
 			      (const_int 3)))))
    (set (match_operand:DI 0 "register_operand" "")
 	(ashiftrt:DI (match_dup 4) (const_int 56)))]
@@ -1751,9 +1752,10 @@
 	(mem:DI (and:DI (match_operand:DI 1 "" "") (const_int -8))))
    (set (match_dup 4)
 	(ashift:DI (match_dup 3)
-		   (minus:DI (const_int 64)
+		   (minus:DI (const_int 56)
 			     (ashift:DI
-			      (and:DI (match_dup 2) (const_int 7))
+			      (and:DI (plus:DI (match_dup 2) (const_int -1))
+				      (const_int 7))
 			      (const_int 3)))))
    (set (match_operand:DI 0 "register_operand" "")
 	(ashiftrt:DI (match_dup 4) (const_int 48)))]
@@ -1866,10 +1868,11 @@
   [(set (match_operand:DI 0 "register_operand" "=r")
 	(ashift:DI
 	 (match_operand:DI 1 "reg_or_0_operand" "rJ")
-	  (minus:DI (const_int 64)
+	  (minus:DI (const_int 56)
 		    (ashift:DI
 		     (and:DI
-		      (match_operand:DI 2 "reg_or_8bit_operand" "rI")
+		      (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
+			       (const_int -1))
 		      (const_int 7))
 		     (const_int 3)))))]
   "! WORDS_BIG_ENDIAN"
@@ -1895,10 +1898,11 @@
 	(ashift:DI
 	 (and:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
 		 (const_int 2147483647))
-	 (minus:DI (const_int 64)
+	 (minus:DI (const_int 56)
 		    (ashift:DI
 		     (and:DI
-		      (match_operand:DI 2 "reg_or_8bit_operand" "rI")
+		      (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
+			       (const_int -1))
 		      (const_int 7))
 		     (const_int 3)))))]
   "! WORDS_BIG_ENDIAN"
@@ -1927,10 +1931,11 @@
 	(ashift:DI
 	 (and:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
 		 (const_int 65535))
-	 (minus:DI (const_int 64)
+	 (minus:DI (const_int 56)
 		    (ashift:DI
 		     (and:DI
-		      (match_operand:DI 2 "reg_or_8bit_operand" "rI")
+		      (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
+			       (const_int -1))
 		      (const_int 7))
 		     (const_int 3)))))]
   "! WORDS_BIG_ENDIAN"
