The attached patch changes the PIC PA call patterns to hide the internal
games we play with the PIC register until after reload.  As such, the
call value patterns are now single sets.

Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.

Committed to trunk.

Dave
-- 
J. David Anglin                                  dave.ang...@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2012-05-20  John David Anglin  <dave.ang...@nrc-cnrc.gc.ca>

        PR rtl-optimzation/53373
        * config/pa/pa.md (call_symref_pic): Don't expose PIC register save in
        call pattern.  Update split patterns.
        (call_symref_64bit, call_reg_pic, call_reg_64bit, call_val_symref_pic,
        call_val_symref_64bit, call_val_reg_pic, call_val_reg_64bit): Likewise.

Index: config/pa/pa.md
===================================================================
--- config/pa/pa.md     (revision 187620)
+++ config/pa/pa.md     (working copy)
@@ -7190,12 +7190,11 @@
    (set (attr "length") (symbol_ref "pa_attr_length_call (insn, 0)"))])
 
 (define_insn "call_symref_pic"
-  [(set (match_operand:SI 2 "register_operand" "=&r") (reg:SI 19))
-   (call (mem:SI (match_operand 0 "call_operand_address" ""))
+  [(call (mem:SI (match_operand 0 "call_operand_address" ""))
         (match_operand 1 "" "i"))
    (clobber (reg:SI 1))
    (clobber (reg:SI 2))
-   (use (match_dup 2))
+   (clobber (match_operand 2))
    (use (reg:SI 19))
    (use (const_int 0))]
   "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
@@ -7211,12 +7210,11 @@
 ;; terminate the basic block.  The split has to contain more than one
 ;; insn.
 (define_split
-  [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19))
-             (call (mem:SI (match_operand 0 "call_operand_address" ""))
+  [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
                    (match_operand 1 "" ""))
              (clobber (reg:SI 1))
              (clobber (reg:SI 2))
-             (use (match_dup 2))
+             (clobber (match_operand 2))
              (use (reg:SI 19))
              (use (const_int 0))])]
   "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed
@@ -7231,12 +7229,11 @@
   "")
 
 (define_split
-  [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19))
-             (call (mem:SI (match_operand 0 "call_operand_address" ""))
+  [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
                    (match_operand 1 "" ""))
              (clobber (reg:SI 1))
              (clobber (reg:SI 2))
-             (use (match_dup 2))
+             (clobber (match_operand 2))
              (use (reg:SI 19))
              (use (const_int 0))])]
   "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed"
@@ -7269,12 +7266,11 @@
 ;; This pattern is split if it is necessary to save and restore the
 ;; PIC register.
 (define_insn "call_symref_64bit"
-  [(set (match_operand:DI 2 "register_operand" "=&r") (reg:DI 27))
-   (call (mem:SI (match_operand 0 "call_operand_address" ""))
+  [(call (mem:SI (match_operand 0 "call_operand_address" ""))
         (match_operand 1 "" "i"))
    (clobber (reg:DI 1))
    (clobber (reg:DI 2))
-   (use (match_dup 2))
+   (clobber (match_operand 2))
    (use (reg:DI 27))
    (use (reg:DI 29))
    (use (const_int 0))]
@@ -7291,12 +7287,11 @@
 ;; terminate the basic block.  The split has to contain more than one
 ;; insn.
 (define_split
-  [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27))
-             (call (mem:SI (match_operand 0 "call_operand_address" ""))
+  [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
                    (match_operand 1 "" ""))
              (clobber (reg:DI 1))
              (clobber (reg:DI 2))
-             (use (match_dup 2))
+             (clobber (match_operand 2))
              (use (reg:DI 27))
              (use (reg:DI 29))
              (use (const_int 0))])]
@@ -7313,12 +7308,11 @@
   "")
 
 (define_split
-  [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27))
-             (call (mem:SI (match_operand 0 "call_operand_address" ""))
+  [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
                    (match_operand 1 "" ""))
              (clobber (reg:DI 1))
              (clobber (reg:DI 2))
-             (use (match_dup 2))
+             (clobber (match_operand 2))
              (use (reg:DI 27))
              (use (reg:DI 29))
              (use (const_int 0))])]
@@ -7368,12 +7362,11 @@
 ;; This pattern is split if it is necessary to save and restore the
 ;; PIC register.
 (define_insn "call_reg_pic"
-  [(set (match_operand:SI 1 "register_operand" "=&r") (reg:SI 19))
-   (call (mem:SI (reg:SI 22))
+  [(call (mem:SI (reg:SI 22))
         (match_operand 0 "" "i"))
    (clobber (reg:SI 1))
    (clobber (reg:SI 2))
-   (use (match_dup 1))
+   (clobber (match_operand 1))
    (use (reg:SI 19))
    (use (const_int 1))]
   "!TARGET_64BIT"
@@ -7389,12 +7382,11 @@
 ;; terminate the basic block.  The split has to contain more than one
 ;; insn.
 (define_split
-  [(parallel [(set (match_operand:SI 1 "register_operand" "") (reg:SI 19))
-             (call (mem:SI (reg:SI 22))
+  [(parallel [(call (mem:SI (reg:SI 22))
                    (match_operand 0 "" ""))
              (clobber (reg:SI 1))
              (clobber (reg:SI 2))
-             (use (match_dup 1))
+             (clobber (match_operand 1))
              (use (reg:SI 19))
              (use (const_int 1))])]
   "!TARGET_64BIT && reload_completed
@@ -7409,12 +7401,11 @@
   "")
 
 (define_split
-  [(parallel [(set (match_operand:SI 1 "register_operand" "") (reg:SI 19))
-             (call (mem:SI (reg:SI 22))
+  [(parallel [(call (mem:SI (reg:SI 22))
                    (match_operand 0 "" ""))
              (clobber (reg:SI 1))
              (clobber (reg:SI 2))
-             (use (match_dup 1))
+             (clobber (match_operand 1))
              (use (reg:SI 19))
              (use (const_int 1))])]
   "!TARGET_64BIT && reload_completed"
@@ -7446,12 +7437,11 @@
 ;; This pattern is split if it is necessary to save and restore the
 ;; PIC register.
 (define_insn "call_reg_64bit"
-  [(set (match_operand:DI 2 "register_operand" "=&r") (reg:DI 27))
-   (call (mem:SI (match_operand:DI 0 "register_operand" "r"))
+  [(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
         (match_operand 1 "" "i"))
    (clobber (reg:DI 1))
    (clobber (reg:DI 2))
-   (use (match_dup 2))
+   (clobber (match_operand 2))
    (use (reg:DI 27))
    (use (reg:DI 29))
    (use (const_int 1))]
@@ -7468,12 +7458,11 @@
 ;; terminate the basic block.  The split has to contain more than one
 ;; insn.
 (define_split
-  [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27))
-             (call (mem:SI (match_operand 0 "register_operand" ""))
+  [(parallel [(call (mem:SI (match_operand 0 "register_operand" ""))
                    (match_operand 1 "" ""))
              (clobber (reg:DI 1))
              (clobber (reg:DI 2))
-             (use (match_dup 2))
+             (clobber (match_operand 2))
              (use (reg:DI 27))
              (use (reg:DI 29))
              (use (const_int 1))])]
@@ -7490,12 +7479,11 @@
   "")
 
 (define_split
-  [(parallel [(set (match_operand:DI 2 "register_operand" "") (reg:DI 27))
-             (call (mem:SI (match_operand 0 "register_operand" ""))
+  [(parallel [(call (mem:SI (match_operand 0 "register_operand" ""))
                    (match_operand 1 "" ""))
              (clobber (reg:DI 1))
              (clobber (reg:DI 2))
-             (use (match_dup 2))
+             (clobber (match_operand 2))
              (use (reg:DI 27))
              (use (reg:DI 29))
              (use (const_int 1))])]
@@ -7654,13 +7642,12 @@
    (set (attr "length") (symbol_ref "pa_attr_length_call (insn, 0)"))])
 
 (define_insn "call_val_symref_pic"
-  [(set (match_operand:SI 3 "register_operand" "=&r") (reg:SI 19))
-   (set (match_operand 0 "" "")
+  [(set (match_operand 0 "" "")
        (call (mem:SI (match_operand 1 "call_operand_address" ""))
              (match_operand 2 "" "i")))
    (clobber (reg:SI 1))
    (clobber (reg:SI 2))
-   (use (match_dup 3))
+   (clobber (match_operand 3))
    (use (reg:SI 19))
    (use (const_int 0))]
   "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
@@ -7676,13 +7663,12 @@
 ;; terminate the basic block.  The split has to contain more than one
 ;; insn.
 (define_split
-  [(parallel [(set (match_operand:SI 3 "register_operand" "") (reg:SI 19))
-             (set (match_operand 0 "" "")
+  [(parallel [(set (match_operand 0 "" "")
              (call (mem:SI (match_operand 1 "call_operand_address" ""))
                    (match_operand 2 "" "")))
              (clobber (reg:SI 1))
              (clobber (reg:SI 2))
-             (use (match_dup 3))
+             (clobber (match_operand 3))
              (use (reg:SI 19))
              (use (const_int 0))])]
   "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed
@@ -7698,13 +7684,12 @@
   "")
 
 (define_split
-  [(parallel [(set (match_operand:SI 3 "register_operand" "") (reg:SI 19))
-             (set (match_operand 0 "" "")
+  [(parallel [(set (match_operand 0 "" "")
              (call (mem:SI (match_operand 1 "call_operand_address" ""))
                    (match_operand 2 "" "")))
              (clobber (reg:SI 1))
              (clobber (reg:SI 2))
-             (use (match_dup 3))
+             (clobber (match_operand 3))
              (use (reg:SI 19))
              (use (const_int 0))])]
   "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed"
@@ -7739,13 +7724,12 @@
 ;; This pattern is split if it is necessary to save and restore the
 ;; PIC register.
 (define_insn "call_val_symref_64bit"
-  [(set (match_operand:DI 3 "register_operand" "=&r") (reg:DI 27))
-   (set (match_operand 0 "" "")
+  [(set (match_operand 0 "" "")
        (call (mem:SI (match_operand 1 "call_operand_address" ""))
              (match_operand 2 "" "i")))
    (clobber (reg:DI 1))
    (clobber (reg:DI 2))
-   (use (match_dup 3))
+   (clobber (match_operand 3))
    (use (reg:DI 27))
    (use (reg:DI 29))
    (use (const_int 0))]
@@ -7762,13 +7746,12 @@
 ;; terminate the basic block.  The split has to contain more than one
 ;; insn.
 (define_split
-  [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27))
-             (set (match_operand 0 "" "")
+  [(parallel [(set (match_operand 0 "" "")
              (call (mem:SI (match_operand 1 "call_operand_address" ""))
                    (match_operand 2 "" "")))
              (clobber (reg:DI 1))
              (clobber (reg:DI 2))
-             (use (match_dup 3))
+             (clobber (match_operand 3))
              (use (reg:DI 27))
              (use (reg:DI 29))
              (use (const_int 0))])]
@@ -7786,13 +7769,12 @@
   "")
 
 (define_split
-  [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27))
-             (set (match_operand 0 "" "")
+  [(parallel [(set (match_operand 0 "" "")
              (call (mem:SI (match_operand 1 "call_operand_address" ""))
                    (match_operand 2 "" "")))
              (clobber (reg:DI 1))
              (clobber (reg:DI 2))
-             (use (match_dup 3))
+             (clobber (match_operand 3))
              (use (reg:DI 27))
              (use (reg:DI 29))
              (use (const_int 0))])]
@@ -7845,13 +7827,12 @@
 ;; This pattern is split if it is necessary to save and restore the
 ;; PIC register.
 (define_insn "call_val_reg_pic"
-  [(set (match_operand:SI 2 "register_operand" "=&r") (reg:SI 19))
-   (set (match_operand 0 "" "")
+  [(set (match_operand 0 "" "")
        (call (mem:SI (reg:SI 22))
              (match_operand 1 "" "i")))
    (clobber (reg:SI 1))
    (clobber (reg:SI 2))
-   (use (match_dup 2))
+   (clobber (match_operand 2))
    (use (reg:SI 19))
    (use (const_int 1))]
   "!TARGET_64BIT"
@@ -7867,13 +7848,12 @@
 ;; terminate the basic block.  The split has to contain more than one
 ;; insn.
 (define_split
-  [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19))
-             (set (match_operand 0 "" "")
+  [(parallel [(set (match_operand 0 "" "")
                   (call (mem:SI (reg:SI 22))
                         (match_operand 1 "" "")))
              (clobber (reg:SI 1))
              (clobber (reg:SI 2))
-             (use (match_dup 2))
+             (clobber (match_operand 2))
              (use (reg:SI 19))
              (use (const_int 1))])]
   "!TARGET_64BIT && reload_completed
@@ -7889,13 +7869,12 @@
   "")
 
 (define_split
-  [(parallel [(set (match_operand:SI 2 "register_operand" "") (reg:SI 19))
-             (set (match_operand 0 "" "")
+  [(parallel [(set (match_operand 0 "" "")
                   (call (mem:SI (reg:SI 22))
                         (match_operand 1 "" "")))
              (clobber (reg:SI 1))
              (clobber (reg:SI 2))
-             (use (match_dup 2))
+             (clobber (match_operand 2))
              (use (reg:SI 19))
              (use (const_int 1))])]
   "!TARGET_64BIT && reload_completed"
@@ -7929,13 +7908,12 @@
 ;; This pattern is split if it is necessary to save and restore the
 ;; PIC register.
 (define_insn "call_val_reg_64bit"
-  [(set (match_operand:DI 3 "register_operand" "=&r") (reg:DI 27))
-   (set (match_operand 0 "" "")
+  [(set (match_operand 0 "" "")
        (call (mem:SI (match_operand:DI 1 "register_operand" "r"))
              (match_operand 2 "" "i")))
    (clobber (reg:DI 1))
    (clobber (reg:DI 2))
-   (use (match_dup 3))
+   (clobber (match_operand 3))
    (use (reg:DI 27))
    (use (reg:DI 29))
    (use (const_int 1))]
@@ -7952,13 +7930,12 @@
 ;; terminate the basic block.  The split has to contain more than one
 ;; insn.
 (define_split
-  [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27))
-             (set (match_operand 0 "" "")
+  [(parallel [(set (match_operand 0 "" "")
                   (call (mem:SI (match_operand:DI 1 "register_operand" ""))
                         (match_operand 2 "" "")))
              (clobber (reg:DI 1))
              (clobber (reg:DI 2))
-             (use (match_dup 3))
+             (clobber (match_operand 3))
              (use (reg:DI 27))
              (use (reg:DI 29))
              (use (const_int 1))])]
@@ -7976,13 +7953,12 @@
   "")
 
 (define_split
-  [(parallel [(set (match_operand:DI 3 "register_operand" "") (reg:DI 27))
-             (set (match_operand 0 "" "")
+  [(parallel [(set (match_operand 0 "" "")
                   (call (mem:SI (match_operand:DI 1 "register_operand" ""))
                         (match_operand 2 "" "")))
              (clobber (reg:DI 1))
              (clobber (reg:DI 2))
-             (use (match_dup 3))
+             (clobber (match_operand 3))
              (use (reg:DI 27))
              (use (reg:DI 29))
              (use (const_int 1))])]

Reply via email to