aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2009-06-11 21:53:54 -0700
committerRichard Henderson <rth@gcc.gnu.org>2009-06-11 21:53:54 -0700
commitf2ae7631fb1cec46a9614c254b91fa4d51ed5680 (patch)
tree49d093fb58e94888daac5f7673fda83e72e2cb11 /gcc
parent8ed0ce9982d3a3ae3317d5fa44b96b391f58c385 (diff)
downloadgcc-f2ae7631fb1cec46a9614c254b91fa4d51ed5680.zip
gcc-f2ae7631fb1cec46a9614c254b91fa4d51ed5680.tar.gz
gcc-f2ae7631fb1cec46a9614c254b91fa4d51ed5680.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c33
2 files changed, 27 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8ced872..b1d0cd7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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>
* config/i386/i386.c (OPTION_MASK_ISA_CRC32_SET): New.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index bbd763a..1d3a1ca 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