diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-12 04:53:54 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-12 04:53:54 +0000 |
commit | a6f7c039edc36ecf238d6930a8bd7852f0092d3e (patch) | |
tree | 49d093fb58e94888daac5f7673fda83e72e2cb11 /gcc/dwarf2out.c | |
parent | 614b751e4b30edda9851b3ce0e9d21d376652a81 (diff) | |
download | gcc-a6f7c039edc36ecf238d6930a8bd7852f0092d3e.tar.gz |
* dwarf2out.c (need_data_align_sf_opcode): New.
(div_data_align): Move earlier.
(def_cfa_1, reg_save): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148411 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index bbd763a5aa9..1d3a1ca2f52 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.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)); } +/* 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. */ void @@ -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 happens in output_cfi, or in the assembler via the .cfi_def_cfa directive. */ - if (loc.offset < 0) + if (need_data_align_sf_opcode (loc.offset)) cfi->dw_cfi_opc = DW_CFA_def_cfa_sf; else 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 } else if (sreg == INVALID_REGNUM) { - if (offset < 0) + if (need_data_align_sf_opcode (offset)) cfi->dw_cfi_opc = DW_CFA_offset_extended_sf; else if (reg & ~0x3f) cfi->dw_cfi_opc = DW_CFA_offset_extended; @@ -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). */ static void |