From e254999710ea53fd553b6c32b03e0ce1eb020771 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Fri, 20 Nov 1992 19:02:25 +0000 Subject: [PATCH] (init_expr_once): Try indexing mem by fp as well as sp. From-SVN: r2760 --- gcc/expr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gcc/expr.c b/gcc/expr.c index 375637e5d5b..1881da40ed5 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -139,7 +139,11 @@ init_expr_once () { rtx insn, pat; enum machine_mode mode; + /* Try indexing by frame ptr and try by stack ptr. + It is known that on the Convex the stack ptr isn't a valid index. + With luck, one or the other is valid on any machine. */ rtx mem = gen_rtx (MEM, VOIDmode, stack_pointer_rtx); + rtx mem1 = gen_rtx (MEM, VOIDmode, frame_pointer_rtx); start_sequence (); insn = emit_insn (gen_rtx (SET, 0, 0)); @@ -154,6 +158,7 @@ init_expr_once () direct_load[(int) mode] = direct_store[(int) mode] = 0; PUT_MODE (mem, mode); + PUT_MODE (mem1, mode); /* See if there is some register that can be used in this mode and directly loaded or stored from memory. */ @@ -173,10 +178,20 @@ init_expr_once () if (recog (pat, insn, &num_clobbers) >= 0) direct_load[(int) mode] = 1; + SET_SRC (pat) = mem1; + SET_DEST (pat) = reg; + if (recog (pat, insn, &num_clobbers) >= 0) + direct_load[(int) mode] = 1; + SET_SRC (pat) = reg; SET_DEST (pat) = mem; if (recog (pat, insn, &num_clobbers) >= 0) direct_store[(int) mode] = 1; + + SET_SRC (pat) = reg; + SET_DEST (pat) = mem1; + if (recog (pat, insn, &num_clobbers) >= 0) + direct_store[(int) mode] = 1; } movstr_optab[(int) mode] = CODE_FOR_nothing;