rtl.def (CODE_LABEL): Remove slot 8.
* rtl.def (CODE_LABEL): Remove slot 8. * rtl.h (struct rtx_def): Document new uses of jump and call fields. (LABEL_ALTERNATE_NAME): Delete. (LABEL_KIND, SET_LABEL_KIND, LABEL_ALT_ENTRY_P): New. * defaults.h: Remove default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. * final.c (output_alternate_entry_point): New. (final_scan_insn): Use it instead of ASM_OUTPUT_ALTERNATE_LABEL_NAME. Do not consider possibility of a case label being an alternate entry point. * cfgbuild.c (make_edges, find_bb_boundaries): Use LABEL_ALT_ENTRY_P. * emit-rtl.c (gen_label_rtx): Adjust call to gen_rtx_CODE_LABEL. Do not clear LABEL_NUSES (unnecessary) or LABEL_ALTERNATE_NAME (field deleted). * print-rtl.c, ra-debug.c: Update code to output CODE_LABELs. * doc/rtl.texi: Document LABEL_KIND, SET_LABEL_KIND, and LABEL_ALT_ENTRY_P; not LABEL_ALTERNATE_NAME. * doc/tm.texi: Delete documentation of ASM_OUTPUT_ALTERNATE_LABEL_NAME. From-SVN: r55597
This commit is contained in:
parent
59267987db
commit
0dc36574af
11 changed files with 158 additions and 51 deletions
|
@ -1,3 +1,27 @@
|
|||
2002-07-19 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
* rtl.def (CODE_LABEL): Remove slot 8.
|
||||
* rtl.h (struct rtx_def): Document new uses of jump and call fields.
|
||||
(LABEL_ALTERNATE_NAME): Delete.
|
||||
(LABEL_KIND, SET_LABEL_KIND, LABEL_ALT_ENTRY_P): New.
|
||||
* defaults.h: Remove default for ASM_OUTPUT_ALTERNATE_LABEL_NAME.
|
||||
|
||||
* final.c (output_alternate_entry_point): New.
|
||||
(final_scan_insn): Use it instead of
|
||||
ASM_OUTPUT_ALTERNATE_LABEL_NAME. Do not consider possibility
|
||||
of a case label being an alternate entry point.
|
||||
|
||||
* cfgbuild.c (make_edges, find_bb_boundaries): Use LABEL_ALT_ENTRY_P.
|
||||
* emit-rtl.c (gen_label_rtx): Adjust call to gen_rtx_CODE_LABEL.
|
||||
Do not clear LABEL_NUSES (unnecessary) or LABEL_ALTERNATE_NAME
|
||||
(field deleted).
|
||||
* print-rtl.c, ra-debug.c: Update code to output CODE_LABELs.
|
||||
|
||||
* doc/rtl.texi: Document LABEL_KIND, SET_LABEL_KIND, and
|
||||
LABEL_ALT_ENTRY_P; not LABEL_ALTERNATE_NAME.
|
||||
* doc/tm.texi: Delete documentation of
|
||||
ASM_OUTPUT_ALTERNATE_LABEL_NAME.
|
||||
|
||||
2002-07-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
|
||||
|
||||
* config/mips/iris5gas.h (DWARF2_DEBUGGING_INFO): Define.
|
||||
|
|
|
@ -321,7 +321,7 @@ make_edges (label_value_list, min, max, update_p)
|
|||
enum rtx_code code;
|
||||
int force_fallthru = 0;
|
||||
|
||||
if (GET_CODE (bb->head) == CODE_LABEL && LABEL_ALTERNATE_NAME (bb->head))
|
||||
if (GET_CODE (bb->head) == CODE_LABEL && LABEL_ALT_ENTRY_P (bb->head))
|
||||
cached_make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);
|
||||
|
||||
/* Examine the last instruction of the block, and discover the
|
||||
|
@ -699,7 +699,7 @@ find_bb_boundaries (bb)
|
|||
bb = fallthru->dest;
|
||||
remove_edge (fallthru);
|
||||
flow_transfer_insn = NULL_RTX;
|
||||
if (LABEL_ALTERNATE_NAME (insn))
|
||||
if (LABEL_ALT_ENTRY_P (insn))
|
||||
make_edge (ENTRY_BLOCK_PTR, bb, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,12 +80,6 @@ do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
|
|||
} while (0)
|
||||
#endif
|
||||
|
||||
/* Provide default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. */
|
||||
#ifndef ASM_OUTPUT_ALTERNATE_LABEL_NAME
|
||||
#define ASM_OUTPUT_ALTERNATE_LABEL_NAME(FILE,INSN) \
|
||||
do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
|
||||
#endif
|
||||
|
||||
/* choose a reasonable default for ASM_OUTPUT_ASCII. */
|
||||
|
||||
#ifndef ASM_OUTPUT_ASCII
|
||||
|
|
|
@ -2830,13 +2830,32 @@ Besides as a @code{code_label}, a label can also be represented as a
|
|||
|
||||
@findex LABEL_NUSES
|
||||
The field @code{LABEL_NUSES} is only defined once the jump optimization
|
||||
phase is completed and contains the number of times this label is
|
||||
phase is completed. It contains the number of times this label is
|
||||
referenced in the current function.
|
||||
|
||||
@findex LABEL_ALTERNATE_NAME
|
||||
The field @code{LABEL_ALTERNATE_NAME} is used to associate a name with
|
||||
a @code{code_label}. If this field is defined, the alternate name will
|
||||
be emitted instead of an internally generated label name.
|
||||
@findex LABEL_KIND
|
||||
@findex SET_LABEL_KIND
|
||||
@findex LABEL_ALT_ENTRY_P
|
||||
@cindex alternate entry points
|
||||
The field @code{LABEL_KIND} differentiates four different types of
|
||||
labels: @code{LABEL_NORMAL}, @code{LABEL_STATIC_ENTRY},
|
||||
@code{LABEL_GLOBAL_ENTRY}, and @code{LABEL_WEAK_ENTRY}. The only labels
|
||||
that do not have type @code{LABEL_NORMAL} are @dfn{alternate entry
|
||||
points} to the current function. These may be static (visible only in
|
||||
the containing translation unit), global (exposed to all translation
|
||||
units), or weak (global, but can be overriden by another symbol with the
|
||||
same name).
|
||||
|
||||
Much of the compiler treats all four kinds of label identically. Some
|
||||
of it needs to know whether or not a label is an alternate entry point;
|
||||
for this purpose, the macro @code{LABEL_ALT_ENTRY_P} is provided. It is
|
||||
equivalent to testing whether @samp{LABEL_KIND (label) == LABEL_NORMAL}.
|
||||
The only place that cares about the distinction between static, global,
|
||||
and weak alternate entry points, besides the front-end code that creates
|
||||
them, is the function @code{output_alternate_entry_point}, in
|
||||
@file{final.c}.
|
||||
|
||||
To set the kind of a label, use the @code{SET_LABEL_KIND} macro.
|
||||
|
||||
@findex barrier
|
||||
@item barrier
|
||||
|
|
|
@ -6597,17 +6597,6 @@ bundles.
|
|||
If this macro is not defined, then @code{ASM_OUTPUT_INTERNAL_LABEL} will be
|
||||
used.
|
||||
|
||||
@findex ASM_OUTPUT_ALTERNATE_LABEL_NAME
|
||||
@item ASM_OUTPUT_ALTERNATE_LABEL_NAME (@var{stream}, @var{string})
|
||||
A C statement to output to the stdio stream @var{stream} the string
|
||||
@var{string}.
|
||||
|
||||
The default definition of this macro is as follows:
|
||||
|
||||
@example
|
||||
fprintf (@var{stream}, "%s:\n", LABEL_ALTERNATE_NAME (INSN))
|
||||
@end example
|
||||
|
||||
@findex ASM_GENERATE_INTERNAL_LABEL
|
||||
@item ASM_GENERATE_INTERNAL_LABEL (@var{string}, @var{prefix}, @var{num})
|
||||
A C statement to store into the string @var{string} a label whose name
|
||||
|
|
|
@ -2185,14 +2185,8 @@ widen_memory_access (memref, mode, offset)
|
|||
rtx
|
||||
gen_label_rtx ()
|
||||
{
|
||||
rtx label;
|
||||
|
||||
label = gen_rtx_CODE_LABEL (VOIDmode, 0, NULL_RTX, NULL_RTX,
|
||||
NULL, label_num++, NULL, NULL);
|
||||
|
||||
LABEL_NUSES (label) = 0;
|
||||
LABEL_ALTERNATE_NAME (label) = NULL;
|
||||
return label;
|
||||
return gen_rtx_CODE_LABEL (VOIDmode, 0, NULL_RTX, NULL_RTX,
|
||||
NULL, label_num++, NULL);
|
||||
}
|
||||
|
||||
/* For procedure integration. */
|
||||
|
|
39
gcc/final.c
39
gcc/final.c
|
@ -222,6 +222,7 @@ static void profile_after_prologue PARAMS ((FILE *));
|
|||
static void notice_source_line PARAMS ((rtx));
|
||||
static rtx walk_alter_subreg PARAMS ((rtx *));
|
||||
static void output_asm_name PARAMS ((void));
|
||||
static void output_alternate_entry_point PARAMS ((FILE *, rtx));
|
||||
static tree get_mem_expr_from_op PARAMS ((rtx, int *));
|
||||
static void output_asm_operand_names PARAMS ((rtx *, int *, int));
|
||||
static void output_operand PARAMS ((rtx, int));
|
||||
|
@ -1952,6 +1953,37 @@ get_insn_template (code, insn)
|
|||
}
|
||||
}
|
||||
|
||||
/* Emit the appropriate declaration for an alternate-entry-point
|
||||
symbol represented by INSN, to FILE. INSN is a CODE_LABEL with
|
||||
LABEL_KIND != LABEL_NORMAL.
|
||||
|
||||
The case fall-through in this function is intentional. */
|
||||
static void
|
||||
output_alternate_entry_point (file, insn)
|
||||
FILE *file;
|
||||
rtx insn;
|
||||
{
|
||||
const char *name = LABEL_NAME (insn);
|
||||
|
||||
switch (LABEL_KIND (insn))
|
||||
{
|
||||
case LABEL_WEAK_ENTRY:
|
||||
#ifdef ASM_WEAKEN_LABEL
|
||||
ASM_WEAKEN_LABEL (file, name);
|
||||
#endif
|
||||
case LABEL_GLOBAL_ENTRY:
|
||||
ASM_GLOBALIZE_LABEL (file, name);
|
||||
case LABEL_STATIC_ENTRY:
|
||||
/* FIXME output a .type directive here if appropriate. */
|
||||
ASM_OUTPUT_LABEL (file, name);
|
||||
break;
|
||||
|
||||
case LABEL_NORMAL:
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
/* The final scan for one insn, INSN.
|
||||
Args are same as in `final', except that INSN
|
||||
is the insn being scanned.
|
||||
|
@ -2242,17 +2274,14 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
|
|||
ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
|
||||
NEXT_INSN (insn));
|
||||
#else
|
||||
if (LABEL_ALTERNATE_NAME (insn))
|
||||
ASM_OUTPUT_ALTERNATE_LABEL_NAME (file, insn);
|
||||
else
|
||||
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (LABEL_ALTERNATE_NAME (insn))
|
||||
ASM_OUTPUT_ALTERNATE_LABEL_NAME (file, insn);
|
||||
if (LABEL_ALT_ENTRY_P (insn))
|
||||
output_alternate_entry_point (file, insn);
|
||||
else
|
||||
ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
|
||||
break;
|
||||
|
|
|
@ -526,9 +526,14 @@ print_rtx (in_rtx)
|
|||
|
||||
case CODE_LABEL:
|
||||
fprintf (outfile, " [%d uses]", LABEL_NUSES (in_rtx));
|
||||
if (LABEL_ALTERNATE_NAME (in_rtx))
|
||||
fprintf (outfile, " [alternate name: %s]",
|
||||
LABEL_ALTERNATE_NAME (in_rtx));
|
||||
switch (LABEL_KIND (in_rtx))
|
||||
{
|
||||
case LABEL_NORMAL: break;
|
||||
case LABEL_STATIC_ENTRY: fputs (" [entry]", outfile); break;
|
||||
case LABEL_GLOBAL_ENTRY: fputs (" [global entry]", outfile); break;
|
||||
case LABEL_WEAK_ENTRY: fputs (" [weak entry]", outfile); break;
|
||||
default: abort();
|
||||
}
|
||||
break;
|
||||
|
||||
case CALL_PLACEHOLDER:
|
||||
|
|
|
@ -381,8 +381,14 @@ ra_print_rtx (file, x, with_pn)
|
|||
fprintf (file, "L%d:\t; ", CODE_LABEL_NUMBER (x));
|
||||
if (LABEL_NAME (x))
|
||||
fprintf (file, "(%s) ", LABEL_NAME (x));
|
||||
if (LABEL_ALTERNATE_NAME (x))
|
||||
fprintf (file, "(alternate: %s) ", LABEL_ALTERNATE_NAME (x));
|
||||
switch (LABEL_KIND (x))
|
||||
{
|
||||
case LABEL_NORMAL: break;
|
||||
case LABEL_STATIC_ENTRY: fputs (" (entry)", file); break;
|
||||
case LABEL_GLOBAL_ENTRY: fputs (" (global entry)", file); break;
|
||||
case LABEL_WEAK_ENTRY: fputs (" (weak entry)", file); break;
|
||||
default: abort();
|
||||
}
|
||||
fprintf (file, " [%d uses] uid=(", LABEL_NUSES (x));
|
||||
}
|
||||
fprintf (file, "%d", INSN_UID (x));
|
||||
|
|
|
@ -573,9 +573,8 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu", 'x')
|
|||
4: is used in jump.c for the use-count of the label.
|
||||
5: is used in flow.c to point to the chain of label_ref's to this label.
|
||||
6: is a number that is unique in the entire compilation.
|
||||
7: is the user-given name of the label, if any.
|
||||
8: is the alternate label name. */
|
||||
DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00iss", 'x')
|
||||
7: is the user-given name of the label, if any. */
|
||||
DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00is", 'x')
|
||||
|
||||
/* Say where in the code a source line starts, for symbol table's sake.
|
||||
Operand:
|
||||
|
|
56
gcc/rtl.h
56
gcc/rtl.h
|
@ -130,9 +130,10 @@ struct rtx_def
|
|||
/* 1 in a MEM if we should keep the alias set for this mem unchanged
|
||||
when we access a component.
|
||||
1 in a CALL_INSN if it is a sibling call.
|
||||
1 in a SET that is for a return. */
|
||||
1 in a SET that is for a return.
|
||||
In a CODE_LABEL, part of the two-bit alternate entry field. */
|
||||
unsigned int jump : 1;
|
||||
/* This flag is currently unused. */
|
||||
/* In a CODE_LABEL, part of the two-bit alternate entry field. */
|
||||
unsigned int call : 1;
|
||||
/* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere.
|
||||
1 in a SUBREG if it references an unsigned object whose mode has been
|
||||
|
@ -876,8 +877,55 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
|
|||
of LABEL_REFs that point at it, so unused labels can be deleted. */
|
||||
#define LABEL_NUSES(RTX) XCINT (RTX, 4, CODE_LABEL)
|
||||
|
||||
/* Associate a name with a CODE_LABEL. */
|
||||
#define LABEL_ALTERNATE_NAME(RTX) XCSTR (RTX, 8, CODE_LABEL)
|
||||
/* Labels carry a two-bit field composed of the ->jump and ->call
|
||||
bits. This field indicates whether the label is an alternate
|
||||
entry point, and if so, what kind. */
|
||||
enum label_kind
|
||||
{
|
||||
LABEL_NORMAL = 0, /* ordinary label */
|
||||
LABEL_STATIC_ENTRY, /* alternate entry point, not exported */
|
||||
LABEL_GLOBAL_ENTRY, /* alternate entry point, exported */
|
||||
LABEL_WEAK_ENTRY /* alternate entry point, exported as weak symbol */
|
||||
};
|
||||
|
||||
#if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION > 2007)
|
||||
|
||||
/* Retrieve the kind of LABEL. */
|
||||
#define LABEL_KIND(LABEL) __extension__ \
|
||||
({ rtx const _label = (LABEL); \
|
||||
if (GET_CODE (_label) != CODE_LABEL) \
|
||||
rtl_check_failed_flag ("LABEL_KIND", _label, __FILE__, __LINE__, \
|
||||
__FUNCTION__); \
|
||||
(enum label_kind) ((_label->jump << 1) | _label->call); })
|
||||
|
||||
/* Set the kind of LABEL. */
|
||||
#define SET_LABEL_KIND(LABEL, KIND) do { \
|
||||
rtx _label = (LABEL); \
|
||||
unsigned int _kind = (KIND); \
|
||||
if (GET_CODE (_label) != CODE_LABEL) \
|
||||
rtl_check_failed_flag ("SET_LABEL_KIND", _label, __FILE__, __LINE__, \
|
||||
__FUNCTION__); \
|
||||
_label->jump = ((_kind >> 1) & 1); \
|
||||
_label->call = (_kind & 1); \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
/* Retrieve the kind of LABEL. */
|
||||
#define LABEL_KIND(LABEL) \
|
||||
((enum label_kind) (((LABEL)->jump << 1) | (LABEL)->call))
|
||||
|
||||
/* Set the kind of LABEL. */
|
||||
#define SET_LABEL_KIND(LABEL, KIND) do { \
|
||||
rtx _label = (LABEL); \
|
||||
unsigned int _kind = (KIND); \
|
||||
_label->jump = ((_kind >> 1) & 1); \
|
||||
_label->call = (_kind & 1); \
|
||||
} while (0)
|
||||
|
||||
#endif /* rtl flag checking */
|
||||
|
||||
#define LABEL_ALT_ENTRY_P(LABEL) (LABEL_KIND (LABEL) != LABEL_NORMAL)
|
||||
|
||||
/* The original regno this ADDRESSOF was built for. */
|
||||
#define ADDRESSOF_REGNO(RTX) XCUINT (RTX, 1, ADDRESSOF)
|
||||
|
|
Loading…
Add table
Reference in a new issue