This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ASM_OUTPUT_ADDR_VEC_ELT


Hi,
I've noticed that the default definition of ASM_OUTPUT_ADDR_VEC_ELT is
broken,

/* This is how to output an element of a case-vector that is absolute.
   Some targets don't use this, but we have to define it anyway.  */

#ifndef ASM_OUTPUT_ADDR_VEC_ELT
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
     (*targetm.asm_out.internal_label) (FILE, "L", (VALUE));		\
     fputc ('\n', FILE);						\
   } while (0)
#endif

Problem 1. It should be POINTER_SIZE / BITS_PER_UNIT.
Problem 2. It shold not be using *targetm.asm_out.internal_label, as
that is outputting a label definition.

#1 is trivial, it is the best way to fix #2 that is not obvious, because
there is no *targetm.asm_out.internal_label_ref hook.

As this macro is so broken, there cannot be any ports that actually
use the default definition, so is it best to
#1 leave it undefined (there is a check in final.c for its exisitence)
#2 create an internal_label_ref hook and use it?

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]