Commit 55d6f631 by Richard Sandiford Committed by Richard Sandiford

dwarf2out.c (dwarf2out_frame_debug_expr): Record the register saves in a…

dwarf2out.c (dwarf2out_frame_debug_expr): Record the register saves in a PARALLEL before the register assignments.

gcc/
	* dwarf2out.c (dwarf2out_frame_debug_expr): Record the register
	saves in a PARALLEL before the register assignments.

From-SVN: r121594
parent 5cd0f915
2007-02-05 Richard Sandiford <richard@codesourcery.com> 2007-02-05 Richard Sandiford <richard@codesourcery.com>
* dwarf2out.c (dwarf2out_frame_debug_expr): Record the register
saves in a PARALLEL before the register assignments.
2007-02-05 Richard Sandiford <richard@codesourcery.com>
* doc/tm.texi (DWARF_ALT_FRAME_RETURN_COLUMN): Do not require * doc/tm.texi (DWARF_ALT_FRAME_RETURN_COLUMN): Do not require
DWARF_FRAME_RETURN_COLUMN to be a general register. DWARF_FRAME_RETURN_COLUMN to be a general register.
* dwarf2out.c (init_return_column_size): New function, split from... * dwarf2out.c (init_return_column_size): New function, split from...
......
...@@ -1524,13 +1524,31 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label) ...@@ -1524,13 +1524,31 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
{ {
int par_index; int par_index;
int limit = XVECLEN (expr, 0); int limit = XVECLEN (expr, 0);
rtx elem;
/* PARALLELs have strict read-modify-write semantics, so we
ought to evaluate every rvalue before changing any lvalue.
It's cumbersome to do that in general, but there's an
easy approximation that is enough for all current users:
handle register saves before register assignments. */
if (GET_CODE (expr) == PARALLEL)
for (par_index = 0; par_index < limit; par_index++)
{
elem = XVECEXP (expr, 0, par_index);
if (GET_CODE (elem) == SET
&& MEM_P (SET_DEST (elem))
&& (RTX_FRAME_RELATED_P (elem) || par_index == 0))
dwarf2out_frame_debug_expr (elem, label);
}
for (par_index = 0; par_index < limit; par_index++) for (par_index = 0; par_index < limit; par_index++)
if (GET_CODE (XVECEXP (expr, 0, par_index)) == SET {
&& (RTX_FRAME_RELATED_P (XVECEXP (expr, 0, par_index)) elem = XVECEXP (expr, 0, par_index);
|| par_index == 0)) if (GET_CODE (elem) == SET
dwarf2out_frame_debug_expr (XVECEXP (expr, 0, par_index), label); && (!MEM_P (SET_DEST (elem)) || GET_CODE (expr) == SEQUENCE)
&& (RTX_FRAME_RELATED_P (elem) || par_index == 0))
dwarf2out_frame_debug_expr (elem, label);
}
return; return;
} }
......
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