diff mbox

[committed] Fix "error: unable to find a register to spill in class 'R1_REGS'" reloading indirect call operand

Message ID BLU437-SMTP6806CB3AF98931D40C4FF097770@phx.gbl
State New
Headers show

Commit Message

John David Anglin Aug. 3, 2015, 5:44 p.m. UTC
The 64-bit register indirect call does not use register %r1.  So, %r1 shouldn't be clobbered in
the call pattern.  Normally, this doesn't matter as register %r1 is call clobbered.  However,
reload can fail when the register used for the indirect call needs to be reloaded from a static
location.  In this case, register %r1 is needed for the reload and the clobber blocks the reload.

Tested on hppa64-hp-hpux11.11 and hppa2.0w-hp-hpux11.11.  Committed to trunk, gcc-5
and gcc-4.9.

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

	PR target/67060
	* config/pa/pa.md (call_reg_64bit): Remove reg:DI 1 clobber.
	Adjust splits to match new pattern.
diff mbox

Patch

Index: config/pa/pa.md
===================================================================
--- config/pa/pa.md	(revision 226363)
+++ config/pa/pa.md	(working copy)
@@ -7440,7 +7440,6 @@ 
 (define_insn "call_reg_64bit"
   [(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
 	 (match_operand 1 "" "i"))
-   (clobber (reg:DI 1))
    (clobber (reg:DI 2))
    (clobber (match_operand 2))
    (use (reg:DI 27))
@@ -7461,7 +7460,6 @@ 
 (define_split
   [(parallel [(call (mem:SI (match_operand 0 "register_operand" ""))
 		    (match_operand 1 "" ""))
-	      (clobber (reg:DI 1))
 	      (clobber (reg:DI 2))
 	      (clobber (match_operand 2))
 	      (use (reg:DI 27))
@@ -7472,7 +7470,6 @@ 
   [(set (match_dup 2) (reg:DI 27))
    (parallel [(call (mem:SI (match_dup 0))
 		    (match_dup 1))
-	      (clobber (reg:DI 1))
 	      (clobber (reg:DI 2))
 	      (use (reg:DI 27))
 	      (use (reg:DI 29))
@@ -7482,7 +7479,6 @@ 
 (define_split
   [(parallel [(call (mem:SI (match_operand 0 "register_operand" ""))
 		    (match_operand 1 "" ""))
-	      (clobber (reg:DI 1))
 	      (clobber (reg:DI 2))
 	      (clobber (match_operand 2))
 	      (use (reg:DI 27))
@@ -7492,7 +7488,6 @@ 
   [(set (match_dup 2) (reg:DI 27))
    (parallel [(call (mem:SI (match_dup 0))
 		    (match_dup 1))
-	      (clobber (reg:DI 1))
 	      (clobber (reg:DI 2))
 	      (use (reg:DI 27))
 	      (use (reg:DI 29))
@@ -7503,7 +7498,6 @@ 
 (define_insn "*call_reg_64bit_post_reload"
   [(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
 	 (match_operand 1 "" "i"))
-   (clobber (reg:DI 1))
    (clobber (reg:DI 2))
    (use (reg:DI 27))
    (use (reg:DI 29))