aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2019-03-27 17:06:26 +0000
committerAndrew Stubbs <ams@gcc.gnu.org>2019-03-27 17:06:26 +0000
commitc2709ec42b1bc7644e95f65f417be54101080602 (patch)
treea7f72d3744ed8000b2cb53a9b0c60d7209d08591 /gcc
parent6732373ed28e80cd410f8167c9962910effd12eb (diff)
downloadgcc-c2709ec42b1bc7644e95f65f417be54101080602.zip
gcc-c2709ec42b1bc7644e95f65f417be54101080602.tar.gz
gcc-c2709ec42b1bc7644e95f65f417be54101080602.tar.bz2
Fix scc clobber in movdi_symbol.
2019-03-27 Andrew Stubbs <ams@codesourcery.com> gcc/ * config/gcn/gcn.md (CC_SAVE_REG): New constant. (movdi): Call gen_movdi_symbol_save_scc. (gen_movdi_symbol_save_scc): New insn and split. From-SVN: r269970
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/gcn/gcn.md19
2 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 132af14..8801525 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-03-27 Andrew Stubbs <ams@codesourcery.com>
+
+ * config/gcn/gcn.md (CC_SAVE_REG): New constant.
+ (movdi): Call gen_movdi_symbol_save_scc.
+ (gen_movdi_symbol_save_scc): New insn and split.
+
2019-03-27 Peter Bergner <bergner@linux.ibm.com>
PR rtl-optimization/89313
diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md
index 4573a4c..2b805a7 100644
--- a/gcc/config/gcn/gcn.md
+++ b/gcc/config/gcn/gcn.md
@@ -24,6 +24,7 @@
; Named registers
(define_constants
[(FIRST_SGPR_REG 0)
+ (CC_SAVE_REG 22)
(LAST_SGPR_REG 101)
(FLAT_SCRATCH_REG 102)
(FLAT_SCRATCH_LO_REG 102)
@@ -403,7 +404,10 @@
&& (GET_CODE (operands[1]) == SYMBOL_REF
|| GET_CODE (operands[1]) == LABEL_REF))
{
- emit_insn (gen_movdi_symbol (operands[0], operands[1]));
+ if (lra_in_progress)
+ emit_insn (gen_movdi_symbol_save_scc (operands[0], operands[1]));
+ else
+ emit_insn (gen_movdi_symbol (operands[0], operands[1]));
DONE;
}
})
@@ -826,6 +830,19 @@
[(set_attr "type" "mult")
(set_attr "length" "32")])
+(define_insn_and_split "movdi_symbol_save_scc"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=Sg")
+ (match_operand:DI 1 "general_operand" "Y"))
+ (clobber (reg:BI CC_SAVE_REG))]
+ "GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == LABEL_REF
+ && (lra_in_progress || reload_completed)"
+ "#"
+ "reload_completed"
+ [(set (reg:BI CC_SAVE_REG) (reg:BI SCC_REG))
+ (parallel [(set (match_dup 0) (match_dup 1))
+ (clobber (reg:BI SCC_REG))])
+ (set (reg:BI SCC_REG) (reg:BI CC_SAVE_REG))])
+
(define_insn "gcn_indirect_call"
[(call (mem (match_operand:DI 0 "register_operand" "Sg"))
(match_operand 1 "" ""))