This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Remove RS6000_OUTPUT_BASENAME and rs6000 output_mi_thunk fix.
- To: gcc-patches at gcc dot gnu dot org
- Subject: Remove RS6000_OUTPUT_BASENAME and rs6000 output_mi_thunk fix.
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Sun, 28 Oct 2001 16:50:47 -0500
A number of places in the PowerPC port call RS6000_OUTPUT_BASENAME
instead of assemble_name. RS6000_OUTPUT_BASENAME calls
STRIP_NAME_ENCODING and then assemble_name. However, assemble_name calls
STRIP_NAME_ENCODING itself, so RS6000_OUTPUT_BASENAME is redundant.
This patch also adds a missing comma to output_mi_thunk for
AIX_ABI and indents the .comm and .lcomm assembler pseudo-ops.
David
* config/rs6000/aix31.h (ASM_OUTPUT_EXTERNAL): Use assemble_name.
* config/rs6000/darwin.h (RS6000_OUTPUT_BASENAME): Delete.
(ASM_GLOBALIZE_LABEL): Use assemble_name.
(ASM_OUTPUT_COMMON): Likewise.
* config/rs6000/rs6000.c (print_operand): Use assemble_name.
(rs6000_output_function_epilogue): Likewise.
(output_mi_thunk): Fix typo.
(rs6000_output_symbol_ref): Use assemble_name.
(output_toc): Likewise.
* config/rs6000/sysv4.h (RS6000_OUTPUT_BASENAME): Delete.
* config/rs6000/xcoff.h (RS6000_OUTPUT_BASENAME): Delete;
assemble_name calls STRIP_NAME_ENCODING.
(ASM_OUTPUT_LABEL): Use assemble_name.
(ASM_GLOBALIZE_LABEL): Likewise.
(ASM_DECLARE_FUNCTION_NAME): Likewise.
(ASM_OUTPUT_ALIGNED_COMMON): Indent pseudo-op. Use assemble_name.
(ASM_OUTPUT_LOCAL): Likewise.
Index: aix31.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix31.h,v
retrieving revision 1.5
diff -c -p -r1.5 aix31.h
*** aix31.h 2001/01/09 20:46:11 1.5
--- aix31.h 2001/10/28 21:34:14
*************** Boston, MA 02111-1307, USA. */
*** 45,51 ****
if (TREE_CODE (DECL) == FUNCTION_DECL) \
{ \
fputs ("\n\t.extern .", FILE); \
! RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \
} \
putc ('\n', FILE); \
}
--- 45,51 ----
if (TREE_CODE (DECL) == FUNCTION_DECL) \
{ \
fputs ("\n\t.extern .", FILE); \
! assemble_name (FILE, XSTR (_symref, 0)); \
} \
putc ('\n', FILE); \
}
Index: darwin.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/darwin.h,v
retrieving revision 1.8
diff -c -p -r1.8 darwin.h
*** darwin.h 2001/10/16 20:16:45 1.8
--- darwin.h 2001/10/28 21:34:14
*************** Boston, MA 02111-1307, USA. */
*** 79,90 ****
#undef REGISTER_NAMES
#define REGISTER_NAMES DEBUG_REGISTER_NAMES
- /* This outputs NAME to FILE. */
-
- #undef RS6000_OUTPUT_BASENAME
- #define RS6000_OUTPUT_BASENAME(FILE, NAME) \
- assemble_name (FILE, NAME);
-
/* Output before instructions. */
/* 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. */
--- 79,84 ----
*************** Boston, MA 02111-1307, USA. */
*** 98,104 ****
#undef ASM_GLOBALIZE_LABEL
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
do { fputs ("\t.globl ", FILE); \
! RS6000_OUTPUT_BASENAME (FILE, NAME); putc ('\n', FILE);} while (0)
/* This is how to output an internal label prefix. rs6000.c uses this
when generating traceback tables. */
--- 92,98 ----
#undef ASM_GLOBALIZE_LABEL
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
do { fputs ("\t.globl ", FILE); \
! assemble_name (FILE, NAME); putc ('\n', FILE);} while (0)
/* This is how to output an internal label prefix. rs6000.c uses this
when generating traceback tables. */
*************** Boston, MA 02111-1307, USA. */
*** 122,128 ****
#undef ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
do { fputs (".comm ", (FILE)); \
! RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
fprintf ((FILE), ",%d\n", (SIZE)); } while (0)
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
--- 116,122 ----
#undef ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
do { fputs (".comm ", (FILE)); \
! assemble_name ((FILE), (NAME)); \
fprintf ((FILE), ",%d\n", (SIZE)); } while (0)
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.221
diff -c -p -r1.221 rs6000.c
*** rs6000.c 2001/10/28 13:22:01 1.221
--- rs6000.c 2001/10/28 21:34:14
*************** print_operand (file, x, code)
*** 4691,4701 ****
break;
}
}
- #if TARGET_AIX
- RS6000_OUTPUT_BASENAME (file, XSTR (x, 0));
- #else
assemble_name (file, XSTR (x, 0));
- #endif
return;
case 'Z':
--- 4691,4697 ----
*************** rs6000_output_function_epilogue (file, s
*** 7049,7065 ****
/* Offset from start of code to tb table. */
fputs ("\t.long ", file);
ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LT");
- #if TARGET_AIX
- RS6000_OUTPUT_BASENAME (file, fname);
- #else
assemble_name (file, fname);
- #endif
fputs ("-.", file);
- #if TARGET_AIX
- RS6000_OUTPUT_BASENAME (file, fname);
- #else
assemble_name (file, fname);
- #endif
putc ('\n', file);
/* Interrupt handler mask. */
--- 7045,7053 ----
*************** output_mi_thunk (file, thunk_fndecl, del
*** 7230,7236 ****
assemble_name (file, buf);
putc ('\n', file);
text_section ();
! asm_fprintf (file, (TARGET_32BIT) ? "\t{l|lwz} %s," : "\tld %s", r12);
assemble_name (file, buf);
asm_fprintf (file, "(%s)\n", reg_names[2]);
asm_fprintf (file,
--- 7218,7224 ----
assemble_name (file, buf);
putc ('\n', file);
text_section ();
! asm_fprintf (file, (TARGET_32BIT) ? "\t{l|lwz} %s," : "\tld %s,", r12);
assemble_name (file, buf);
asm_fprintf (file, "(%s)\n", reg_names[2]);
asm_fprintf (file,
*************** rs6000_output_symbol_ref (file, x)
*** 7476,7488 ****
we emit the TOC reference to reference the symbol and not the
section. */
const char *name = XSTR (x, 0);
!
! if (VTABLE_NAME_P (name))
! {
! RS6000_OUTPUT_BASENAME (file, name);
! }
! else
! assemble_name (file, name);
}
/* Output a TOC entry. We derive the entry name from what is being
--- 7464,7470 ----
we emit the TOC reference to reference the symbol and not the
section. */
const char *name = XSTR (x, 0);
! assemble_name (file, name);
}
/* Output a TOC entry. We derive the entry name from what is being
*************** output_toc (file, x, labelno, mode)
*** 7715,7721 ****
section. */
if (VTABLE_NAME_P (name))
{
! RS6000_OUTPUT_BASENAME (file, name);
if (offset < 0)
fprintf (file, "%d", offset);
else if (offset > 0)
--- 7697,7703 ----
section. */
if (VTABLE_NAME_P (name))
{
! assemble_name (file, name);
if (offset < 0)
fprintf (file, "%d", offset);
else if (offset > 0)
Index: sysv4.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/sysv4.h,v
retrieving revision 1.64
diff -c -p -r1.64 sysv4.h
*** sysv4.h 2001/10/22 14:43:30 1.64
--- sysv4.h 2001/10/28 21:34:14
*************** do { \
*** 886,896 ****
#undef ENCODE_SECTION_INFO
#define ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
- /* The ELF version doesn't encode [DS] or whatever at the end of symbols. */
-
- #define RS6000_OUTPUT_BASENAME(FILE, NAME) \
- assemble_name (FILE, NAME)
-
/* This macro gets just the user-specified name
out of the string in a SYMBOL_REF. Discard
a leading * or @. */
--- 886,891 ----
Index: xcoff.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/xcoff.h,v
retrieving revision 1.7
diff -c -p -r1.7 xcoff.h
*** xcoff.h 2001/10/22 14:43:30 1.7
--- xcoff.h 2001/10/28 21:34:14
*************** toc_section () \
*** 231,258 ****
#define RS6000_ITRUNC "__itrunc"
#define RS6000_UITRUNC "__uitrunc"
- /* This outputs NAME to FILE up to the first null or '['. */
-
- #define RS6000_OUTPUT_BASENAME(FILE, NAME) \
- { \
- const char *_p; \
- \
- STRIP_NAME_ENCODING (_p, (NAME)); \
- assemble_name ((FILE), _p); \
- }
-
/* 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. */
#define ASM_OUTPUT_LABEL(FILE,NAME) \
! do { RS6000_OUTPUT_BASENAME (FILE, NAME); fputs (":\n", FILE); } while (0)
/* This is how to output a command to make the user-level label named NAME
defined for reference from other files. */
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
do { fputs ("\t.globl ", FILE); \
! RS6000_OUTPUT_BASENAME (FILE, NAME); putc ('\n', FILE);} while (0)
/* Remove any trailing [DS] or the like from the symbol name. */
--- 231,248 ----
#define RS6000_ITRUNC "__itrunc"
#define RS6000_UITRUNC "__uitrunc"
/* 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. */
#define ASM_OUTPUT_LABEL(FILE,NAME) \
! do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
/* This is how to output a command to make the user-level label named NAME
defined for reference from other files. */
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
do { fputs ("\t.globl ", FILE); \
! assemble_name (FILE, NAME); putc ('\n', FILE);} while (0)
/* Remove any trailing [DS] or the like from the symbol name. */
*************** toc_section () \
*** 343,369 ****
if (TREE_PUBLIC (DECL)) \
{ \
fputs ("\t.globl .", FILE); \
! RS6000_OUTPUT_BASENAME (FILE, NAME); \
putc ('\n', FILE); \
} \
else \
{ \
fputs ("\t.lglobl .", FILE); \
! RS6000_OUTPUT_BASENAME (FILE, NAME); \
putc ('\n', FILE); \
} \
fputs ("\t.csect ", FILE); \
! RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \
! RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (":\n", FILE); \
fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \
! RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (", TOC[tc0], 0\n", FILE); \
in_section = no_section; \
function_section(DECL); \
putc ('.', FILE); \
! RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (":\n", FILE); \
if (write_symbols == XCOFF_DEBUG) \
xcoffout_declare_function (FILE, DECL, NAME); \
--- 333,359 ----
if (TREE_PUBLIC (DECL)) \
{ \
fputs ("\t.globl .", FILE); \
! assemble_name (FILE, NAME); \
putc ('\n', FILE); \
} \
else \
{ \
fputs ("\t.lglobl .", FILE); \
! assemble_name (FILE, NAME); \
putc ('\n', FILE); \
} \
fputs ("\t.csect ", FILE); \
! assemble_name (FILE, NAME); \
fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \
! assemble_name (FILE, NAME); \
fputs (":\n", FILE); \
fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \
! assemble_name (FILE, NAME); \
fputs (", TOC[tc0], 0\n", FILE); \
in_section = no_section; \
function_section(DECL); \
putc ('.', FILE); \
! assemble_name (FILE, NAME); \
fputs (":\n", FILE); \
if (write_symbols == XCOFF_DEBUG) \
xcoffout_declare_function (FILE, DECL, NAME); \
*************** toc_section () \
*** 430,437 ****
to define a global common symbol. */
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGNMENT) \
! do { fputs (".comm ", (FILE)); \
! RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
if ( (SIZE) > 4) \
fprintf ((FILE), ",%d,3\n", (SIZE)); \
else \
--- 420,427 ----
to define a global common symbol. */
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGNMENT) \
! do { fputs ("\t.comm ", (FILE)); \
! assemble_name ((FILE), (NAME)); \
if ( (SIZE) > 4) \
fprintf ((FILE), ",%d,3\n", (SIZE)); \
else \
*************** toc_section () \
*** 448,455 ****
for 64-bit mode. */
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
! do { fputs (".lcomm ", (FILE)); \
! RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
fprintf ((FILE), ",%d,%s\n", (TARGET_32BIT ? (SIZE) : (ROUNDED)), \
xcoff_bss_section_name); \
} while (0)
--- 438,445 ----
for 64-bit mode. */
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
! do { fputs ("\t.lcomm ", (FILE)); \
! assemble_name ((FILE), (NAME)); \
fprintf ((FILE), ",%d,%s\n", (TARGET_32BIT ? (SIZE) : (ROUNDED)), \
xcoff_bss_section_name); \
} while (0)