Commit f2ae7631 by Richard Henderson Committed by Richard Henderson

dwarf2out.c (need_data_align_sf_opcode): New.

        * dwarf2out.c (need_data_align_sf_opcode): New.
        (div_data_align): Move earlier.
        (def_cfa_1, reg_save): Use it.

From-SVN: r148411
parent 8ed0ce99
2009-06-11 Richard Henderson <rth@redhat.com>
* dwarf2out.c (need_data_align_sf_opcode): New.
(div_data_align): Move earlier.
(def_cfa_1, reg_save): Use it.
2009-06-11 H.J. Lu <hongjiu.lu@intel.com> 2009-06-11 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (OPTION_MASK_ISA_CRC32_SET): New. * config/i386/i386.c (OPTION_MASK_ISA_CRC32_SET): New.
......
...@@ -522,6 +522,25 @@ init_return_column_size (enum machine_mode mode, rtx mem, unsigned int c) ...@@ -522,6 +522,25 @@ init_return_column_size (enum machine_mode mode, rtx mem, unsigned int c)
emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size)); emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
} }
/* Divide OFF by DWARF_CIE_DATA_ALIGNMENT, asserting no remainder. */
static HOST_WIDE_INT
div_data_align (HOST_WIDE_INT off)
{
HOST_WIDE_INT r = off / DWARF_CIE_DATA_ALIGNMENT;
gcc_assert (r * DWARF_CIE_DATA_ALIGNMENT == off);
return r;
}
/* Return true if we need a signed version of a given opcode
(e.g. DW_CFA_offset_extended_sf vs DW_CFA_offset_extended). */
static bool
need_data_align_sf_opcode (HOST_WIDE_INT off)
{
return DWARF_CIE_DATA_ALIGNMENT < 0 ? off > 0 : off < 0;
}
/* Generate code to initialize the register size table. */ /* Generate code to initialize the register size table. */
void void
...@@ -1000,7 +1019,7 @@ def_cfa_1 (const char *label, dw_cfa_location *loc_p) ...@@ -1000,7 +1019,7 @@ def_cfa_1 (const char *label, dw_cfa_location *loc_p)
the specified offset. The data factoring for DW_CFA_def_cfa_sf the specified offset. The data factoring for DW_CFA_def_cfa_sf
happens in output_cfi, or in the assembler via the .cfi_def_cfa happens in output_cfi, or in the assembler via the .cfi_def_cfa
directive. */ directive. */
if (loc.offset < 0) if (need_data_align_sf_opcode (loc.offset))
cfi->dw_cfi_opc = DW_CFA_def_cfa_sf; cfi->dw_cfi_opc = DW_CFA_def_cfa_sf;
else else
cfi->dw_cfi_opc = DW_CFA_def_cfa; cfi->dw_cfi_opc = DW_CFA_def_cfa;
...@@ -1048,7 +1067,7 @@ reg_save (const char *label, unsigned int reg, unsigned int sreg, HOST_WIDE_INT ...@@ -1048,7 +1067,7 @@ reg_save (const char *label, unsigned int reg, unsigned int sreg, HOST_WIDE_INT
} }
else if (sreg == INVALID_REGNUM) else if (sreg == INVALID_REGNUM)
{ {
if (offset < 0) if (need_data_align_sf_opcode (offset))
cfi->dw_cfi_opc = DW_CFA_offset_extended_sf; cfi->dw_cfi_opc = DW_CFA_offset_extended_sf;
else if (reg & ~0x3f) else if (reg & ~0x3f)
cfi->dw_cfi_opc = DW_CFA_offset_extended; cfi->dw_cfi_opc = DW_CFA_offset_extended;
...@@ -2926,16 +2945,6 @@ switch_to_eh_frame_section (void) ...@@ -2926,16 +2945,6 @@ switch_to_eh_frame_section (void)
} }
} }
/* Divide OFF by DWARF_CIE_DATA_ALIGNMENT, asserting no remainder. */
static HOST_WIDE_INT
div_data_align (HOST_WIDE_INT off)
{
HOST_WIDE_INT r = off / DWARF_CIE_DATA_ALIGNMENT;
gcc_assert (r * DWARF_CIE_DATA_ALIGNMENT == off);
return r;
}
/* Output a Call Frame Information opcode and its operand(s). */ /* Output a Call Frame Information opcode and its operand(s). */
static void static void
......
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