From 27c35f4b2435bc05271dca75ec26a585e6853f4a Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Wed, 18 Oct 2000 12:49:47 +0000 Subject: [PATCH] tm.texi (Exception Region Output): Document DWARF_CIE_DATA_ALIGNMENT. * 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 | 9 +++++++++ gcc/dwarf2out.c | 14 ++++++++++++++ gcc/tm.texi | 9 +++++++++ 3 files changed, 32 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1345e5fb510..a78abfdea90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2000-10-18 Hans-Peter Nilsson + + * 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 * basic-block.h (struct loop): Delete fields pre_header_root diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 017cc625406..b362a1ec7d1 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -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) { diff --git a/gcc/tm.texi b/gcc/tm.texi index 784943849a2..fd2403e3039 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -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 -- 2.30.2