* defaults.h silliness
@ 2005-06-24 0:12 Mike Stump
2005-07-02 2:23 ` James E Wilson
0 siblings, 1 reply; 2+ messages in thread
From: Mike Stump @ 2005-06-24 0:12 UTC (permalink / raw)
To: GCC Development
In defaults.h, they do:
/* 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 / BITS_PER_UNIT, TRUE),
FILE); \
(*targetm.asm_out.internal_label) (FILE, "L",
(VALUE)); \
fputc ('\n',
FILE); \
} while (0)
#endif
but internal_label is used to output a definition of a label, and
ASM_OUTPUT_ADDR_VEC_ELT is supposed to output a mere use of the label.
s390.h has a more suitable default definition:
/* Output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE,
VALUE) \
do
{ \
char buf
[32]; \
fputs (integer_asm_op (UNITS_PER_WORD, TRUE),
(FILE)); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L",
(VALUE)); \
assemble_name ((FILE),
buf); \
fputc ('\n',
(FILE)); \
} while (0)
:-( Having defaults that no one can use, is silly?!
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: defaults.h silliness
2005-06-24 0:12 defaults.h silliness Mike Stump
@ 2005-07-02 2:23 ` James E Wilson
0 siblings, 0 replies; 2+ messages in thread
From: James E Wilson @ 2005-07-02 2:23 UTC (permalink / raw)
To: Mike Stump; +Cc: gcc
Mike Stump wrote:
> In defaults.h, they do:
> /* 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) \
This was added before gcc-2.3.3. At the time, it was added because we
had an unconditional use of ASM_OUTPUT_ADDR_VEC_ELT. An ifdef was added
a month later, and ever since, this code has been unnecessary.
This code has always been wrong, and was never really meant to be used.
There are so many different ways or emitting case labels that I'm not
convinced that having a default definition makes sense.
Originally, there were definitions for both ASM_OUTPUT_ADDR_VEC_ELT and
ASM_OUTPUT_ADDR_DIFF_VEC_ELT. Joern deleted the
ASM_OUTPUT_ADDR_DIFF_VEC_ELT default definition in March 1996. I think
the ASM_OUTPUT_ADDR_VEC_ELT one should go too. Also, we can clean up
some backends that define it unnecessarily. The Alpha port for instance
defines it to call gcc_unreachable, which is redundant if the defaults.h
definition is deleted.
Want to submit a patch, or file a bug report?
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-07-02 2:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-24 0:12 defaults.h silliness Mike Stump
2005-07-02 2:23 ` James E Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).