Commit 6bacc7b0 by Nick Clifton Committed by Nick Clifton

Use an UNSPEC instead of a USE to prevent prologue/epilogue insns from being

deleted.

From-SVN: r49130
parent a415f7bc
2002-01-23 Nick Clifton <nickc@cambridge.redhat.com>
* config/arm/arm.md (UNSPEC_PROLOGUE_USE): New unspec constant.
(prologue_use): New pattern.
* config/arm/arm.c (expand_prologue): Use gen_prologue_use in
preference to gen_rtx_USE.
(thumb_expand_prologue): Use gen_prologue_use in preference to
gen_rtx_USE.
(thumb_expand_epilogue): Use gen_prologue_use in preference to
gen_rtx_USE.
2002-01-23 Hans-Peter Nilsson <hp@bitrange.com> 2002-01-23 Hans-Peter Nilsson <hp@bitrange.com>
* loop.c [!HAVE_prefetch] (CODE_FOR_prefetch): Define to 0. * loop.c [!HAVE_prefetch] (CODE_FOR_prefetch): Define to 0.
......
...@@ -8331,7 +8331,7 @@ arm_expand_prologue () ...@@ -8331,7 +8331,7 @@ arm_expand_prologue ()
emit_insn (gen_rtx_SET (SImode, ip_rtx, insn)); emit_insn (gen_rtx_SET (SImode, ip_rtx, insn));
/* Add a USE to stop propagate_one_insn() from barfing. */ /* Add a USE to stop propagate_one_insn() from barfing. */
emit_insn (gen_rtx_USE (VOIDmode, ip_rtx)); emit_insn (gen_prologue_use (ip_rtx));
} }
} }
...@@ -8377,7 +8377,7 @@ arm_expand_prologue () ...@@ -8377,7 +8377,7 @@ arm_expand_prologue ()
then make sure that it does not get reused by the ce2 pass. */ then make sure that it does not get reused by the ce2 pass. */
if ((live_regs_mask & (1 << LR_REGNUM)) == 0) if ((live_regs_mask & (1 << LR_REGNUM)) == 0)
{ {
emit_insn (gen_rtx_USE (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM))); emit_insn (gen_prologue_use (gen_rtx_REG (SImode, LR_REGNUM)));
cfun->machine->lr_save_eliminated = 1; cfun->machine->lr_save_eliminated = 1;
} }
} }
...@@ -10186,7 +10186,7 @@ thumb_expand_prologue () ...@@ -10186,7 +10186,7 @@ thumb_expand_prologue ()
/* Save it by copying it into a high, scratch register. */ /* Save it by copying it into a high, scratch register. */
emit_insn (gen_movsi (spare, reg)); emit_insn (gen_movsi (spare, reg));
/* Add a USE to stop propagate_one_insn() from barfing. */ /* Add a USE to stop propagate_one_insn() from barfing. */
emit_insn (gen_rtx_USE (VOIDmode, spare)); emit_insn (gen_prologue_use (spare));
/* Decrement the stack. */ /* Decrement the stack. */
emit_insn (gen_movsi (reg, GEN_INT (- amount))); emit_insn (gen_movsi (reg, GEN_INT (- amount)));
...@@ -10200,7 +10200,7 @@ thumb_expand_prologue () ...@@ -10200,7 +10200,7 @@ thumb_expand_prologue ()
analysis will not consider the restore redundant. The analysis will not consider the restore redundant. The
register won't be used again in this function and isn't register won't be used again in this function and isn't
restored by the epilogue. */ restored by the epilogue. */
emit_insn (gen_rtx_USE (VOIDmode, reg)); emit_insn (gen_prologue_use (reg));
} }
else else
{ {
...@@ -10248,7 +10248,7 @@ thumb_expand_epilogue () ...@@ -10248,7 +10248,7 @@ thumb_expand_epilogue ()
/* Emit a USE (stack_pointer_rtx), so that /* Emit a USE (stack_pointer_rtx), so that
the stack adjustment will not be deleted. */ the stack adjustment will not be deleted. */
emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx)); emit_insn (gen_prologue_use (stack_pointer_rtx));
if (current_function_profile || TARGET_NO_SCHED_PRO) if (current_function_profile || TARGET_NO_SCHED_PRO)
emit_insn (gen_blockage ()); emit_insn (gen_blockage ());
......
;;- Machine description for ARM for GNU compiler ;;- Machine description for ARM for GNU compiler
;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, 2001 ;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000,
;; Free Software Foundation, Inc. ;; 2001, 2002 Free Software Foundation, Inc.
;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) ;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
;; and Martin Simmons (@harleqn.co.uk). ;; and Martin Simmons (@harleqn.co.uk).
;; More major hacks by Richard Earnshaw (rearnsha@arm.com). ;; More major hacks by Richard Earnshaw (rearnsha@arm.com).
...@@ -64,6 +64,11 @@ ...@@ -64,6 +64,11 @@
(UNSPEC_CLZ 5) ; `clz' instruction, count leading zeros (SImode): (UNSPEC_CLZ 5) ; `clz' instruction, count leading zeros (SImode):
; operand 0 is the result, ; operand 0 is the result,
; operand 1 is the parameter. ; operand 1 is the parameter.
(UNSPEC_PROLOGUE_USE 6) ; As USE insns are not meaningful after reload,
; this unspec is used to prevent the deletion of
; instructions setting registers for EH handling
; and stack frame generation. Operand 0 is the
; register to "use".
] ]
) )
...@@ -9187,3 +9192,8 @@ ...@@ -9187,3 +9192,8 @@
"" ""
) )
(define_insn "prologue_use"
[(unspec:SI [(match_operand:SI 0 "register_operand" "")] UNSPEC_PROLOGUE_USE)]
""
"%@ %0 needed for prologue"
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment