This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
HP-UX IA64 patch
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Dec 2002 16:25:44 -0800 (PST)
- Subject: HP-UX IA64 patch
- Reply-to: sje at cup dot hp dot com
This is a small patch to ia64_hpux_asm_file_end to correctly handle the
interaction between outputting extern declarations and names that are
specified with a renaming pragma or the asm keyword. I need to strip
the name before calling get_identifier but I should call globalize_label
and assemble_name with the unstripped name, not the stipped one. I also
changed from get_identifier to maybe_get_identifier so I wouldn't create
an entry when none was needed.
This whole routine exists so that I only put out extern statements for
names that are needed and thus don't get spurious undefined errors from
the HP-UX ld for routines declared but never defined or called or
referenced.
This function is only used for IA64 HP-UX and was tested there.
Steve Ellcey
sje@cup.hp.com
2002-12-09 Steve Ellcey <sje@cup.hp.com>
* config/ia64/ia64.c (ia64_hpux_asm_file_end): Don't send stripped
name to globalize_label or assemble_name.
*** gcc.orig/gcc/config/ia64/ia64.c Mon Dec 9 14:45:37 2002
--- gcc/gcc/config/ia64/ia64.c Mon Dec 9 14:47:32 2002
*************** ia64_hpux_asm_file_end (file)
*** 8141,8156 ****
{
while (extern_func_head)
{
! const char *const real_name =
! (* targetm.strip_name_encoding) (extern_func_head->name);
! tree decl = get_identifier (real_name);
! if (decl && ! TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (decl))
{
! TREE_ASM_WRITTEN (decl) = 1;
! (*targetm.asm_out.globalize_label) (file, real_name);
fprintf (file, "%s", TYPE_ASM_OP);
! assemble_name (file, real_name);
putc (',', file);
fprintf (file, TYPE_OPERAND_FMT, "function");
putc ('\n', file);
--- 8141,8159 ----
{
while (extern_func_head)
{
! char *real_name;
! tree decl;
! real_name = (* targetm.strip_name_encoding) (extern_func_head->name);
! tree decl = maybe_get_identifier (real_name);
!
! if (!decl || ! TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (decl))
{
! if (decl)
! TREE_ASM_WRITTEN (decl) = 1;
! (*targetm.asm_out.globalize_label) (file, extern_func_head->name);
fprintf (file, "%s", TYPE_ASM_OP);
! assemble_name (file, extern_func_head->name);
putc (',', file);
fprintf (file, TYPE_OPERAND_FMT, "function");
putc ('\n', file);