http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47324
--- Comment #32 from Jack Howarth <howarth at nitro dot med.uc.edu> 2011-02-10
14:38:22 UTC ---
(In reply to comment #31)
I don't see how we can directly use DWARF2_FRAME_REG_OUT in
output_loc_operands, except as a template for the desired register changes. How
about this strategy for that part of the patch?
@@ -5291,16 +5291,44 @@ output_loc_operands (dw_loc_descr_ref lo
/* Output a sequence of location operations. */
static void
-output_loc_sequence (dw_loc_descr_ref loc)
+output_loc_sequence (dw_loc_descr_ref loc, bool for_eh)
{
+ unsigned int dw_op;
for (; loc != NULL; loc = loc->dw_loc_next)
{
/* Output the opcode. */
- dw2_asm_output_data (1, loc->dw_loc_opc,
- "%s", dwarf_stack_op_name (loc->dw_loc_opc));
+ dw_op = loc->dw_loc_opc;
+ if (for_eh)
+ switch (dw_op)
+ {
+ case DW_OP_reg4:
+ dw_op = DW_OP_reg5;
+ case DW_OP_reg5:
+ dw_op = DW_OP_reg4
+ case DW_OP_reg11:
+ dw_op = DW_OP_reg12;
+ case DW_OP_reg12:
+ dw_op = DW_OP_reg13;
+ case DW_OP_reg13:
+ dw_op = DW_OP_reg14;
+ case DW_OP_reg14:
+ dw_op = DW_OP_reg15;
+ case DW_OP_reg15:
+ dw_op = DW_OP_reg16;
+ case DW_OP_reg16:
+ dw_op = DW_OP_reg17;
+ case DW_OP_reg17:
+ dw_op = DW_OP_reg18;
+ case DW_OP_reg18:
+ dw_op = DW_OP_reg19;
+ default:
+ ;
+ }
+ dw2_asm_output_data (1, loc->dw_loc_opc,
+ "%s", dwarf_stack_op_name (dw_op));
/* Output the operand(s) (if any). */
- output_loc_operands (loc);
+ output_loc_operands (loc, for_eh);
}
}