aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1997-04-23 17:54:59 -0600
committerJeff Law <law@gcc.gnu.org>1997-04-23 17:54:59 -0600
commit4c7428133bb93c325331630f92728172de304493 (patch)
tree26ee00f1f051090313e8a6e6900d51db8e890ceb /gcc
parentcd1bbde17b0a2c2982b9c40499b90292aada2363 (diff)
downloadgcc-4c7428133bb93c325331630f92728172de304493.zip
gcc-4c7428133bb93c325331630f92728172de304493.tar.gz
gcc-4c7428133bb93c325331630f92728172de304493.tar.bz2
mn10300.c (secondary_reload_class): Handle more cases where we need secondary reloads.
* mn10300.c (secondary_reload_class): Handle more cases where we need secondary reloads. (impossible_plus_operand): Accept anything that involves addition of the stack pointer. * mn10300.md (reload_insi): Always load the stack pointer into the destination (which is always an address register). * mn10300.h (STORE_FLAG_VALUE): Remove definition. * xm-mn10300.h: Declare malloc, realloc, calloc and free. From-SVN: r13973
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/mn10300/mn10300.c17
-rw-r--r--gcc/config/mn10300/mn10300.h2
-rw-r--r--gcc/config/mn10300/mn10300.md20
-rw-r--r--gcc/config/mn10300/xm-mn10300.h7
4 files changed, 26 insertions, 20 deletions
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 2e2bf5b..bbfb68e 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -675,6 +675,12 @@ secondary_reload_class (class, mode, in)
|| XEXP (in, 1) == stack_pointer_rtx))))
return ADDRESS_REGS;
+ if (GET_CODE (in) == PLUS
+ && (XEXP (in, 0) == stack_pointer_rtx
+ || XEXP (in, 1) == stack_pointer_rtx))
+ return DATA_REGS;
+
+
/* Otherwise assume no secondary reloads are needed. */
return NO_REGS;
}
@@ -950,16 +956,9 @@ impossible_plus_operand (op, mode)
if (GET_CODE (op) != PLUS)
return 0;
- if ((XEXP (op, 0) == stack_pointer_rtx)
- && ((REG_P (XEXP (op, 1)) && reg_equiv_mem [REGNO (XEXP (op, 1))])
- || (GET_CODE (XEXP (op, 1)) == SUBREG
- && GET_CODE (SUBREG_REG (XEXP (op, 1))) == MEM)))
+ if (XEXP (op, 0) == stack_pointer_rtx
+ || XEXP (op, 1) == stack_pointer_rtx)
return 1;
- if ((XEXP (op, 1) == stack_pointer_rtx)
- && ((REG_P (XEXP (op, 0)) && reg_equiv_mem [REGNO (XEXP (op, 0))])
- || (GET_CODE (XEXP (op, 0)) == SUBREG
- && GET_CODE (SUBREG_REG (XEXP (op, 0))) == MEM)))
- return 1;
return 0;
}
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 39b307b..b24f6b4 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -971,8 +971,6 @@ do { char dstr[30]; \
is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
-#define STORE_FLAG_VALUE 1
-
/* Specify the machine mode that pointers have.
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index c34b1bc..9f1d917 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -162,12 +162,20 @@
(define_expand "reload_insi"
[(set (match_operand:SI 0 "register_operand" "=a")
(match_operand:SI 1 "impossible_plus_operand" ""))
- (clobber (match_operand:SI 2 "register_operand" "=&a"))]
+ (clobber (match_operand:SI 2 "register_operand" "=&r"))]
""
"
{
- emit_move_insn (operands[0], XEXP (operands[1], 0));
- emit_move_insn (operands[2], XEXP (operands[1], 1));
+ if (XEXP (operands[1], 0) == stack_pointer_rtx)
+ {
+ emit_move_insn (operands[0], XEXP (operands[1], 0));
+ emit_move_insn (operands[2], XEXP (operands[1], 1));
+ }
+ else
+ {
+ emit_move_insn (operands[0], XEXP (operands[1], 1));
+ emit_move_insn (operands[2], XEXP (operands[1], 0));
+ }
emit_insn (gen_addsi3 (operands[0], operands[0], operands[2]));
DONE;
}")
@@ -1024,12 +1032,6 @@
btst %1,%0"
[(set_attr "cc" "set_zn_c0")])
-;; -----------------------------------------------------------------
-;; -----------------------------------------------------------------
-;; Scc INSTRUCTIONS
-;; -----------------------------------------------------------------
-;; It's probably worth the time to define setcc type insns too
-
;; ----------------------------------------------------------------------
;; JUMP INSTRUCTIONS
diff --git a/gcc/config/mn10300/xm-mn10300.h b/gcc/config/mn10300/xm-mn10300.h
index 4ea1bc8..63d61c2 100644
--- a/gcc/config/mn10300/xm-mn10300.h
+++ b/gcc/config/mn10300/xm-mn10300.h
@@ -38,3 +38,10 @@ Boston, MA 02111-1307, USA. */
tm.h is a symbolic link to the actual target specific file. */
#include "tm.h"
+
+#ifndef __STDC__
+extern char *malloc (), *realloc (), *calloc ();
+#else
+extern void *malloc (), *realloc (), *calloc ();
+#endif
+extern void free ();