aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@cygnus.com>1999-03-21 12:14:09 +0000
committerNick Clifton <nickc@gcc.gnu.org>1999-03-21 12:14:09 +0000
commit088e716060315042f749c74ad3cfd43b97e614bd (patch)
tree2d8c103ec5d59d7f6360e078e727209d3e9c0646 /gcc/flow.c
parent0fdb7c85cee6d9bad7a987444464f80ad0777aa4 (diff)
downloadgcc-088e716060315042f749c74ad3cfd43b97e614bd.zip
gcc-088e716060315042f749c74ad3cfd43b97e614bd.tar.gz
gcc-088e716060315042f749c74ad3cfd43b97e614bd.tar.bz2
Preserve programmer specified labels, and emit debug info for them even if
they are deleted. From-SVN: r25883
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 1515d41..f60daa4 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -376,7 +376,7 @@ find_basic_blocks (f, nregs, file)
bb_eh_end = (rtx *) alloca (n_basic_blocks * sizeof (rtx));
label_value_list = find_basic_blocks_1 (f, bb_eh_end);
-
+
/* Record the block to which an insn belongs. */
/* ??? This should be done another way, by which (perhaps) a label is
tagged directly with the basic block that it starts. It is used for
@@ -1241,7 +1241,7 @@ split_edge (edge_in)
pos = emit_jump_insn_after (gen_jump (old_succ->head), pos);
jump_block->end = pos;
emit_barrier_after (pos);
-
+
/* ... and clear fallthru on the outgoing edge. */
e->flags &= ~EDGE_FALLTHRU;
@@ -1649,6 +1649,7 @@ delete_block (b)
notes. */
insn = b->head;
+
if (GET_CODE (insn) == CODE_LABEL)
{
rtx x, *prev = &exception_handler_labels;
@@ -1793,6 +1794,16 @@ can_delete_label_p (label)
if (label == XEXP (x, 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;
}