summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclm <clm@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-03 21:55:51 +0000
committerclm <clm@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-03 21:55:51 +0000
commitbfee5366682048696e3c2a1f699ca043082c17eb (patch)
tree32aab0337e74b85506bcda9eeeb36643fbe27d83
parent5c035e5d28855fd91b3b7e1d1d04f02181a08006 (diff)
downloadgcc-bfee5366682048696e3c2a1f699ca043082c17eb.tar.gz
* defaults.h (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Provide default.
* emit-rtl.c (gen_label_rtx): Support LABEL_ALTERNATE_NAME. * final.c (final_scan_insn): Emit LABEL_ALTERNATE_NAME. * ggc-common.c (ggc_mark_rtx_children): Mark LABEL_ALTERNATE_NAME. * jump.c (delete_unreferenced_labels): Don't delete if LABEL_ALTERNATE_NAME is set. * print-rtl.c (print_rtx): Dump alternate name. * rtl.def (CODE_LABEL): Change format to "iuuis00s". * rtl.h (LABEL_ALTERNATE_NAME): Define. * rtl.texi (LABEL_ALTERNATE_NAME): Document. * tm.texi (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Document. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30382 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/defaults.h6
-rw-r--r--gcc/emit-rtl.c3
-rw-r--r--gcc/final.c11
-rw-r--r--gcc/ggc-common.c1
-rw-r--r--gcc/jump.c4
-rw-r--r--gcc/print-rtl.c6
-rw-r--r--gcc/rtl.def5
-rw-r--r--gcc/rtl.h3
-rw-r--r--gcc/rtl.texi5
-rw-r--r--gcc/tm.texi11
11 files changed, 61 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ef65f933b43..f66c452b76c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+Wed Nov 3 15:40:23 1999 Catherine Moore <clm@cygnus.com>
+
+ * defaults.h (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Provide default.
+ * emit-rtl.c (gen_label_rtx): Support LABEL_ALTERNATE_NAME.
+ * final.c (final_scan_insn): Emit LABEL_ALTERNATE_NAME.
+ * ggc-common.c (ggc_mark_rtx_children): Mark LABEL_ALTERNATE_NAME.
+ * jump.c (delete_unreferenced_labels): Don't delete if
+ LABEL_ALTERNATE_NAME is set.
+ * print-rtl.c (print_rtx): Dump alternate name.
+ * rtl.def (CODE_LABEL): Change format to "iuuis00s".
+ * rtl.h (LABEL_ALTERNATE_NAME): Define.
+ * rtl.texi (LABEL_ALTERNATE_NAME): Document.
+ * tm.texi (ASM_OUTPUT_ALTERNATE_LABEL_NAME): Document.
+
Wed Nov 3 15:39:19 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fix-header.c (recognized_extern, recognized_function): Constify
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 2fe8cd4772a..807119f4228 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -54,6 +54,12 @@ do { fprintf (FILE, "\t%s\t", ASM_LONG); \
} 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) \
+ fprintf (FILE, "%s:\n", LABEL_ALTERNATE_NAME (INSN))
+#endif
+
/* choose a reasonable default for ASM_OUTPUT_ASCII. */
#ifndef ASM_OUTPUT_ASCII
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 4e45985df01..cb49d7fb4ec 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1523,9 +1523,10 @@ gen_label_rtx ()
register rtx label;
label = gen_rtx_CODE_LABEL (VOIDmode, 0, NULL_RTX,
- NULL_RTX, label_num++, NULL_PTR);
+ NULL_RTX, label_num++, NULL_PTR, NULL_PTR);
LABEL_NUSES (label) = 0;
+ LABEL_ALTERNATE_NAME (label) = NULL;
return label;
}
diff --git a/gcc/final.c b/gcc/final.c
index e0092c0b026..20670b94974 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -2418,14 +2418,19 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
NEXT_INSN (insn));
#else
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
+ 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;
}
}
-
- ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
+ if (LABEL_ALTERNATE_NAME (insn))
+ ASM_OUTPUT_ALTERNATE_LABEL_NAME (file, insn);
+ else
+ ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (insn));
break;
default:
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index 8ea80663c3a..1a8aef538f9 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -252,6 +252,7 @@ ggc_mark_rtx_children (r)
break;
case CODE_LABEL:
ggc_mark_rtx (LABEL_REFS (r));
+ ggc_mark_string (LABEL_ALTERNATE_NAME (r));
break;
case LABEL_REF:
ggc_mark_rtx (LABEL_NEXTREF (r));
diff --git a/gcc/jump.c b/gcc/jump.c
index 538460945d4..4c8e9775927 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -2433,7 +2433,9 @@ delete_unreferenced_labels (f)
for (insn = f; insn; )
{
- if (GET_CODE (insn) == CODE_LABEL && LABEL_NUSES (insn) == 0)
+ if (GET_CODE (insn) == CODE_LABEL
+ && LABEL_NUSES (insn) == 0
+ && LABEL_ALTERNATE_NAME (insn) == NULL)
insn = delete_insn (insn);
else
{
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 4db28c202ea..ef8a40204ae 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -354,7 +354,11 @@ print_rtx (in_rtx)
#endif
if (GET_CODE (in_rtx) == CODE_LABEL)
- fprintf (outfile, " [num uses: %d]", LABEL_NUSES (in_rtx));
+ {
+ fprintf (outfile, " [num uses: %d]", LABEL_NUSES (in_rtx));
+ if (LABEL_ALTERNATE_NAME (in_rtx))
+ fprintf (outfile, " [alternate name: %s]", LABEL_ALTERNATE_NAME (in_rtx));
+ }
if (dump_for_graph
&& (is_insn || GET_CODE (in_rtx) == NOTE
diff --git a/gcc/rtl.def b/gcc/rtl.def
index bb7c5bc09bb..2c323fc8239 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -376,8 +376,9 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu", 'x')
3: is a number that is unique in the entire compilation.
4: is the user-given name of the label, if any.
5: is used in jump.c for the use-count of the label.
- 6: is used in flow.c to point to the chain of label_ref's to this label. */
-DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuis00", 'x')
+ 6: is used in flow.c to point to the chain of label_ref's to this label.
+ 7: is the alternate label name. */
+DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuis00s", 'x')
/* Say where in the code a source line starts, for symbol table's sake.
Contains a filename and a line number. Line numbers <= 0 are special:
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 25c064bedc4..a723c7fbe8a 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -597,6 +597,9 @@ extern const char * const note_insn_name[];
of LABEL_REFs that point at it, so unused labels can be deleted. */
#define LABEL_NUSES(RTX) XCINT(RTX, 5, CODE_LABEL)
+/* Associate a name with a CODE_LABEL. */
+#define LABEL_ALTERNATE_NAME(RTX) XCSTR(RTX, 7, CODE_LABEL)
+
/* The original regno this ADDRESSOF was built for. */
#define ADDRESSOF_REGNO(RTX) XCINT(RTX, 1, ADDRESSOF)
diff --git a/gcc/rtl.texi b/gcc/rtl.texi
index 61cd9fb6083..6ad3b8a33c1 100644
--- a/gcc/rtl.texi
+++ b/gcc/rtl.texi
@@ -2384,6 +2384,11 @@ The field @code{LABEL_NUSES} is only defined once the jump optimization
phase is completed and 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 barrier
@item barrier
Barriers are placed in the instruction stream when control cannot flow
diff --git a/gcc/tm.texi b/gcc/tm.texi
index 96ebf815916..283eb686e1a 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -5736,6 +5736,17 @@ The usual definition of this macro is as follows:
fprintf (@var{stream}, "L%s%d:\n", @var{prefix}, @var{num})
@end example
+@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