From: Alan Modra Date: Sat, 14 Sep 2002 00:26:39 +0000 (+0000) Subject: backport: tm.texi (DBX_OUTPUT_NFUN): Describe. X-Git-Tag: releases/gcc-3.2.1~281 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37d2be3e482311bdceaca5a9661c5783956a37d4;p=thirdparty%2Fgcc.git backport: tm.texi (DBX_OUTPUT_NFUN): Describe. Merge from mainline. 2002-09-14 Alan Modra * doc/tm.texi (DBX_OUTPUT_NFUN): Describe. * dbxout.c (dbxout_function_end): Use DBX_OUTPUT_NFUN. * config/rs6000/linux64.h (DBX_OUTPUT_NFUN): Define. 2002-08-27 David Edelsohn * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Undef before define. 2002-08-02 Alan Modra * config/rs6000/linux64.h (DBX_OUTPUT_BRAC): Define. (DBX_OUTPUT_LBRAC, DBX_OUTPUT_RBRAC): Define. * config/rs6000/rs6000.c (output_toc): Don't use lshift_double when HOST_BITS_PER_WIDE_INT == 64. 2002-07-27 Alan Modra * config/rs6000/rs6000.c (output_profile_hook): Don't generate profile label reference when NO_PROFILE_COUNTERS. 2002-07-11 Alan Modra * config/rs6000/linux64.h (ASM_SPEC): Define. From-SVN: r57124 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aa7900e36bd6..dacf58124ac6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,27 @@ +2002-09-14 Alan Modra + + Merge from mainline. + 2002-09-14 Alan Modra + * doc/tm.texi (DBX_OUTPUT_NFUN): Describe. + * dbxout.c (dbxout_function_end): Use DBX_OUTPUT_NFUN. + * config/rs6000/linux64.h (DBX_OUTPUT_NFUN): Define. + + 2002-08-27 David Edelsohn + * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Undef before define. + + 2002-08-02 Alan Modra + * config/rs6000/linux64.h (DBX_OUTPUT_BRAC): Define. + (DBX_OUTPUT_LBRAC, DBX_OUTPUT_RBRAC): Define. + * config/rs6000/rs6000.c (output_toc): Don't use lshift_double when + HOST_BITS_PER_WIDE_INT == 64. + + 2002-07-27 Alan Modra + * config/rs6000/rs6000.c (output_profile_hook): Don't generate profile + label reference when NO_PROFILE_COUNTERS. + + 2002-07-11 Alan Modra + * config/rs6000/linux64.h (ASM_SPEC): Define. + 2002-09-13 Alan Modra Merge from mainline. diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 6669a8c9e06f..ce8f7ac91c47 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -37,6 +37,12 @@ Boston, MA 02111-1307, USA. */ #undef ASM_DEFAULT_SPEC #define ASM_DEFAULT_SPEC "-mppc64" +#undef ASM_SPEC +#define ASM_SPEC "%{.s: %{mregnames} %{mno-regnames}} \ +%{.S: %{mregnames} %{mno-regnames}} \ +%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \ +%{v:-V} %{Qy:} %{!Qn:-Qy} -a64 %(asm_cpu) %{Wa,*:%*}" + /* 64-bit PowerPC Linux always has a TOC. */ #undef TARGET_NO_TOC #define TARGET_NO_TOC 0 @@ -65,6 +71,7 @@ Boston, MA 02111-1307, USA. */ #define USER_LABEL_PREFIX "" /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */ +#undef ADJUST_FIELD_ALIGN #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \ ? get_inner_array_type (FIELD) \ @@ -328,6 +335,41 @@ do \ } \ while (0) +/* Similarly, we want the function code label here. */ +#define DBX_OUTPUT_BRAC(FILE, NAME, BRAC) \ + do \ + { \ + const char *flab; \ + fprintf (FILE, "%s%d,0,0,", ASM_STABN_OP, BRAC); \ + assemble_name (FILE, NAME); \ + putc ('-', FILE); \ + if (current_function_func_begin_label != NULL_TREE) \ + flab = IDENTIFIER_POINTER (current_function_func_begin_label); \ + else \ + { \ + putc ('.', FILE); \ + flab = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \ + } \ + assemble_name (FILE, flab); \ + putc ('\n', FILE); \ + } \ + while (0) + +#define DBX_OUTPUT_LBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_LBRAC) +#define DBX_OUTPUT_RBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_RBRAC) + +/* Another case where we want the dot name. */ +#define DBX_OUTPUT_NFUN(FILE, LSCOPE, DECL) \ + do \ + { \ + fprintf (FILE, "%s\"\",%d,0,0,", ASM_STABS_OP, N_FUN); \ + assemble_name (FILE, LSCOPE); \ + fputs ("-.", FILE); \ + assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0)); \ + putc ('\n', FILE); \ + } \ + while (0) + /* Override sysv4.h as these are ABI_V4 only. */ #undef ASM_OUTPUT_REG_PUSH #undef ASM_OUTPUT_REG_POP diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 287f8ffbb778..ad9df44dbc88 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -10100,8 +10100,17 @@ output_toc (file, x, labelno, mode) abort ();/* It would be easy to make this work, but it doesn't now. */ if (POINTER_SIZE > GET_MODE_BITSIZE (mode)) - lshift_double (low, high, POINTER_SIZE - GET_MODE_BITSIZE (mode), - POINTER_SIZE, &low, &high, 0); + { +#if HOST_BITS_PER_WIDE_INT == 32 + lshift_double (low, high, POINTER_SIZE - GET_MODE_BITSIZE (mode), + POINTER_SIZE, &low, &high, 0); +#else + low |= high << 32; + low <<= POINTER_SIZE - GET_MODE_BITSIZE (mode); + high = (HOST_WIDE_INT) low >> 32; + low &= 0xffffffff; +#endif + } if (TARGET_64BIT) { @@ -10319,10 +10328,13 @@ rs6000_gen_section_name (buf, filename, section_desc) void output_profile_hook (labelno) - int labelno; + int labelno ATTRIBUTE_UNUSED; { if (DEFAULT_ABI == ABI_AIX) { +#ifdef NO_PROFILE_COUNTERS + emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 0); +#else char buf[30]; const char *label_name; rtx fun; @@ -10333,6 +10345,7 @@ output_profile_hook (labelno) emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1, fun, Pmode); +#endif } else if (DEFAULT_ABI == ABI_DARWIN) { diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 139286591f98..d2ae7fba27a3 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -396,11 +396,15 @@ dbxout_function_end () /* By convention, GCC will mark the end of a function with an N_FUN symbol and an empty string. */ +#ifdef DBX_OUTPUT_NFUN + DBX_OUTPUT_NFUN (asmfile, lscope_label_name, current_function_decl); +#else fprintf (asmfile, "%s\"\",%d,0,0,", ASM_STABS_OP, N_FUN); assemble_name (asmfile, lscope_label_name); putc ('-', asmfile); assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); fprintf (asmfile, "\n"); +#endif } #endif /* DBX_DEBUGGING_INFO */ diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 8451e3e0f39d..d8821c5467ca 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -7423,6 +7423,11 @@ argument @var{name} is the name of an assembler symbol (for use with @item DBX_OUTPUT_RBRAC (@var{stream}, @var{name}) Like @code{DBX_OUTPUT_LBRAC}, but for the end of a scope level. +@findex DBX_OUTPUT_NFUN +@item DBX_OUTPUT_NFUN (@var{stream}, @var{lscope_label}, @var{decl}) +Define this macro if the target machine requires special handling to +output an @code{N_FUN} entry for the function @var{decl}. + @findex DBX_OUTPUT_ENUM @item DBX_OUTPUT_ENUM (@var{stream}, @var{type}) Define this macro if the target machine requires special handling to