if (df->changeable_flags & DF_NO_INSN_RESCAN)
return;
+ /* Do nothing if the insn hasn't been emitted yet. */
+ if (!BLOCK_FOR_INSN (insn))
+ return;
+
df_grow_bb_info (df_scan);
df_grow_reg_info ();
enum df_ref_type ref_type,
enum df_ref_flags ref_flags)
{
- rtx oldreg = reg;
unsigned int regno;
gcc_assert (REG_P (reg) || GET_CODE (reg) == SUBREG);
{
/* Sets to a subreg of a multiword register are partial.
Sets to a non-subreg of a multiword register are not. */
- if (GET_CODE (oldreg) == SUBREG)
+ if (GET_CODE (reg) == SUBREG)
ref_flags |= DF_REF_PARTIAL;
ref_flags |= DF_REF_MW_HARDREG;
hardreg->type = ref_type;
hardreg->flags = ref_flags;
hardreg->mw_reg = reg;
- hardreg->loc = loc;
hardreg->start_regno = regno;
hardreg->end_regno = endregno - 1;
hardreg->mw_order = df->ref_order++;
|| GET_CODE (dst) == ZERO_EXTRACT)
{
flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL;
+ if (GET_CODE (dst) == ZERO_EXTRACT)
+ flags |= DF_REF_EXTRACT;
+ else
+ flags |= DF_REF_STRICT_LOWER_PART;
+
loc = &XEXP (dst, 0);
dst = *loc;
}
- if (df_read_modify_subreg_p (dst))
- flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL;
+ /* At this point if we do not have a reg or a subreg, just return. */
+ if (REG_P (dst))
+ {
+ df_ref_record (collection_rec,
+ dst, loc, bb, insn, DF_REF_REG_DEF, flags);
- if (REG_P (dst)
- || (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst))))
- df_ref_record (collection_rec,
- dst, loc, bb, insn, DF_REF_REG_DEF, flags);
+ /* We want to keep sp alive everywhere - by making all
+ writes to sp also use of sp. */
+ if (REGNO (dst) == STACK_POINTER_REGNUM)
+ df_ref_record (collection_rec,
+ dst, NULL, bb, insn, DF_REF_REG_USE, flags);
+ }
+ else if (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst)))
+ {
+ if (df_read_modify_subreg_p (dst))
+ flags |= DF_REF_READ_WRITE | DF_REF_PARTIAL;
- /* We want to keep sp alive everywhere - by making all
- writes to sp also use of sp. */
- if (REG_P (dst) && REGNO (dst) == STACK_POINTER_REGNUM)
- df_ref_record (collection_rec,
- dst, NULL, bb, insn, DF_REF_REG_USE, flags);
+ flags |= DF_REF_SUBREG;
+
+ df_ref_record (collection_rec,
+ dst, loc, bb, insn, DF_REF_REG_DEF, flags);
+ }
}
case CONST_INT:
case CONST:
case CONST_DOUBLE:
+ case CONST_FIXED:
case CONST_VECTOR:
case PC:
case CC0:
if (df_read_modify_subreg_p (dst))
{
df_uses_record (collection_rec, &SUBREG_REG (dst),
- DF_REF_REG_USE, bb, insn, flags | DF_REF_READ_WRITE);
+ DF_REF_REG_USE, bb, insn,
+ flags | DF_REF_READ_WRITE | DF_REF_SUBREG);
break;
}
/* Fall through. */
dst = XEXP (dst, 0);
df_uses_record (collection_rec,
(GET_CODE (dst) == SUBREG) ? &SUBREG_REG (dst) : temp,
- DF_REF_REG_USE, bb, insn, DF_REF_READ_WRITE);
+ DF_REF_REG_USE, bb, insn,
+ DF_REF_READ_WRITE | DF_REF_STRICT_LOWER_PART);
}
break;
case ZERO_EXTRACT:
case SIGN_EXTRACT:
df_uses_record (collection_rec, &XEXP (dst, 0),
- DF_REF_REG_USE, bb, insn, DF_REF_READ_WRITE);
+ DF_REF_REG_USE, bb, insn,
+ DF_REF_READ_WRITE | DF_REF_EXTRACT);
df_uses_record (collection_rec, &XEXP (dst, 1),
DF_REF_REG_USE, bb, insn, flags);
df_uses_record (collection_rec, &XEXP (dst, 2),
so they are recorded as used. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i])
- df_ref_record (collection_rec, regno_reg_rtx[i],
- NULL, bb, insn, DF_REF_REG_USE, flags);
+ {
+ df_ref_record (collection_rec, regno_reg_rtx[i],
+ NULL, bb, insn, DF_REF_REG_USE, flags);
+ df_ref_record (collection_rec, regno_reg_rtx[i],
+ NULL, bb, insn, DF_REF_REG_DEF, flags);
+ }
is_sibling_call = SIBLING_CALL_P (insn);
EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi)
{
- if ((!bitmap_bit_p (defs_generated, ui))
+ if (!global_regs[ui]
+ && (!bitmap_bit_p (defs_generated, ui))
&& (!is_sibling_call
|| !bitmap_bit_p (df->exit_block_uses, ui)
|| refers_to_regno_p (ui, ui+1,
current_function_return_rtx, NULL)))
-
df_ref_record (collection_rec, regno_reg_rtx[ui],
NULL, bb, insn, DF_REF_REG_DEF, DF_REF_MAY_CLOBBER | flags);
}
df_canonize_collection_rec (collection_rec);
}
-/* Return true if any pred of BB is an eh. */
-
-bool
-df_has_eh_preds (basic_block bb)
-{
- edge e;
- edge_iterator ei;
-
- FOR_EACH_EDGE (e, ei, bb->preds)
- {
- if (e->flags & EDGE_EH)
- return true;
- }
- return false;
-}
-
-
/* Recompute the luids for the insns in BB. */
void
}
#ifdef EH_RETURN_DATA_REGNO
- if (df_has_eh_preds (bb))
+ if (bb_has_eh_pred (bb))
{
unsigned int i;
/* Mark the registers that will contain data for the handler. */
#ifdef EH_USES
- if (df_has_eh_preds (bb))
+ if (bb_has_eh_pred (bb))
{
unsigned int i;
/* This code is putting in an artificial ref for the use at the
{
bitmap_iterator bi;
unsigned int regno;
- bitmap au = df_has_eh_preds (bb)
+ bitmap au = bb_has_eh_pred (bb)
? df->eh_block_artificial_uses
: df->regular_block_artificial_uses;
df_refs_add_to_chains (&collection_rec, bb, NULL);
/* Now that the block has been processed, set the block as dirty so
- lr and ur will get it processed. */
+ LR and LIVE will get it processed. */
df_set_bb_dirty (bb);
}
}
-
-
/* Set the bit for regs that are considered being defined at the entry. */
static void
bitmap_set_bit (entry_block_defs, STATIC_CHAIN_REGNUM);
#endif
#endif
-
- r = targetm.calls.struct_value_rtx (current_function_decl, true);
- if (r && REG_P (r))
- bitmap_set_bit (entry_block_defs, REGNO (r));
}
+ r = targetm.calls.struct_value_rtx (current_function_decl, true);
+ if (r && REG_P (r))
+ bitmap_set_bit (entry_block_defs, REGNO (r));
+
if ((!reload_completed) || frame_pointer_needed)
{
/* Any reference to any pseudo before reload is a potential
}
-/* Update the defs in the entry bolck. */
+/* Update the defs in the entry block. */
void
df_update_entry_block_defs (void)
I do not know why. */
if (reload_completed
&& !bitmap_bit_p (exit_block_uses, ARG_POINTER_REGNUM)
- && df_has_eh_preds (EXIT_BLOCK_PTR)
+ && bb_has_eh_pred (EXIT_BLOCK_PTR)
&& fixed_regs[ARG_POINTER_REGNUM])
df_ref_record (collection_rec, regno_reg_rtx[ARG_POINTER_REGNUM], NULL,
EXIT_BLOCK_PTR, NULL, DF_REF_REG_USE, 0);
if (!df)
return;
- /* This is a hack, but a necessary one. If you do not do this,
- insn_attrtab can never be compiled in a bootstrap. This
- verification is just too expensive. */
- if (n_basic_blocks > 250)
- return;
-
/* Verification is a 4 step process. */
/* (1) All of the refs are marked by going thru the reg chains. */