free (V); \
} while (0)
-/* The bitmap_obstack is used to hold some static variables that
- should not be reset after each function is compiled. */
-
-static bitmap_obstack persistent_obstack;
-
/* The set of hard registers in eliminables[i].from. */
static HARD_REG_SET elim_reg_set;
-/* This is a bitmap copy of regs_invalidated_by_call so that we can
- easily add it into bitmaps, etc. */
-
-bitmap df_invalidated_by_call = NULL;
-
/* Initialize ur_in and ur_out as if all hard registers were partially
available. */
rtx insn;
fprintf (file, ";; invalidated by call \t");
- df_print_regset (file, df_invalidated_by_call);
+ df_print_regset (file, regs_invalidated_by_call_regset);
fprintf (file, ";; hardware regs used \t");
df_print_regset (file, df->hardware_regs_used);
fprintf (file, ";; regular block artificial uses \t");
}
is_sibling_call = SIBLING_CALL_P (insn_info->insn);
- EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi)
+ EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, ui, bi)
{
if (!global_regs[ui]
&& (!bitmap_bit_p (defs_generated, ui))
}
#endif
-
-#ifdef EH_USES
- if (bb_has_eh_pred (bb))
- {
- unsigned int i;
- /* This code is putting in an artificial ref for the use at the
- TOP of the block that receives the exception. It is too
- cumbersome to actually put the ref on the edge. We could
- either model this at the top of the receiver block or the
- bottom of the sender block.
-
- The bottom of the sender block is problematic because not all
- out-edges of a block are eh-edges. However, it is true
- that all edges into a block are either eh-edges or none of
- them are eh-edges. Thus, we can model this at the top of the
- eh-receiver for all of the edges at once. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (EH_USES (i))
- df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL,
- bb, NULL, DF_REF_REG_USE, DF_REF_AT_TOP, -1, -1, 0);
- }
-#endif
-
/* Add the hard_frame_pointer if this block is the target of a
non-local goto. */
if (bb->flags & BB_NON_LOCAL_GOTO_TARGET)
static void
df_get_regular_block_artificial_uses (bitmap regular_block_artificial_uses)
{
+#ifdef EH_USES
+ unsigned int i;
+#endif
+
bitmap_clear (regular_block_artificial_uses);
if (reload_completed)
}
/* The all-important stack pointer must always be live. */
bitmap_set_bit (regular_block_artificial_uses, STACK_POINTER_REGNUM);
+
+#ifdef EH_USES
+ /* EH_USES registers are used:
+ 1) at all insns that might throw (calls or with -fnon-call-exceptions
+ trapping insns)
+ 2) in all EH edges
+ 3) to support backtraces and/or debugging, anywhere between their
+ initialization and where they the saved registers are restored
+ from them, including the cases where we don't reach the epilogue
+ (noreturn call or infinite loop). */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (EH_USES (i))
+ bitmap_set_bit (regular_block_artificial_uses, i);
+#endif
}
/* These registers are live everywhere. */
if (!reload_completed)
{
-#ifdef EH_USES
- /* The ia-64, the only machine that uses this, does not define these
- until after reload. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (EH_USES (i))
- {
- bitmap_set_bit (entry_block_defs, i);
- }
-#endif
-
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Pseudos with argument area equivalences may require
reloading via the argument pointer. */
void
df_hard_reg_init (void)
{
- int i;
#ifdef ELIMINABLE_REGS
+ int i;
static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS;
#endif
if (initialized)
return;
- bitmap_obstack_initialize (&persistent_obstack);
-
/* Record which registers will be eliminated. We use this in
mark_used_regs. */
CLEAR_HARD_REG_SET (elim_reg_set);
SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
#endif
- df_invalidated_by_call = BITMAP_ALLOC (&persistent_obstack);
-
- /* Inconveniently, this is only readily available in hard reg set
- form. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
- if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
- bitmap_set_bit (df_invalidated_by_call, i);
-
initialized = true;
}