tm.texi (Exception Region Output): Document DWARF_CIE_DATA_ALIGNMENT.
authorHans-Peter Nilsson <hp@axis.com>
Wed, 18 Oct 2000 12:49:47 +0000 (12:49 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Wed, 18 Oct 2000 12:49:47 +0000 (12:49 +0000)
* tm.texi (Exception Region Output): Document
DWARF_CIE_DATA_ALIGNMENT.
* dwarf2out.c (DWARF_CIE_DATA_ALIGNMENT): Wrap definition in
#ifndef.
[ENABLE_CHECKING] (reg_save): Abort if offset is not a multiple of
DWARF_CIE_DATA_ALIGNMENT.

From-SVN: r36935

gcc/ChangeLog
gcc/dwarf2out.c
gcc/tm.texi

index 1345e5fb510fefcd9d46f3d4592c275547f2f037..a78abfdea90106bccc16425da38cfab3e72a267e 100644 (file)
@@ -1,3 +1,12 @@
+2000-10-18  Hans-Peter Nilsson  <hp@axis.com>
+
+       * tm.texi (Exception Region Output): Document
+       DWARF_CIE_DATA_ALIGNMENT.
+       * dwarf2out.c (DWARF_CIE_DATA_ALIGNMENT): Wrap definition in
+       #ifndef.
+       [ENABLE_CHECKING] (reg_save): Abort if offset is not a multiple of
+       DWARF_CIE_DATA_ALIGNMENT.
+
 2000-10-18  Michael Hayes  <mhayes@cygnus.com>
 
        * basic-block.h (struct loop): Delete fields pre_header_root
index 017cc6254060326184a34078911abbfa08c80c4d..b362a1ec7d17a0674a58f38e9d7130342835aeda 100644 (file)
@@ -169,11 +169,13 @@ dw_fde_node;
   ((((SIZE) + (BOUNDARY) - 1) / (BOUNDARY)) * (BOUNDARY))
 
 /* Offsets recorded in opcodes are a multiple of this alignment factor.  */
+#ifndef DWARF_CIE_DATA_ALIGNMENT
 #ifdef STACK_GROWS_DOWNWARD
 #define DWARF_CIE_DATA_ALIGNMENT (-((int) UNITS_PER_WORD))
 #else
 #define DWARF_CIE_DATA_ALIGNMENT ((int) UNITS_PER_WORD)
 #endif
+#endif /* not DWARF_CIE_DATA_ALIGNMENT */
 
 /* A pointer to the base of a table that contains frame description
    information for each routine.  */
@@ -940,6 +942,18 @@ reg_save (label, reg, sreg, offset)
       else
        cfi->dw_cfi_opc = DW_CFA_offset;
 
+#ifdef ENABLE_CHECKING
+      {
+       /* If we get an offset that is not a multiple of
+          DWARF_CIE_DATA_ALIGNMENT, there is either a bug in the
+          definition of DWARF_CIE_DATA_ALIGNMENT, or a bug in the machine
+          description.  */
+       long check_offset = offset / DWARF_CIE_DATA_ALIGNMENT;
+
+       if (check_offset * DWARF_CIE_DATA_ALIGNMENT != offset)
+         abort ();
+      }
+#endif
       offset /= DWARF_CIE_DATA_ALIGNMENT;
       if (offset < 0)
        {
index 784943849a24a0c8a8e96a3e3b031565abe7361d..fd2403e3039552cedfb60cb6f6d6f8493cae96eb 100644 (file)
@@ -6682,6 +6682,15 @@ default.
 If this macro is defined to anything, the DWARF 2 unwinder will be used
 instead of inline unwinders and __unwind_function in the non-setjmp case.
 
+@findex DWARF_CIE_DATA_ALIGNMENT
+@item DWARF_CIE_DATA_ALIGNMENT
+This macro need only be defined if the target might save registers in the
+function prologue at an offset to the stack pointer that is not aligned to
+@code{UNITS_PER_WORD}.  The definition should be the negative minimum
+alignment if @code{STACK_GROWS_DOWNWARD} is defined, and the positive
+minimum alignment otherwise.  @xref{SDB and DWARF}.  Only applicable if
+the target supports DWARF 2 frame unwind information.
+
 @end table
 
 @node Alignment Output