summaryrefslogtreecommitdiff
path: root/gcc/config/mmix/mmix.md
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-04 22:36:14 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-04 22:36:14 +0000
commitc1b79797f3d51d3da692b02a6c24c7ebc10b75af (patch)
tree03a03a8cd0be912065aeed553739dd3eaca9b75a /gcc/config/mmix/mmix.md
parent39e5421e227986343931ae97ae92a2415e41bda7 (diff)
downloadgcc-c1b79797f3d51d3da692b02a6c24c7ebc10b75af.tar.gz
* config/mmix/predicates.md: New file.
* config/mmix/mmix.c (mmix_symbolic_or_address_operand) (mmix_reg_or_constant_operand, mmix_reg_cc_operand) (mmix_foldable_comparison_operator, mmix_comparison_operator) (mmix_reg_or_0_operand, mmix_reg_or_8bit_operand): Remove. * config/mmix/mmix.h (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): Don't define. * config/mmix/mmix.md: Include predicates.md. ("call", "call_value"): Force address to register if it isn't a mmix_symbolic_or_address_operand. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99235 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mmix/mmix.md')
-rw-r--r--gcc/config/mmix/mmix.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/config/mmix/mmix.md b/gcc/config/mmix/mmix.md
index da0519bca1e..75e1446b4ab 100644
--- a/gcc/config/mmix/mmix.md
+++ b/gcc/config/mmix/mmix.md
@@ -40,7 +40,11 @@
(MMIX_rR_REGNUM 260)
(MMIX_fp_rO_OFFSET -24)]
)
+
+;; Operand and operator predicates.
+(include "predicates.md")
+
;; FIXME: Can we remove the reg-to-reg for smaller modes? Shouldn't they
;; be synthesized ok?
(define_insn "movqi"
@@ -1078,6 +1082,16 @@ DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\;CSNN %0,$255,%2")
""
"
{
+ /* The caller checks that the operand is generally valid as an
+ address, but at -O0 nothing makes sure that it's also a valid
+ call address for a *call*; a mmix_symbolic_or_address_operand.
+ Force into a register if it isn't. */
+ if (!mmix_symbolic_or_address_operand (XEXP (operands[0], 0),
+ GET_MODE (XEXP (operands[0], 0))))
+ operands[0]
+ = replace_equiv_address (operands[0],
+ force_reg (Pmode, XEXP (operands[0], 0)));
+
/* Since the epilogue 'uses' the return address, and it is clobbered
in the call, and we set it back after every call (all but one setting
will be optimized away), integrity is maintained. */
@@ -1105,6 +1119,16 @@ DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\;CSNN %0,$255,%2")
""
"
{
+ /* The caller checks that the operand is generally valid as an
+ address, but at -O0 nothing makes sure that it's also a valid
+ call address for a *call*; a mmix_symbolic_or_address_operand.
+ Force into a register if it isn't. */
+ if (!mmix_symbolic_or_address_operand (XEXP (operands[1], 0),
+ GET_MODE (XEXP (operands[1], 0))))
+ operands[1]
+ = replace_equiv_address (operands[1],
+ force_reg (Pmode, XEXP (operands[1], 0)));
+
/* Since the epilogue 'uses' the return address, and it is clobbered
in the call, and we set it back after every call (all but one setting
will be optimized away), integrity is maintained. */