* hard-reg-set.h (regs_invalidated_by_call): Declare.
* regclass.c (regs_invalidated_by_call): Move from cse.c.
(init_reg_sets_1): Move initialization from cse_main.
* cse.c (regs_invalidated_by_call): Move to regclass.c.
(cse_main): Move its initialization also.
* df.c (df_insn_refs_record): Use regs_invalidated_by_call.
* flow.c (propagate_one_insn): Likewise.
* gcse.c (compute_hash_table): Likewise.
(compute_kill_rd, compute_store_table): Likewise.
* sched-deps.c (sched_analyze_1): Likewise.
From-SVN: r44053
+2001-07-16 Richard Henderson <rth@redhat.com>
+
+ * hard-reg-set.h (regs_invalidated_by_call): Declare.
+ * regclass.c (regs_invalidated_by_call): Move from cse.c.
+ (init_reg_sets_1): Move initialization from cse_main.
+ * cse.c (regs_invalidated_by_call): Move to regclass.c.
+ (cse_main): Move its initialization also.
+ * df.c (df_insn_refs_record): Use regs_invalidated_by_call.
+ * flow.c (propagate_one_insn): Likewise.
+ * gcse.c (compute_hash_table): Likewise.
+ (compute_kill_rd, compute_store_table): Likewise.
+ * sched-deps.c (sched_analyze_1): Likewise.
+
Mon Jul 16 18:07:07 2001 J"orn Rennecke <amylaar@redhat.com>
* gcse.c (pre_insert_copy_insn): Use gen_move_insn instead of
2001-07-11 Timothy Wall <twall@redhat.com>
- * config.gcc: Add configuration for AIX5/IA64.
- * config/ia64/aix.h: New. AIX5/IA64-specific configuration.
- * config/ia64/crt[in].asm: New. Generic static ctor/dtor
+ * config.gcc: Add configuration for AIX5/IA64.
+ * config/ia64/aix.h: New. AIX5/IA64-specific configuration.
+ * config/ia64/crt[in].asm: New. Generic static ctor/dtor
support prefix/suffix code.
- * config/ia64/t-aix: New. Makefile fragment.
- * config/ia64/unwind-aix.c: New. Unwind table entry lookup.
+ * config/ia64/t-aix: New. Makefile fragment.
+ * config/ia64/unwind-aix.c: New. Unwind table entry lookup.
2001-07-11 Kazu Hirata <kazu@hxi.com>
2001-07-05 H.J. Lu (hjl@gnu.org)
- * config/mips/mips.c (mips_parse_cpu): New function to parse
- -march=*/-mcpu=*.
+ * config/mips/mips.c (mips_parse_cpu): New function to parse
+ -march=*/-mcpu=*.
2001-07-05 Jim Wilson <wilson@redhat.com>
2001-07-04 Nathan Sidwell <nathan@codesourcery.com>
* cppinit.c (remove_dup_dirs): Inform if a system include
- directory is being reordered.
+ directory is being reordered.
* doc/invoke.texi (Directory Options): GCC warns if you hide a
system include.
* doc/cpp.texi (Search Paths): Likewise.
2001-07-02 Steve Ellcey <sje@cup.hp.com>
- * config/ia64/t-ia64: Change LIB1ASMFUNCS to use single underscore.
- * config/ia64/lib1funcs.asm: Change macro names to match t-ia64.
+ * config/ia64/t-ia64: Change LIB1ASMFUNCS to use single underscore.
+ * config/ia64/lib1funcs.asm: Change macro names to match t-ia64.
2001-07-02 Zack Weinberg <zackw@stanford.edu>
static HARD_REG_SET hard_regs_in_table;
-/* A HARD_REG_SET containing all the hard registers that are invalidated
- by a CALL_INSN. */
-
-static HARD_REG_SET regs_invalidated_by_call;
-
/* CUID of insn that starts the basic block currently being cse-processed. */
static int cse_basic_block_start;
INSN_CUID (insn) = i;
}
- /* Initialize which registers are clobbered by calls. */
-
- CLEAR_HARD_REG_SET (regs_invalidated_by_call);
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if ((call_used_regs[i]
- /* Used to check !fixed_regs[i] here, but that isn't safe;
- fixed regs are still call-clobbered, and sched can get
- confused if they can "live across calls".
-
- The frame pointer is always preserved across calls. The arg
- pointer is if it is fixed. The stack pointer usually is, unless
- RETURN_POPS_ARGS, in which case an explicit CLOBBER
- will be present. If we are generating PIC code, the PIC offset
- table register is preserved across calls. */
-
- && i != STACK_POINTER_REGNUM
- && i != FRAME_POINTER_REGNUM
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && i != HARD_FRAME_POINTER_REGNUM
-#endif
-#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && ! (i == ARG_POINTER_REGNUM && fixed_regs[i])
-#endif
-#if !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
- && ! (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
-#endif
- )
- || global_regs[i])
- SET_HARD_REG_BIT (regs_invalidated_by_call, i);
-
ggc_push_context ();
/* Loop over basic blocks.
if (df->flags & DF_HARD_REGS)
{
- /* Each call clobbers all call-clobbered regs that are not
- global or fixed and have not been explicitly defined
- in the call pattern. */
+ /* Kill all registers invalidated by a call. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (call_used_regs[i]
- && ! global_regs[i]
- && ! fixed_regs[i]
- && ! df_insn_regno_def_p (df, bb, insn, i))
+ if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
{
rtx reg_clob = df_reg_clobber_gen (i);
df_defs_record (df, reg_clob, bb, insn);
/* Calls change all call-used and global registers. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (call_used_regs[i] && ! global_regs[i]
- && ! fixed_regs[i])
+ if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
{
/* We do not want REG_UNUSED notes for these registers. */
mark_set_1 (pbi, CLOBBER, gen_rtx_REG (reg_raw_mode[i], i),
if (GET_CODE (insn) == CALL_INSN)
{
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- if ((call_used_regs[regno]
- && regno != STACK_POINTER_REGNUM
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && regno != HARD_FRAME_POINTER_REGNUM
-#endif
-#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
-#endif
-#if !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
- && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
-#endif
-
- && regno != FRAME_POINTER_REGNUM)
- || global_regs[regno])
+ if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
record_last_reg_set_info (insn, regno);
if (! CONST_CALL_P (insn))
if (GET_CODE (insn) == CALL_INSN)
{
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- {
- if ((call_used_regs[regno]
- && regno != STACK_POINTER_REGNUM
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && regno != HARD_FRAME_POINTER_REGNUM
-#endif
-#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && ! (regno == ARG_POINTER_REGNUM
- && fixed_regs[regno])
-#endif
-#if !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
- && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
-#endif
- && regno != FRAME_POINTER_REGNUM)
- || global_regs[regno])
- handle_rd_kill_set (insn, regno, BASIC_BLOCK (bb));
- }
+ if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
+ handle_rd_kill_set (insn, regno, BASIC_BLOCK (bb));
}
if (GET_CODE (pat) == PARALLEL)
if (GET_CODE (insn) == CALL_INSN)
{
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- if ((call_used_regs[regno]
- && regno != STACK_POINTER_REGNUM
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && regno != HARD_FRAME_POINTER_REGNUM
-#endif
-#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
-#endif
-#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
- && ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
-#endif
-
- && regno != FRAME_POINTER_REGNUM)
- || global_regs[regno])
- SET_BIT (reg_set_in_block[bb], regno);
+ if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
+ SET_BIT (reg_set_in_block[bb], regno);
}
pat = PATTERN (insn);
extern char global_regs[FIRST_PSEUDO_REGISTER];
+/* Contains 1 for registers that are set or clobbered by calls. */
+/* ??? Ideally, this would be just call_used_regs plus global_regs, but
+ for someone's bright idea to have call_used_regs strictly include
+ fixed_regs. Which leaves us guessing as to the set of fixed_regs
+ that are actually preserved. We know for sure that those associated
+ with the local stack frame are safe, but scant others. */
+
+extern HARD_REG_SET regs_invalidated_by_call;
+
#ifdef REG_ALLOC_ORDER
/* Table of register numbers in the order in which to try to use them. */
and are also considered fixed. */
char global_regs[FIRST_PSEUDO_REGISTER];
-
+
+/* Contains 1 for registers that are set or clobbered by calls. */
+/* ??? Ideally, this would be just call_used_regs plus global_regs, but
+ for someone's bright idea to have call_used_regs strictly include
+ fixed_regs. Which leaves us guessing as to the set of fixed_regs
+ that are actually preserved. We know for sure that those associated
+ with the local stack frame are safe, but scant others. */
+
+HARD_REG_SET regs_invalidated_by_call;
+
/* Table of register numbers in the order in which to try to use them. */
#ifdef REG_ALLOC_ORDER
int reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER;
CLEAR_HARD_REG_SET (fixed_reg_set);
CLEAR_HARD_REG_SET (call_used_reg_set);
CLEAR_HARD_REG_SET (call_fixed_reg_set);
+ CLEAR_HARD_REG_SET (regs_invalidated_by_call);
memcpy (call_fixed_regs, fixed_regs, sizeof call_fixed_regs);
SET_HARD_REG_BIT (call_fixed_reg_set, i);
if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (i)))
SET_HARD_REG_BIT (losing_caller_save_reg_set, i);
+
+ /* There are a couple of fixed registers that we know are safe to
+ exclude from being clobbered by calls:
+
+ The frame pointer is always preserved across calls. The arg pointer
+ is if it is fixed. The stack pointer usually is, unless
+ RETURN_POPS_ARGS, in which case an explicit CLOBBER will be present.
+ If we are generating PIC code, the PIC offset table register is
+ preserved across calls, though the target can override that. */
+
+ if (i == STACK_POINTER_REGNUM || i == FRAME_POINTER_REGNUM)
+ ;
+#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
+ else if (i == HARD_FRAME_POINTER_REGNUM)
+ ;
+#endif
+#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
+ else if (i == ARG_POINTER_REGNUM && fixed_regs[i])
+ ;
+#endif
+#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
+ else if (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
+ ;
+#endif
+ else if (call_used_regs[i] || global_regs[i])
+ SET_HARD_REG_BIT (regs_invalidated_by_call, i);
}
+
memset (contains_reg_of_mode, 0, sizeof (contains_reg_of_mode));
memset (allocatable_regs_of_mode, 0, sizeof (allocatable_regs_of_mode));
for (m = 0; m < (unsigned int) MAX_MACHINE_MODE; m++)
SET_REGNO_REG_SET (reg_pending_clobbers, r);
/* Function calls clobber all call_used regs. */
- if (global_regs[r] || (code == SET && call_used_regs[r]))
+ if (global_regs[r]
+ || (code == SET
+ && TEST_HARD_REG_BIT (regs_invalidated_by_call, r)))
for (u = deps->last_function_call; u; u = XEXP (u, 1))
add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
}