OSDN Git Service

* dwarf2out.c (DWARF2_FRAME_REG_OUT): Move up in file.
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Mar 2006 00:03:32 +0000 (00:03 +0000)
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Mar 2006 00:03:32 +0000 (00:03 +0000)
(expand_builtin_dwarf_sp_column): Call DWARF2_FRAME_REG_OUT.
(expand_builtin_init_dwarf_reg_sizes): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111825 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c

index cb421ce..5f0ca64 100644 (file)
@@ -1,3 +1,9 @@
+2006-03-07  Geoffrey Keating  <geoffk@apple.com>
+
+       * dwarf2out.c (DWARF2_FRAME_REG_OUT): Move up in file.
+       (expand_builtin_dwarf_sp_column): Call DWARF2_FRAME_REG_OUT.
+       (expand_builtin_init_dwarf_reg_sizes): Likewise.
+
 2006-03-08  David Billinghurst <David.Billinghurst@riotinto.com>
 
        PR target/26588
 2006-03-08  David Billinghurst <David.Billinghurst@riotinto.com>
 
        PR target/26588
index 692dad7..8ee34b3 100644 (file)
@@ -99,6 +99,13 @@ static void dwarf2out_source_line (unsigned int, const char *);
 # endif
 #endif
 
 # endif
 #endif
 
+/* Map register numbers held in the call frame info that gcc has
+   collected using DWARF_FRAME_REGNUM to those that should be output in
+   .debug_frame and .eh_frame.  */
+#ifndef DWARF2_FRAME_REG_OUT
+#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) (REGNO)
+#endif
+
 /* Decide whether we want to emit frame unwind information for the current
    translation unit.  */
 
 /* Decide whether we want to emit frame unwind information for the current
    translation unit.  */
 
@@ -404,7 +411,8 @@ static void def_cfa_1 (const char *, dw_cfa_location *);
 rtx
 expand_builtin_dwarf_sp_column (void)
 {
 rtx
 expand_builtin_dwarf_sp_column (void)
 {
-  return GEN_INT (DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM));
+  int dwarf_regnum = DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM);
+  return GEN_INT (DWARF2_FRAME_REG_OUT (dwarf_regnum, 1));
 }
 
 /* Return a pointer to a copy of the section string name S with all
 }
 
 /* Return a pointer to a copy of the section string name S with all
@@ -437,27 +445,31 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
   bool wrote_return_column = false;
 
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
   bool wrote_return_column = false;
 
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-    if (DWARF_FRAME_REGNUM (i) < DWARF_FRAME_REGISTERS)
-      {
-       HOST_WIDE_INT offset = DWARF_FRAME_REGNUM (i) * GET_MODE_SIZE (mode);
-       enum machine_mode save_mode = reg_raw_mode[i];
-       HOST_WIDE_INT size;
-
-       if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
-         save_mode = choose_hard_reg_mode (i, 1, true);
-       if (DWARF_FRAME_REGNUM (i) == DWARF_FRAME_RETURN_COLUMN)
-         {
-           if (save_mode == VOIDmode)
-             continue;
-           wrote_return_column = true;
-         }
-       size = GET_MODE_SIZE (save_mode);
-       if (offset < 0)
-         continue;
-
-       emit_move_insn (adjust_address (mem, mode, offset),
-                       gen_int_mode (size, mode));
-      }
+    {
+      int rnum = DWARF2_FRAME_REG_OUT (DWARF_FRAME_REGNUM (i), 1);
+      
+      if (rnum < DWARF_FRAME_REGISTERS)
+       {
+         HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+         enum machine_mode save_mode = reg_raw_mode[i];
+         HOST_WIDE_INT size;
+         
+         if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+           save_mode = choose_hard_reg_mode (i, 1, true);
+         if (DWARF_FRAME_REGNUM (i) == DWARF_FRAME_RETURN_COLUMN)
+           {
+             if (save_mode == VOIDmode)
+               continue;
+             wrote_return_column = true;
+           }
+         size = GET_MODE_SIZE (save_mode);
+         if (offset < 0)
+           continue;
+         
+         emit_move_insn (adjust_address (mem, mode, offset),
+                         gen_int_mode (size, mode));
+       }
+    }
 
 #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
   gcc_assert (wrote_return_column);
 
 #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
   gcc_assert (wrote_return_column);
@@ -2011,13 +2023,6 @@ switch_to_eh_frame_section (void)
     }
 }
 
     }
 }
 
-/* Map register numbers held in the call frame info that gcc has
-   collected using DWARF_FRAME_REGNUM to those that should be output in
-   .debug_frame and .eh_frame.  */
-#ifndef DWARF2_FRAME_REG_OUT
-#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) (REGNO)
-#endif
-
 /* Output a Call Frame Information opcode and its operand(s).  */
 
 static void
 /* Output a Call Frame Information opcode and its operand(s).  */
 
 static void