re PR target/24779 (Python miscompilation - TOC reload)

2008-12-12  Andrew Pinski  <andrew_pinskia@playstation.sony.com>
            Peter Bergner <bergner@vnet.ibm.com>

        PR target/24779
        * config/rs6000/rs6000.md (call_indirect_aix32): Move the load of the
        TOC into the call pattern.
        (call_indirect_aix64): Likewise.
        (call_value_indirect_aix32): Likewise.
        (call_value_indirect_aix64): Likewise.
        (call_indirect_nonlocal_aix32_internal): New insn and split patterns
        to split off the load of the TOC.
        (call_indirect_nonlocal_aix32): Enable only after reload.
        (call_indirect_nonlocal_aix64_internal): New insn and split patterns
        to split off the load of the TOC.
        (call_indirect_nonlocal_aix64): Enable only after reload.
        (call_value_indirect_nonlocal_aix32_internal): New insn and split
        patterns to split off the load of the TOC.
        (call_value_indirect_nonlocal_aix32): Enable only after reload.
        (call_value_indirect_nonlocal_aix64_internal): New insn and split
        patterns to split off the load of the TOC.
        (call_value_indirect_nonlocal_aix64): Enable only after reload.



Co-Authored-By: Peter Bergner <bergner@vnet.ibm.com>

From-SVN: r142727
This commit is contained in:
Andrew Pinski 2008-12-12 14:54:09 -08:00 committed by Andrew Pinski
parent 9bf6b5c1d3
commit a893ac80da
2 changed files with 131 additions and 28 deletions

View File

@ -1,3 +1,25 @@
2008-12-12 Andrew Pinski <andrew_pinskia@playstation.sony.com>
Peter Bergner <bergner@vnet.ibm.com>
PR target/24779
* config/rs6000/rs6000.md (call_indirect_aix32): Move the load of the
TOC into the call pattern.
(call_indirect_aix64): Likewise.
(call_value_indirect_aix32): Likewise.
(call_value_indirect_aix64): Likewise.
(call_indirect_nonlocal_aix32_internal): New insn and split patterns
to split off the load of the TOC.
(call_indirect_nonlocal_aix32): Enable only after reload.
(call_indirect_nonlocal_aix64_internal): New insn and split patterns
to split off the load of the TOC.
(call_indirect_nonlocal_aix64): Enable only after reload.
(call_value_indirect_nonlocal_aix32_internal): New insn and split
patterns to split off the load of the TOC.
(call_value_indirect_nonlocal_aix32): Enable only after reload.
(call_value_indirect_nonlocal_aix64_internal): New insn and split
patterns to split off the load of the TOC.
(call_value_indirect_nonlocal_aix64): Enable only after reload.
2008-12-12 Andreas Schwab <schwab@suse.de>
Revert:

View File

@ -10798,18 +10798,14 @@
(mem:SI (match_operand:SI 0 "gpc_reg_operand" "")))
(set (mem:SI (plus:SI (reg:SI 1) (const_int 20)))
(reg:SI 2))
(set (reg:SI 2)
(mem:SI (plus:SI (match_dup 0)
(const_int 4))))
(set (reg:SI 11)
(mem:SI (plus:SI (match_dup 0)
(const_int 8))))
(parallel [(call (mem:SI (match_dup 2))
(match_operand 1 "" ""))
(use (reg:SI 2))
(use (mem:SI (plus:SI (match_dup 0) (const_int 4))))
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(use (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (reg:SI LR_REGNO))])]
"TARGET_32BIT"
"
@ -10820,18 +10816,14 @@
(mem:DI (match_operand:DI 0 "gpc_reg_operand" "")))
(set (mem:DI (plus:DI (reg:DI 1) (const_int 40)))
(reg:DI 2))
(set (reg:DI 2)
(mem:DI (plus:DI (match_dup 0)
(const_int 8))))
(set (reg:DI 11)
(mem:DI (plus:DI (match_dup 0)
(const_int 16))))
(parallel [(call (mem:SI (match_dup 2))
(match_operand 1 "" ""))
(use (reg:DI 2))
(use (mem:DI (plus:DI (match_dup 0) (const_int 8))))
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(use (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (reg:SI LR_REGNO))])]
"TARGET_64BIT"
"
@ -10842,19 +10834,15 @@
(mem:SI (match_operand:SI 1 "gpc_reg_operand" "")))
(set (mem:SI (plus:SI (reg:SI 1) (const_int 20)))
(reg:SI 2))
(set (reg:SI 2)
(mem:SI (plus:SI (match_dup 1)
(const_int 4))))
(set (reg:SI 11)
(mem:SI (plus:SI (match_dup 1)
(const_int 8))))
(parallel [(set (match_operand 0 "" "")
(call (mem:SI (match_dup 3))
(match_operand 2 "" "")))
(use (reg:SI 2))
(use (mem:SI (plus:SI (match_dup 1) (const_int 4))))
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(use (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (reg:SI LR_REGNO))])]
"TARGET_32BIT"
"
@ -10865,19 +10853,15 @@
(mem:DI (match_operand:DI 1 "gpc_reg_operand" "")))
(set (mem:DI (plus:DI (reg:DI 1) (const_int 40)))
(reg:DI 2))
(set (reg:DI 2)
(mem:DI (plus:DI (match_dup 1)
(const_int 8))))
(set (reg:DI 11)
(mem:DI (plus:DI (match_dup 1)
(const_int 16))))
(parallel [(set (match_operand 0 "" "")
(call (mem:SI (match_dup 3))
(match_operand 2 "" "")))
(use (reg:DI 2))
(use (mem:DI (plus:DI (match_dup 1) (const_int 8))))
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(use (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (reg:SI LR_REGNO))])]
"TARGET_64BIT"
"
@ -11079,6 +11063,29 @@
;; variable argument function. It is > 0 if FP registers were passed
;; and < 0 if they were not.
(define_insn_and_split "*call_indirect_nonlocal_aix32_internal"
[(call (mem:SI (match_operand:SI 0 "register_operand" "c,*l"))
(match_operand 1 "" "g,g"))
(use (mem:SI (plus:SI (match_operand:SI 2 "register_operand" "b,b") (const_int 4))))
(use (reg:SI 11))
(use (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (reg:SI LR_REGNO))]
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
"#"
"&& reload_completed"
[(set (reg:SI 2)
(mem:SI (plus:SI (match_dup 2) (const_int 4))))
(parallel [(call (mem:SI (match_dup 0))
(match_dup 1))
(use (reg:SI 2))
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (reg:SI LR_REGNO))])]
""
[(set_attr "type" "jmpreg")
(set_attr "length" "12")])
(define_insn "*call_indirect_nonlocal_aix32"
[(call (mem:SI (match_operand:SI 0 "register_operand" "c,*l"))
(match_operand 1 "" "g,g"))
@ -11087,7 +11094,7 @@
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (reg:SI LR_REGNO))]
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX && reload_completed"
"b%T0l\;{l|lwz} 2,20(1)"
[(set_attr "type" "jmpreg")
(set_attr "length" "8")])
@ -11103,6 +11110,30 @@
"bl %z0\;%."
[(set_attr "type" "branch")
(set_attr "length" "8")])
(define_insn_and_split "*call_indirect_nonlocal_aix64_internal"
[(call (mem:SI (match_operand:DI 0 "register_operand" "c,*l"))
(match_operand 1 "" "g,g"))
(use (mem:DI (plus:DI (match_operand:DI 2 "register_operand" "b,b")
(const_int 8))))
(use (reg:DI 11))
(use (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (reg:SI LR_REGNO))]
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
"#"
"&& reload_completed"
[(set (reg:DI 2)
(mem:DI (plus:DI (match_dup 2) (const_int 8))))
(parallel [(call (mem:SI (match_dup 0))
(match_dup 1))
(use (reg:DI 2))
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (reg:SI LR_REGNO))])]
""
[(set_attr "type" "jmpreg")
(set_attr "length" "12")])
(define_insn "*call_indirect_nonlocal_aix64"
[(call (mem:SI (match_operand:DI 0 "register_operand" "c,*l"))
@ -11112,7 +11143,7 @@
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (reg:SI LR_REGNO))]
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX && reload_completed"
"b%T0l\;ld 2,40(1)"
[(set_attr "type" "jmpreg")
(set_attr "length" "8")])
@ -11129,6 +11160,31 @@
[(set_attr "type" "branch")
(set_attr "length" "8")])
(define_insn_and_split "*call_value_indirect_nonlocal_aix32_internal"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "register_operand" "c,*l"))
(match_operand 2 "" "g,g")))
(use (mem:SI (plus:SI (match_operand:SI 3 "register_operand" "b,b")
(const_int 4))))
(use (reg:SI 11))
(use (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (reg:SI LR_REGNO))]
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
"#"
"&& reload_completed"
[(set (reg:SI 2)
(mem:SI (plus:SI (match_dup 3) (const_int 4))))
(parallel [(set (match_dup 0) (call (mem:SI (match_dup 1))
(match_dup 2)))
(use (reg:SI 2))
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (reg:SI LR_REGNO))])]
""
[(set_attr "type" "jmpreg")
(set_attr "length" "12")])
(define_insn "*call_value_indirect_nonlocal_aix32"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "register_operand" "c,*l"))
@ -11138,7 +11194,7 @@
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
(clobber (reg:SI LR_REGNO))]
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX && reload_completed"
"b%T1l\;{l|lwz} 2,20(1)"
[(set_attr "type" "jmpreg")
(set_attr "length" "8")])
@ -11156,6 +11212,31 @@
[(set_attr "type" "branch")
(set_attr "length" "8")])
(define_insn_and_split "*call_value_indirect_nonlocal_aix64_internal"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" "c,*l"))
(match_operand 2 "" "g,g")))
(use (mem:DI (plus:DI (match_operand:DI 3 "register_operand" "b,b")
(const_int 8))))
(use (reg:DI 11))
(use (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (reg:SI LR_REGNO))]
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
"#"
"&& reload_completed"
[(set (reg:DI 2)
(mem:DI (plus:DI (match_dup 3) (const_int 8))))
(parallel [(set (match_dup 0) (call (mem:SI (match_dup 1))
(match_dup 2)))
(use (reg:DI 2))
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (reg:SI LR_REGNO))])]
""
[(set_attr "type" "jmpreg")
(set_attr "length" "12")])
(define_insn "*call_value_indirect_nonlocal_aix64"
[(set (match_operand 0 "" "")
(call (mem:SI (match_operand:DI 1 "register_operand" "c,*l"))
@ -11165,7 +11246,7 @@
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
(clobber (reg:SI LR_REGNO))]
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX && reload_completed"
"b%T1l\;ld 2,40(1)"
[(set_attr "type" "jmpreg")
(set_attr "length" "8")])