OSDN Git Service

* i386.h (DBX_REGISTER_NUMBER): Return proper values for 64bits.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Mar 2001 13:36:26 +0000 (13:36 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Mar 2001 13:36:26 +0000 (13:36 +0000)
(dbx64_register_map): Declare.
(RETURN_ADDR_RTX): Fix for 64bit.
(DWARF_FRAME_RETURN_COLUMN): Set to 16 for 64bit.
(INCOMING_FRAME_SP_OFFSET): Set to 8.
* i386.c (dbx64_register_map): New global array.
* beos-elf.h, freebsd.h, i386-interix.h, i386elf.h,
linux.h (DBX_REGISTER_REGNUMBER): Use dbx64_register_map
for 64bits.

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

gcc/ChangeLog
gcc/config/i386/beos-elf.h
gcc/config/i386/freebsd.h
gcc/config/i386/i386-interix.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386elf.h
gcc/config/i386/linux.h

index 43a6ffe..0598574 100644 (file)
@@ -1,3 +1,15 @@
+Sat Mar 10 14:34:59 CET 2001  Jan Hubicka  <jh@suse.cz>
+
+       * i386.h (DBX_REGISTER_NUMBER): Return proper values for 64bits.
+       (dbx64_register_map): Declare.
+       (RETURN_ADDR_RTX): Fix for 64bit.
+       (DWARF_FRAME_RETURN_COLUMN): Set to 16 for 64bit.
+       (INCOMING_FRAME_SP_OFFSET): Set to 8.
+       * i386.c (dbx64_register_map): New global array.
+       * beos-elf.h, freebsd.h, i386-interix.h, i386elf.h,
+       linux.h (DBX_REGISTER_REGNUMBER): Use dbx64_register_map
+       for 64bits.
+
 2001-03-10  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * cppfiles.c (search_from): Use lbasename.
index 0ac148b..5b980b6 100644 (file)
@@ -49,7 +49,8 @@ Boston, MA 02111-1307, USA.  */
 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
 
 #undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
+#define DBX_REGISTER_NUMBER(n) \
+  (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
 
 /* Output assembler code to FILE to increment profiler label # LABELNO
    for profiling a function entry.  */
index ebd337a..6ae6235 100644 (file)
@@ -50,7 +50,8 @@ Boston, MA 02111-1307, USA.  */
 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
 
 #undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
+#define DBX_REGISTER_NUMBER(n) \
+  (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
 
 #undef  NO_PROFILE_COUNTERS
 #define NO_PROFILE_COUNTERS
index aa45245..69486a5 100644 (file)
@@ -432,7 +432,8 @@ while (0)
 
 #undef DBX_REGISTER_NUMBER
 #define DBX_REGISTER_NUMBER(n) \
-((n) == 0 ? 0 \
+(TARGET_64BIT ? dbx64_register_map[n] \
+ : (n) == 0 ? 0 \
  : (n) == 1 ? 2 \
  : (n) == 2 ? 1 \
  : (n) == 3 ? 3 \
index b5ecd7f..5667c1c 100644 (file)
@@ -353,6 +353,18 @@ int const dbx_register_map[FIRST_PSEUDO_REGISTER] =
   29, 30, 31, 32, 33, 34, 35, 36,       /* MMX */
 };
 
+/* The "default" register map used in 64bit mode.  */
+int const dbx64_register_map[FIRST_PSEUDO_REGISTER] =
+{
+  0, 1, 2, 3, 4, 5, 6, 7,              /* general regs */
+  33, 34, 35, 36, 37, 38, 39, 40       /* fp regs */
+  -1, -1, -1, -1, -1,                  /* arg, flags, fpsr, dir, frame */
+  17, 18, 19, 20, 21, 22, 23, 24,      /* SSE */
+  41, 42, 43, 44, 45, 46, 47, 48,       /* MMX */
+  8,9,10,11,12,13,14,15,               /* extended integer registers */
+  25, 26, 27, 28, 29, 30, 31, 32,      /* extended SSE registers */
+};
+
 /* Define the register numbers to be used in Dwarf debugging information.
    The SVR4 reference port C compiler uses the following register numbers
    in its Dwarf output code:
index e25b497..9afd9da 100644 (file)
@@ -2718,9 +2718,11 @@ number as al, and ax.
 
 /* How to renumber registers for dbx and gdb.  */
 
-#define DBX_REGISTER_NUMBER(n)  dbx_register_map[n]
+#define DBX_REGISTER_NUMBER(n) \
+  (TARGET_64BIT ? dbx64_register_map[n] : dbx_register_map[n])
 
 extern int const dbx_register_map[FIRST_PSEUDO_REGISTER];
+extern int const dbx64_register_map[FIRST_PSEUDO_REGISTER];
 extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
 
 /* Before the prologue, RA is at 0(%esp).  */
@@ -2730,14 +2732,14 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
 /* After the prologue, RA is at -4(AP) in the current frame.  */
 #define RETURN_ADDR_RTX(COUNT, FRAME)                                  \
   ((COUNT) == 0                                                                \
-   ? gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -4))\
-   : gen_rtx_MEM (Pmode, plus_constant (FRAME, 4)))
+   ? gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, TARGET_64BIT ? -8 : -4))\
+   : gen_rtx_MEM (Pmode, plus_constant (FRAME, TARGET_64BIT ? 8 : 4)))
 
 /* PC is dbx register 8; let's use that column for RA. */
-#define DWARF_FRAME_RETURN_COLUMN      8
+#define DWARF_FRAME_RETURN_COLUMN      (TARGET_64BIT ? 16 : 8)
 
 /* Before the prologue, the top of the frame is at 4(%esp).  */
-#define INCOMING_FRAME_SP_OFFSET 4
+#define INCOMING_FRAME_SP_OFFSET UNITS_PER_WORD
 
 /* This is how to output the definition of a user-level label named NAME,
    such as the label on a static function or variable NAME.  */
index 904446a..730761f 100644 (file)
@@ -112,7 +112,8 @@ do { long value[3];                                                 \
   } while (0)
 
 #undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
+#define DBX_REGISTER_NUMBER(n) \
+  (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
 
 /* The routine used to output sequences of byte values.  We use a special
    version of this for most svr4 targets because doing so makes the
index 0ad1c3a..34e416c 100644 (file)
@@ -56,7 +56,8 @@ Boston, MA 02111-1307, USA.  */
 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
 
 #undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
+#define DBX_REGISTER_NUMBER(n) \
+  (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
 
 /* Output assembler code to FILE to call the profiler.
    To the best of my knowledge, no Linux libc has required the label