From 0f7fa3d01f482328963c1bbfcd1ab64a42531c42 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 10 Mar 2001 14:36:26 +0100 Subject: i386.h (DBX_REGISTER_NUMBER): Return proper values for 64bits. * 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. From-SVN: r40365 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/i386/beos-elf.h | 3 ++- gcc/config/i386/freebsd.h | 3 ++- gcc/config/i386/i386-interix.h | 3 ++- gcc/config/i386/i386.c | 12 ++++++++++++ gcc/config/i386/i386.h | 12 +++++++----- gcc/config/i386/i386elf.h | 3 ++- gcc/config/i386/linux.h | 3 ++- 8 files changed, 41 insertions(+), 10 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 43a6ffe..0598574 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +Sat Mar 10 14:34:59 CET 2001 Jan Hubicka + + * 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 * cppfiles.c (search_from): Use lbasename. diff --git a/gcc/config/i386/beos-elf.h b/gcc/config/i386/beos-elf.h index 0ac148b..5b980b6 100644 --- a/gcc/config/i386/beos-elf.h +++ b/gcc/config/i386/beos-elf.h @@ -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. */ diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h index ebd337a..6ae6235 100644 --- a/gcc/config/i386/freebsd.h +++ b/gcc/config/i386/freebsd.h @@ -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 diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h index aa45245..69486a5 100644 --- a/gcc/config/i386/i386-interix.h +++ b/gcc/config/i386/i386-interix.h @@ -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 \ diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b5ecd7f..5667c1c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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: diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index e25b497..9afd9da 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -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. */ diff --git a/gcc/config/i386/i386elf.h b/gcc/config/i386/i386elf.h index 904446a..730761f 100644 --- a/gcc/config/i386/i386elf.h +++ b/gcc/config/i386/i386elf.h @@ -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 diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index 0ad1c3a..34e416c 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -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 -- cgit v1.1