summaryrefslogtreecommitdiff
path: root/gcc/df-scan.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-29 17:33:34 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-29 17:33:34 +0000
commit05268a5fb26d143984a8372216f0450fb89cea61 (patch)
treeeeda8d346aacdcfb0bc2f25ac2d64a014a13730a /gcc/df-scan.c
parentc36a973ff4869c01fae86c1893c4fac37ed76a71 (diff)
downloadgcc-05268a5fb26d143984a8372216f0450fb89cea61.tar.gz
* df-scan.c (record_nonlocal_goto_receiver_defs): New function.
(df_refs_record): Call it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124283 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r--gcc/df-scan.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index d88da8a9930..87d21a4bb17 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -1765,6 +1765,32 @@ df_bb_refs_record (struct dataflow *dflow, basic_block bb)
}
}
+/* Records the implicit definitions at targets of nonlocal gotos in BLOCKS. */
+
+static void
+record_nonlocal_goto_receiver_defs (struct dataflow *dflow, bitmap blocks)
+{
+ rtx x;
+ basic_block bb;
+
+ /* See expand_builtin_setjmp_receiver; hard_frame_pointer_rtx is used in
+ the nonlocal goto receiver, and needs to be considered defined
+ implicitly. */
+ if (!(dflow->flags & DF_HARD_REGS))
+ return;
+
+ for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
+ {
+ bb = BLOCK_FOR_INSN (XEXP (x, 0));
+ if (!bitmap_bit_p (blocks, bb->index))
+ continue;
+
+ df_ref_record (dflow, hard_frame_pointer_rtx, &hard_frame_pointer_rtx,
+ bb, NULL,
+ DF_REF_REG_DEF, DF_REF_ARTIFICIAL | DF_REF_AT_TOP,
+ false);
+ }
+}
/* Record all the refs in the basic blocks specified by BLOCKS. */
@@ -1785,6 +1811,9 @@ df_refs_record (struct dataflow *dflow, bitmap blocks)
if (bitmap_bit_p (blocks, ENTRY_BLOCK))
df_record_entry_block_defs (dflow);
+
+ if (current_function_has_nonlocal_label)
+ record_nonlocal_goto_receiver_defs (dflow, blocks);
}