aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r--gcc/tree-ssa-sink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index 77abe3a..67dc127 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -439,7 +439,10 @@ statement_sink_location (gimple *stmt, basic_block frombb,
if (sinkbb == frombb)
return false;
- *togsi = gsi_for_stmt (use);
+ if (sinkbb == gimple_bb (use))
+ *togsi = gsi_for_stmt (use);
+ else
+ *togsi = gsi_after_labels (sinkbb);
return true;
}