diff mbox

[committed] Fix bswapdi2 pattern in pa.md

Message ID C49B25D8-6681-4163-B9D5-CFB859880D3F@bell.net
State New
Headers show

Commit Message

John David Anglin March 25, 2016, 1:05 a.m. UTC
This fixes PR target/70319.  We need to us a scratch register to avoid clobbering operand 1.

Tested on hppa64-hp-hpux11.11.  Committed to trunk and gcc-5.

Dave
--
John David Anglin	dave.anglin@bell.net
2016-03-24  John David Anglin  <danglin@gcc.gnu.org>

	PR target/70319
	* config/pa/pa.md (bswapdi2): Use a scratch register.
diff mbox

Patch

Index: config/pa/pa.md
===================================================================
--- config/pa/pa.md	(revision 234427)
+++ config/pa/pa.md	(working copy)
@@ -1229,9 +1229,10 @@ 
 
 (define_insn "bswapdi2"
   [(set (match_operand:DI 0 "register_operand" "=&r")
-	(bswap:DI (match_operand:DI 1 "register_operand" "+r")))]
+	(bswap:DI (match_operand:DI 1 "register_operand" "r")))
+   (clobber (match_scratch:DI 2 "=r"))]
   "TARGET_64BIT"
-  "permh,3210 %1,%1\;hshl %1,8,%0\;hshr,u %1,8,%1\;or %0,%1,%0"
+  "permh,3210 %1,%2\;hshl %2,8,%0\;hshr,u %2,8,%2\;or %0,%2,%0"
   [(set_attr "type" "multi")
    (set_attr "length" "16")])