Commit b664de3a by Andrew Macleod

rtl.texi (RTX_FRAME_RELATED_P): Add documentation.

 
Thu Mar 25 14:04:54 EST 1999  Andrew MacLeod  <amacleod@cygnus.com>
	* rtl.texi (RTX_FRAME_RELATED_P): Add documentation.
	* rtl.h (struct rtx_def): Update comment for frame_related field.
	(set_unique_reg_note): Declare prototype.
	* dwarf2out.c (dwarf2out_frame_debug_expr): Split out from
	'dwarf2out_frame_debug' to handle only expressions, and process
	component parts of a PARALLEL expression.
	(dwarf2out_frame_debug): Process insns only, and call
	new function 'dwarf2out_frame_debug_expr' for patterns.
	* emit-rtl.c (set_unique_reg_note): New function to add a reg note,
	but if there is an existingone, deletes it first.
	* expmed.c (expand_mult, expand_divmod): Use set_unique_reg_note.
	* optabs.c (add_equal_note, expand_binop): Use set_unique_reg_note.
	(emit_no_conflict_block, emit_libcall_block): Use set_unique_reg_note.
	(expand_fix):  Use set_unique_reg_note.

From-SVN: r25977
parent 2b4b3e5f
......@@ -1186,59 +1186,51 @@ dwarf2out_stack_adjust (insn)
dwarf2out_args_size (label, args_size);
}
/* Record call frame debugging information for INSN, which either
/* A temporary register used in adjusting SP or setting up the store_reg. */
static unsigned cfa_temp_reg;
/* A temporary value used in adjusting SP or setting up the store_reg. */
static long cfa_temp_value;
/* Record call frame debugging information for an expression, which either
sets SP or FP (adjusting how we calculate the frame address) or saves a
register to the stack. If INSN is NULL_RTX, initialize our state. */
register to the stack. */
void
dwarf2out_frame_debug (insn)
rtx insn;
{
static void
dwarf2out_frame_debug_expr (expr, label)
rtx expr;
char *label;
{
rtx src, dest;
long offset;
/* A temporary register used in adjusting SP or setting up the store_reg. */
static unsigned cfa_temp_reg;
static long cfa_temp_value;
/* If RTX_FRAME_RELATED_P is set on a PARALLEL, process each member of
the PARALLEL independantly. The first element is always processed if
it is a SET. This is for backward compatability. Other elements
are processed only if they are SETs and the RTX_FRAME_RELATED_P
flag is set in them. */
if (insn == NULL_RTX)
if (GET_CODE (expr) == PARALLEL)
{
/* Set up state for generating call frame debug info. */
lookup_cfa (&cfa_reg, &cfa_offset);
if (cfa_reg != DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM))
abort ();
cfa_reg = STACK_POINTER_REGNUM;
cfa_store_reg = cfa_reg;
cfa_store_offset = cfa_offset;
cfa_temp_reg = -1;
cfa_temp_value = 0;
return;
}
int par_index;
int limit = XVECLEN (expr, 0);
if (! RTX_FRAME_RELATED_P (insn))
for (par_index = 0; par_index < limit; par_index++)
{
dwarf2out_stack_adjust (insn);
rtx x = XVECEXP (expr, 0, par_index);
if (GET_CODE (x) == SET &&
(RTX_FRAME_RELATED_P (x) || par_index == 0))
dwarf2out_frame_debug_expr (x, label);
}
return;
}
label = dwarf2out_cfi_label ();
src = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
if (src)
insn = XEXP (src, 0);
else
insn = PATTERN (insn);
/* Assume that in a PARALLEL prologue insn, only the first elt is
significant. Currently this is true. */
if (GET_CODE (insn) == PARALLEL)
insn = XVECEXP (insn, 0, 0);
if (GET_CODE (insn) != SET)
if (GET_CODE (expr) != SET)
abort ();
src = SET_SRC (insn);
dest = SET_DEST (insn);
src = SET_SRC (expr);
dest = SET_DEST (expr);
switch (GET_CODE (dest))
{
......@@ -1390,7 +1382,7 @@ dwarf2out_frame_debug (insn)
case PLUS:
case MINUS:
offset = INTVAL (XEXP (XEXP (dest, 0), 1));
if (GET_CODE (src) == MINUS)
if (GET_CODE (XEXP (dest, 0)) == MINUS)
offset = -offset;
if (cfa_store_reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
......@@ -1417,6 +1409,49 @@ dwarf2out_frame_debug (insn)
}
}
/* Record call frame debugging information for INSN, which either
sets SP or FP (adjusting how we calculate the frame address) or saves a
register to the stack. If INSN is NULL_RTX, initialize our state. */
void
dwarf2out_frame_debug (insn)
rtx insn;
{
char *label;
rtx src;
if (insn == NULL_RTX)
{
/* Set up state for generating call frame debug info. */
lookup_cfa (&cfa_reg, &cfa_offset);
if (cfa_reg != DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM))
abort ();
cfa_reg = STACK_POINTER_REGNUM;
cfa_store_reg = cfa_reg;
cfa_store_offset = cfa_offset;
cfa_temp_reg = -1;
cfa_temp_value = 0;
return;
}
if (! RTX_FRAME_RELATED_P (insn))
{
dwarf2out_stack_adjust (insn);
return;
}
label = dwarf2out_cfi_label ();
src = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
if (src)
insn = XEXP (src, 0);
else
insn = PATTERN (insn);
dwarf2out_frame_debug_expr (insn, label);
}
/* Return the size of an unsigned LEB128 quantity. */
static inline unsigned long
......
......@@ -164,7 +164,7 @@ typedef struct rtx_def
In a REG, nonzero means this reg refers to the return value
of the current function. */
unsigned integrated : 1;
/* 1 in an INSN if this rtx is related to the call frame,
/* 1 in an INSN or a SET if this rtx is related to the call frame,
either changing how we compute the frame address or saving and
restoring registers in the prologue and epilogue.
1 in a MEM if the MEM refers to a scalar, rather than a member of
......@@ -997,6 +997,7 @@ extern rtx gen_mem_addressof PROTO((rtx, union tree_node *));
extern rtx eliminate_constant_term PROTO((rtx, rtx *));
extern rtx expand_complex_abs PROTO((enum machine_mode, rtx, rtx, int));
extern enum machine_mode choose_hard_reg_mode PROTO((int, int));
extern void set_unique_reg_note PROTO((rtx, enum reg_note, rtx));
/* Functions in rtlanal.c */
......
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