]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (UNALIGNED_WORD_ASM_OP): Support 2 bytes pointer.
authorStephane Carrez <stcarrez@worldnet.fr>
Sun, 5 Mar 2000 22:25:36 +0000 (23:25 +0100)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 5 Mar 2000 22:25:36 +0000 (17:25 -0500)
        * dwarf2out.c (UNALIGNED_WORD_ASM_OP): Support 2 bytes pointer.
        (ASM_OUTPUT_DWARF_ADDR_CONST): Use UNALIGNED_WORD_ASM_OP.
        (DWARF_ARANGES_PAD_SIZE): New define.
        (output_aranges): Use it to pad the address range header.
        (DWARF_ROUND): Fix for non power of 2 rounding.

From-SVN: r32347

gcc/ChangeLog
gcc/dwarf2out.c

index f264658a4757fce581f00886feec9a36ec8ab33a..6329243a86465791d7bab57c24d56bf728375fbe 100644 (file)
@@ -1,3 +1,11 @@
+2000-03-05  Stephane Carrez  <stcarrez@worldnet.fr>
+
+       * dwarf2out.c (UNALIGNED_WORD_ASM_OP): Support 2 bytes pointer.
+       (ASM_OUTPUT_DWARF_ADDR_CONST): Use UNALIGNED_WORD_ASM_OP.
+       (DWARF_ARANGES_PAD_SIZE): New define.
+       (output_aranges): Use it to pad the address range header.
+       (DWARF_ROUND): Fix for non power of 2 rounding.
+
 2000-03-05  Jason Merrill  <jason@casey.cygnus.com>
 
        * mkdeps.c (deps_calc_target): Remove incorrect 'const'.
index 26bb09b054488dd1ef57a05f4b38eeb729957975..a44162e30e2de08321e13558e357e3481a1acd4f 100644 (file)
@@ -159,7 +159,7 @@ dw_fde_node;
 
 /* Round SIZE up to the nearest BOUNDARY.  */
 #define DWARF_ROUND(SIZE,BOUNDARY) \
-  (((SIZE) + (BOUNDARY) - 1) & ~((BOUNDARY) - 1))
+  ((((SIZE) + (BOUNDARY) - 1) / (BOUNDARY)) * (BOUNDARY))
 
 /* Offsets recorded in opcodes are a multiple of this alignment factor.  */
 #ifdef STACK_GROWS_DOWNWARD
@@ -312,7 +312,8 @@ static void dwarf2out_frame_debug_expr      PARAMS ((rtx, char *));
 
 #ifndef UNALIGNED_WORD_ASM_OP
 #define UNALIGNED_WORD_ASM_OP \
-  (PTR_SIZE == 8 ? UNALIGNED_DOUBLE_INT_ASM_OP : UNALIGNED_INT_ASM_OP)
+  ((PTR_SIZE) == 8 ? UNALIGNED_DOUBLE_INT_ASM_OP : \
+   ((PTR_SIZE) == 2 ? UNALIGNED_SHORT_ASM_OP : UNALIGNED_INT_ASM_OP))
 #endif
 
 #ifndef ASM_OUTPUT_DWARF_DELTA2
@@ -361,7 +362,7 @@ static void dwarf2out_frame_debug_expr      PARAMS ((rtx, char *));
 #ifndef ASM_OUTPUT_DWARF_ADDR_CONST
 #define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX)                          \
   do {                                                                 \
-    fprintf ((FILE), "\t%s\t", UNALIGNED_INT_ASM_OP);                  \
+    fprintf ((FILE), "\t%s\t", UNALIGNED_WORD_ASM_OP);                 \
     output_addr_const ((FILE), (RTX));                                 \
     fputc ('\n', (FILE));                                              \
   } while (0)
@@ -2142,6 +2143,12 @@ extern int flag_traditional;
 #define DWARF_ARANGES_HEADER_SIZE \
   (DWARF_ROUND (2 * DWARF_OFFSET_SIZE + 4, PTR_SIZE * 2) - DWARF_OFFSET_SIZE)
 
+/* Size of padding portion in the address range info.  It must be
+   aligned to twice the pointer size.  */
+#define DWARF_ARANGES_PAD_SIZE \
+  (DWARF_ROUND (2 * DWARF_OFFSET_SIZE + 4, PTR_SIZE * 2) \
+   - (2 * DWARF_OFFSET_SIZE + 4))
+
 /* The default is to have gcc emit the line number tables.  */
 #ifndef DWARF2_ASM_LINE_DEBUG_INFO
 #define DWARF2_ASM_LINE_DEBUG_INFO 0
@@ -5363,19 +5370,19 @@ output_aranges ()
             ASM_COMMENT_START);
 
   fputc ('\n', asm_out_file);
-  /* We need to align to twice the pointer size here.
-     If DWARF_OFFSET_SIZE == 4, then we have emitted 12 bytes, and need 4
-     bytes of padding to align for either 4 or 8 byte pointers.  */
-  ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
-  /* If DWARF_OFFSET_SIZE == 8, then we have emitted 20 bytes, and need 12
-     bytes of padding to align for 8 byte pointers.  We have already emitted
-     4 bytes of padding, so emit 8 more here.  */
-  if (DWARF_OFFSET_SIZE == 8)
-    fprintf (asm_out_file, ",0,0");
 
-  if (flag_debug_asm)
-    fprintf (asm_out_file, "\t%s Pad to %d byte boundary",
-            ASM_COMMENT_START, 2 * PTR_SIZE);
+  /* We need to align to twice the pointer size here.  */
+  if (DWARF_ARANGES_PAD_SIZE)
+    {
+      /* Pad using a 2 bytes word so that padding is correct
+         for any pointer size.  */
+      ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0);
+      for (i = 2; i < DWARF_ARANGES_PAD_SIZE; i += 2)
+        fprintf (asm_out_file, ",0");
+      if (flag_debug_asm)
+        fprintf (asm_out_file, "\t%s Pad to %d byte boundary",
+                 ASM_COMMENT_START, 2 * PTR_SIZE);
+    }
 
   fputc ('\n', asm_out_file);
   ASM_OUTPUT_DWARF_ADDR (asm_out_file, text_section_label);