Commit 088e7160 by Nick Clifton Committed by Nick Clifton

Preserve programmer specified labels, and emit debug info for them even if

they are deleted.

From-SVN: r25883
parent 0fdb7c85
Sun Mar 21 12:13:01 1999 Nick Clifton <nickc@cygnus.com>
* flow.c (can_delete_label_p): Do not allow user specified
labels to be deleted.
* dwarf2out.c (gen_label_die): Generate addresses for deleted
(programmer specified) labels.
* dwarfout.c (output_label_die): Generate addresses for deleted
(programmer specified) labels.
1999-03-21 Manfred Hollstein <manfred@s-direktnet.de> 1999-03-21 Manfred Hollstein <manfred@s-direktnet.de>
* Makefile.in (xgcc$(exeext)): Add intl.o to list of files to be * Makefile.in (xgcc$(exeext)): Add intl.o to list of files to be
......
...@@ -8583,7 +8583,13 @@ gen_label_die (decl, context_die) ...@@ -8583,7 +8583,13 @@ gen_label_die (decl, context_die)
else else
{ {
insn = DECL_RTL (decl); insn = DECL_RTL (decl);
if (GET_CODE (insn) == CODE_LABEL)
/* Deleted labels are programmer specified labels which have been
eliminated because of various optimisations. We still emit them
here so that it is possible to put breakpoints on them. */
if (GET_CODE (insn) == CODE_LABEL
|| ((GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
{ {
/* When optimization is enabled (via -O) some parts of the compiler /* When optimization is enabled (via -O) some parts of the compiler
(e.g. jump.c and cse.c) may try to delete CODE_LABEL insns which (e.g. jump.c and cse.c) may try to delete CODE_LABEL insns which
......
...@@ -3519,7 +3519,12 @@ output_label_die (arg) ...@@ -3519,7 +3519,12 @@ output_label_die (arg)
{ {
register rtx insn = DECL_RTL (decl); register rtx insn = DECL_RTL (decl);
if (GET_CODE (insn) == CODE_LABEL) /* Deleted labels are programmer specified labels which have been
eliminated because of various optimisations. We still emit them
here so that it is possible to put breakpoints on them. */
if (GET_CODE (insn) == CODE_LABEL
|| ((GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
{ {
char label[MAX_ARTIFICIAL_LABEL_BYTES]; char label[MAX_ARTIFICIAL_LABEL_BYTES];
......
...@@ -1649,6 +1649,7 @@ delete_block (b) ...@@ -1649,6 +1649,7 @@ delete_block (b)
notes. */ notes. */
insn = b->head; insn = b->head;
if (GET_CODE (insn) == CODE_LABEL) if (GET_CODE (insn) == CODE_LABEL)
{ {
rtx x, *prev = &exception_handler_labels; rtx x, *prev = &exception_handler_labels;
...@@ -1793,6 +1794,16 @@ can_delete_label_p (label) ...@@ -1793,6 +1794,16 @@ can_delete_label_p (label)
if (label == XEXP (x, 0)) if (label == XEXP (x, 0))
return 0; return 0;
/* User declared labels must be preserved, but we can
convert them into a NOTE instead. */
if (LABEL_NAME (label) != 0)
{
PUT_CODE (label, NOTE);
NOTE_LINE_NUMBER (label) = NOTE_INSN_DELETED_LABEL;
NOTE_SOURCE_FILE (label) = 0;
return 0;
}
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment