[dataflow] explicitly clobber rs6000 hard regs
David Edelsohn
dje@watson.ibm.com
Mon Feb 26 21:06:00 GMT 2007
Ken,
I think this patch should fix the problem on the dataflow branch
of naked clobbers. It updates all call and sibcall patterns to explicitly
clobber the link register (and appropriate condition registers).
David
* config/rs6000/rs6000.md (call, sibcall): Explicitly clobber hard
registers.
Index: rs6000.md
===================================================================
--- rs6000.md (revision 122258)
+++ rs6000.md (working copy)
@@ -2713,7 +2713,7 @@
(lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 3))
(sign_extend:DI (reg:SI 4)))
(const_int 32))))
- (clobber (match_scratch:SI 0 "=l"))]
+ (clobber (reg:SI 65))]
"! TARGET_POWER && ! TARGET_POWERPC"
"bla __mulh"
[(set_attr "type" "imul")])
@@ -2722,7 +2722,7 @@
[(set (reg:DI 3)
(mult:DI (sign_extend:DI (reg:SI 3))
(sign_extend:DI (reg:SI 4))))
- (clobber (match_scratch:SI 0 "=l"))
+ (clobber (reg:SI 65))
(clobber (reg:SI 0))]
"! TARGET_POWER && ! TARGET_POWERPC"
"bla __mull"
@@ -2733,7 +2733,7 @@
(div:SI (reg:SI 3) (reg:SI 4)))
(set (reg:SI 4)
(mod:SI (reg:SI 3) (reg:SI 4)))
- (clobber (match_scratch:SI 0 "=l"))
+ (clobber (reg:SI 65))
(clobber (reg:SI 0))]
"! TARGET_POWER && ! TARGET_POWERPC"
"bla __divss"
@@ -2744,9 +2744,9 @@
(udiv:SI (reg:SI 3) (reg:SI 4)))
(set (reg:SI 4)
(umod:SI (reg:SI 3) (reg:SI 4)))
- (clobber (match_scratch:SI 0 "=l"))
+ (clobber (reg:SI 65))
(clobber (reg:SI 0))
- (clobber (match_scratch:CC 1 "=x"))
+ (clobber (reg:CC 68))
(clobber (reg:CC 69))]
"! TARGET_POWER && ! TARGET_POWERPC"
"bla __divus"
@@ -2755,7 +2755,7 @@
(define_insn "quoss_call"
[(set (reg:SI 3)
(div:SI (reg:SI 3) (reg:SI 4)))
- (clobber (match_scratch:SI 0 "=l"))]
+ (clobber (reg:SI 65))]
"! TARGET_POWER && ! TARGET_POWERPC"
"bla __quoss"
[(set_attr "type" "idiv")])
@@ -2763,9 +2763,9 @@
(define_insn "quous_call"
[(set (reg:SI 3)
(udiv:SI (reg:SI 3) (reg:SI 4)))
- (clobber (match_scratch:SI 0 "=l"))
+ (clobber (reg:SI 65))
(clobber (reg:SI 0))
- (clobber (match_scratch:CC 1 "=x"))
+ (clobber (reg:CC 68))
(clobber (reg:CC 69))]
"! TARGET_POWER && ! TARGET_POWERPC"
"bla __quous"
@@ -10610,7 +10610,7 @@
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
- (clobber (scratch:SI))])]
+ (clobber (reg:SI 65))])]
"TARGET_32BIT"
"
{ operands[2] = gen_reg_rtx (SImode); }")
@@ -10632,7 +10632,7 @@
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
- (clobber (scratch:SI))])]
+ (clobber (reg:SI 65))])]
"TARGET_64BIT"
"
{ operands[2] = gen_reg_rtx (DImode); }")
@@ -10655,7 +10655,7 @@
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
- (clobber (scratch:SI))])]
+ (clobber (reg:SI 65))])]
"TARGET_32BIT"
"
{ operands[3] = gen_reg_rtx (SImode); }")
@@ -10678,7 +10678,7 @@
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
- (clobber (scratch:SI))])]
+ (clobber (reg:SI 65))])]
"TARGET_64BIT"
"
{ operands[3] = gen_reg_rtx (DImode); }")
@@ -10688,7 +10688,7 @@
[(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))
- (clobber (scratch:SI))])]
+ (clobber (reg:SI 65))])]
""
"
{
@@ -10758,7 +10758,7 @@
(call (mem:SI (match_operand 1 "address_operand" ""))
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))
- (clobber (scratch:SI))])]
+ (clobber (reg:SI 65))])]
""
"
{
@@ -10838,7 +10838,7 @@
[(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
(match_operand 1 "" "g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
- (clobber (match_scratch:SI 3 "=l,l"))]
+ (clobber (reg:SI 65))]
"(INTVAL (operands[2]) & CALL_LONG) == 0"
"*
{
@@ -10857,7 +10857,7 @@
[(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
(match_operand 1 "" "g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
- (clobber (match_scratch:SI 3 "=l,l"))]
+ (clobber (reg:SI 65))]
"TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
"*
{
@@ -10877,7 +10877,7 @@
(call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
(match_operand 2 "" "g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
- (clobber (match_scratch:SI 4 "=l,l"))]
+ (clobber (reg:SI 65))]
"(INTVAL (operands[3]) & CALL_LONG) == 0"
"*
{
@@ -10898,7 +10898,7 @@
(call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
(match_operand 2 "" "g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
- (clobber (match_scratch:SI 4 "=l,l"))]
+ (clobber (reg:SI 65))]
"TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
"*
{
@@ -10927,7 +10927,7 @@
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
- (clobber (match_scratch:SI 2 "=l,l"))]
+ (clobber (reg:SI 65))]
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
"b%T0l\;{l|lwz} 2,20(1)"
[(set_attr "type" "jmpreg")
@@ -10937,7 +10937,7 @@
[(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s"))
(match_operand 1 "" "g"))
(use (match_operand:SI 2 "immediate_operand" "O"))
- (clobber (match_scratch:SI 3 "=l"))]
+ (clobber (reg:SI 65))]
"TARGET_32BIT
&& DEFAULT_ABI == ABI_AIX
&& (INTVAL (operands[2]) & CALL_LONG) == 0"
@@ -10952,7 +10952,7 @@
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
- (clobber (match_scratch:SI 2 "=l,l"))]
+ (clobber (reg:SI 65))]
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
"b%T0l\;ld 2,40(1)"
[(set_attr "type" "jmpreg")
@@ -10962,7 +10962,7 @@
[(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s"))
(match_operand 1 "" "g"))
(use (match_operand:SI 2 "immediate_operand" "O"))
- (clobber (match_scratch:SI 3 "=l"))]
+ (clobber (reg:SI 65))]
"TARGET_64BIT
&& DEFAULT_ABI == ABI_AIX
&& (INTVAL (operands[2]) & CALL_LONG) == 0"
@@ -10978,7 +10978,7 @@
(use (reg:SI 11))
(set (reg:SI 2)
(mem:SI (plus:SI (reg:SI 1) (const_int 20))))
- (clobber (match_scratch:SI 3 "=l,l"))]
+ (clobber (reg:SI 65))]
"TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
"b%T1l\;{l|lwz} 2,20(1)"
[(set_attr "type" "jmpreg")
@@ -10989,7 +10989,7 @@
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s"))
(match_operand 2 "" "g")))
(use (match_operand:SI 3 "immediate_operand" "O"))
- (clobber (match_scratch:SI 4 "=l"))]
+ (clobber (reg:SI 65))]
"TARGET_32BIT
&& DEFAULT_ABI == ABI_AIX
&& (INTVAL (operands[3]) & CALL_LONG) == 0"
@@ -11005,7 +11005,7 @@
(use (reg:DI 11))
(set (reg:DI 2)
(mem:DI (plus:DI (reg:DI 1) (const_int 40))))
- (clobber (match_scratch:SI 3 "=l,l"))]
+ (clobber (reg:SI 65))]
"TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
"b%T1l\;ld 2,40(1)"
[(set_attr "type" "jmpreg")
@@ -11016,7 +11016,7 @@
(call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s"))
(match_operand 2 "" "g")))
(use (match_operand:SI 3 "immediate_operand" "O"))
- (clobber (match_scratch:SI 4 "=l"))]
+ (clobber (reg:SI 65))]
"TARGET_64BIT
&& DEFAULT_ABI == ABI_AIX
&& (INTVAL (operands[3]) & CALL_LONG) == 0"
@@ -11034,7 +11034,7 @@
[(call (mem:SI (match_operand:P 0 "register_operand" "c,*l,c,*l"))
(match_operand 1 "" "g,g,g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,O,n,n"))
- (clobber (match_scratch:SI 3 "=l,l,l,l"))]
+ (clobber (reg:SI 65))]
"DEFAULT_ABI == ABI_V4
|| DEFAULT_ABI == ABI_DARWIN"
{
@@ -11053,7 +11053,7 @@
[(call (mem:SI (match_operand:P 0 "symbol_ref_operand" "s,s"))
(match_operand 1 "" "g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
- (clobber (match_scratch:SI 3 "=l,l"))]
+ (clobber (reg:SI 65))]
"(DEFAULT_ABI == ABI_DARWIN
|| (DEFAULT_ABI == ABI_V4
&& (INTVAL (operands[2]) & CALL_LONG) == 0))"
@@ -11089,7 +11089,7 @@
(call (mem:SI (match_operand:P 1 "register_operand" "c,*l,c,*l"))
(match_operand 2 "" "g,g,g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,O,n,n"))
- (clobber (match_scratch:SI 4 "=l,l,l,l"))]
+ (clobber (reg:SI 65))]
"DEFAULT_ABI == ABI_V4
|| DEFAULT_ABI == ABI_DARWIN"
{
@@ -11109,7 +11109,7 @@
(call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s,s"))
(match_operand 2 "" "g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
- (clobber (match_scratch:SI 4 "=l,l"))]
+ (clobber (reg:SI 65))]
"(DEFAULT_ABI == ABI_DARWIN
|| (DEFAULT_ABI == ABI_V4
&& (INTVAL (operands[3]) & CALL_LONG) == 0))"
@@ -11170,7 +11170,7 @@
[(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))
- (use (match_operand 3 "" ""))
+ (use (reg:SI 65))
(return)])]
""
"
@@ -11196,7 +11196,7 @@
[(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
(match_operand 1 "" "g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
- (use (match_operand:SI 3 "register_operand" "l,l"))
+ (use (reg:SI 65))
(return)]
"(INTVAL (operands[2]) & CALL_LONG) == 0"
"*
@@ -11216,7 +11216,7 @@
[(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
(match_operand 1 "" "g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
- (use (match_operand:SI 3 "register_operand" "l,l"))
+ (use (reg:SI 65))
(return)]
"TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
"*
@@ -11237,7 +11237,7 @@
(call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
(match_operand 2 "" "g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
- (use (match_operand:SI 4 "register_operand" "l,l"))
+ (use (reg:SI 65))
(return)]
"(INTVAL (operands[3]) & CALL_LONG) == 0"
"*
@@ -11259,7 +11259,7 @@
(call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
(match_operand 2 "" "g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
- (use (match_operand:SI 4 "register_operand" "l,l"))
+ (use (reg:SI 65))
(return)]
"TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
"*
@@ -11279,7 +11279,7 @@
[(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s"))
(match_operand 1 "" "g"))
(use (match_operand:SI 2 "immediate_operand" "O"))
- (use (match_operand:SI 3 "register_operand" "l"))
+ (use (reg:SI 65))
(return)]
"TARGET_32BIT
&& DEFAULT_ABI == ABI_AIX
@@ -11292,7 +11292,7 @@
[(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s"))
(match_operand 1 "" "g"))
(use (match_operand:SI 2 "immediate_operand" "O"))
- (use (match_operand:SI 3 "register_operand" "l"))
+ (use (reg:SI 65))
(return)]
"TARGET_64BIT
&& DEFAULT_ABI == ABI_AIX
@@ -11306,7 +11306,7 @@
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s"))
(match_operand 2 "" "g")))
(use (match_operand:SI 3 "immediate_operand" "O"))
- (use (match_operand:SI 4 "register_operand" "l"))
+ (use (reg:SI 65))
(return)]
"TARGET_32BIT
&& DEFAULT_ABI == ABI_AIX
@@ -11320,7 +11320,7 @@
(call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s"))
(match_operand 2 "" "g")))
(use (match_operand:SI 3 "immediate_operand" "O"))
- (use (match_operand:SI 4 "register_operand" "l"))
+ (use (reg:SI 65))
(return)]
"TARGET_64BIT
&& DEFAULT_ABI == ABI_AIX
@@ -11333,7 +11333,7 @@
[(call (mem:SI (match_operand:P 0 "symbol_ref_operand" "s,s"))
(match_operand 1 "" ""))
(use (match_operand 2 "immediate_operand" "O,n"))
- (use (match_operand:SI 3 "register_operand" "l,l"))
+ (use (reg:SI 65))
(return)]
"(DEFAULT_ABI == ABI_DARWIN
|| DEFAULT_ABI == ABI_V4)
@@ -11364,7 +11364,7 @@
(call (mem:SI (match_operand 1 "address_operand" ""))
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))
- (use (match_operand 4 "" ""))
+ (use (reg:SI 65))
(return)])]
""
"
@@ -11387,7 +11387,7 @@
(call (mem:SI (match_operand:P 1 "symbol_ref_operand" "s,s"))
(match_operand 2 "" "")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
- (use (match_operand:SI 4 "register_operand" "l,l"))
+ (use (reg:SI 65))
(return)]
"(DEFAULT_ABI == ABI_DARWIN
|| DEFAULT_ABI == ABI_V4)
More information about the Gcc-patches
mailing list