Commit 2a3e384f by Richard Henderson Committed by Richard Henderson

tm.texi (LOCAL_REGNO): Document.

        * tm.texi (LOCAL_REGNO): Document.
        * flow.c (LOCAL_REGNO, EPILOGUE_USES): Provide default.
        (mark_regs_live_at_end): Don't mark LOCAL_REGNO registers.
        * reload1.c (reload): Likewise when considering nonlocal labels.

        * config/ia64/ia64.h (LOCAL_REGNO): New.
        * config/sparc/sparc.h (LOCAL_REGNO): New.

From-SVN: r35564
parent 43d1e059
2000-08-08 Richard Henderson <rth@cygnus.com>
* tm.texi (LOCAL_REGNO): Document.
* flow.c (LOCAL_REGNO, EPILOGUE_USES): Provide default.
(mark_regs_live_at_end): Don't mark LOCAL_REGNO registers.
* reload1.c (reload): Likewise when considering nonlocal labels.
* config/ia64/ia64.h (LOCAL_REGNO): New.
* config/sparc/sparc.h (LOCAL_REGNO): New.
2000-08-08 Joseph S. Myers <jsm28@cam.ac.uk> 2000-08-08 Joseph S. Myers <jsm28@cam.ac.uk>
* c-lex.c (yylex): Don't allow integer suffixes 'LUL', 'Ll', 'lL'. * c-lex.c (yylex): Don't allow integer suffixes 'LUL', 'Ll', 'lL'.
......
...@@ -686,6 +686,12 @@ while (0) ...@@ -686,6 +686,12 @@ while (0)
#define OUTGOING_REGNO(IN) \ #define OUTGOING_REGNO(IN) \
((unsigned) ((IN) - IN_REG (0)) < 8 ? OUT_REG ((IN) - IN_REG (0)) : (IN)) ((unsigned) ((IN) - IN_REG (0)) < 8 ? OUT_REG ((IN) - IN_REG (0)) : (IN))
/* Define this macro if the target machine has register windows. This
C expression returns true if the register is call-saved but is in the
register window. */
#define LOCAL_REGNO(REGNO) \
(IN_REGNO_P (REGNO) || LOC_REGNO_P (REGNO))
/* Order of allocation of registers */ /* Order of allocation of registers */
......
...@@ -1711,6 +1711,13 @@ extern char leaf_reg_remap[]; ...@@ -1711,6 +1711,13 @@ extern char leaf_reg_remap[];
#define OUTGOING_REGNO(IN) \ #define OUTGOING_REGNO(IN) \
((TARGET_FLAT || (IN) < 24 || (IN) > 31) ? (IN) : (IN) - 16) ((TARGET_FLAT || (IN) < 24 || (IN) > 31) ? (IN) : (IN) - 16)
/* Define this macro if the target machine has register windows. This
C expression returns true if the register is call-saved but is in the
register window. */
#define LOCAL_REGNO(REGNO) \
(TARGET_FLAT ? 0 : (REGNO) >= 16 && (REGNO) <= 31)
/* Define how to find the value returned by a function. /* Define how to find the value returned by a function.
VALTYPE is the data type of the value (as a tree). VALTYPE is the data type of the value (as a tree).
If the precise function being called is known, FUNC is its FUNCTION_DECL; If the precise function being called is known, FUNC is its FUNCTION_DECL;
......
...@@ -163,6 +163,13 @@ Boston, MA 02111-1307, USA. */ ...@@ -163,6 +163,13 @@ Boston, MA 02111-1307, USA. */
#define HAVE_sibcall_epilogue 0 #define HAVE_sibcall_epilogue 0
#endif #endif
#ifndef LOCAL_REGNO
#define LOCAL_REGNO(REGNO) 0
#endif
#ifndef EPILOGUE_USES
#define EPILOGUE_USES(REGNO) 0
#endif
/* The contents of the current function definition are allocated /* The contents of the current function definition are allocated
in this obstack, and all are freed at the end of the function. in this obstack, and all are freed at the end of the function.
For top-level functions, this is temporary_obstack. For top-level functions, this is temporary_obstack.
...@@ -3051,8 +3058,9 @@ mark_regs_live_at_end (set) ...@@ -3051,8 +3058,9 @@ mark_regs_live_at_end (set)
{ {
SET_REGNO_REG_SET (set, FRAME_POINTER_REGNUM); SET_REGNO_REG_SET (set, FRAME_POINTER_REGNUM);
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
/* If they are different, also mark the hard frame pointer as live */ /* If they are different, also mark the hard frame pointer as live. */
SET_REGNO_REG_SET (set, HARD_FRAME_POINTER_REGNUM); if (! LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
SET_REGNO_REG_SET (set, HARD_FRAME_POINTER_REGNUM);
#endif #endif
} }
...@@ -3070,18 +3078,14 @@ mark_regs_live_at_end (set) ...@@ -3070,18 +3078,14 @@ mark_regs_live_at_end (set)
as being live at the end of the function since they may be as being live at the end of the function since they may be
referenced by our caller. */ referenced by our caller. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i] if (global_regs[i] || EPILOGUE_USES (i))
#ifdef EPILOGUE_USES
|| EPILOGUE_USES (i)
#endif
)
SET_REGNO_REG_SET (set, i); SET_REGNO_REG_SET (set, i);
/* Mark all call-saved registers that we actaully used. */ /* Mark all call-saved registers that we actaully used. */
if (HAVE_epilogue && reload_completed) if (HAVE_epilogue && reload_completed)
{ {
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (! call_used_regs[i] && regs_ever_live[i]) if (regs_ever_live[i] && ! call_used_regs[i] && ! LOCAL_REGNO (i))
SET_REGNO_REG_SET (set, i); SET_REGNO_REG_SET (set, i);
} }
......
...@@ -85,6 +85,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -85,6 +85,10 @@ Boston, MA 02111-1307, USA. */
#ifndef REGISTER_MOVE_COST #ifndef REGISTER_MOVE_COST
#define REGISTER_MOVE_COST(x, y) 2 #define REGISTER_MOVE_COST(x, y) 2
#endif #endif
#ifndef LOCAL_REGNO
#define LOCAL_REGNO(REGNO) 0
#endif
/* During reload_as_needed, element N contains a REG rtx for the hard reg /* During reload_as_needed, element N contains a REG rtx for the hard reg
into which reg N has been reloaded (perhaps for a previous insn). */ into which reg N has been reloaded (perhaps for a previous insn). */
...@@ -654,10 +658,8 @@ reload (first, global, dumpfile) ...@@ -654,10 +658,8 @@ reload (first, global, dumpfile)
registers. */ registers. */
if (current_function_has_nonlocal_label) if (current_function_has_nonlocal_label)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{ if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i))
if (! call_used_regs[i] && ! fixed_regs[i]) regs_ever_live[i] = 1;
regs_ever_live[i] = 1;
}
/* Find all the pseudo registers that didn't get hard regs /* Find all the pseudo registers that didn't get hard regs
but do have known equivalent constants or memory slots. but do have known equivalent constants or memory slots.
......
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