aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-07-05 08:39:13 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-07-05 08:39:13 +0000
commit4500f7510368cdb24b8afcc66e86e09cafe49199 (patch)
treeef2fbd634046ad09eee8adc6a72055247524803a /gcc/except.c
parentffdc40a90faec54d29af76b994c52790685a8e58 (diff)
downloadgcc-4500f7510368cdb24b8afcc66e86e09cafe49199.zip
gcc-4500f7510368cdb24b8afcc66e86e09cafe49199.tar.gz
gcc-4500f7510368cdb24b8afcc66e86e09cafe49199.tar.bz2
except.c (emit_to_new_bb_before): Make sure to put a location on SEQ.
* except.c (emit_to_new_bb_before): Make sure to put a location on SEQ. * tree-eh.c (replace_goto_queue_1) <GIMPLE_GOTO>: Propagate location. (emit_eh_dispatch): Delete. (lower_catch): Emit the eh_dispatch manually and set the location of the first catch statement onto it. (lower_eh_filter): Emit the eh_dispatch manually and set location. (lower_eh_dispatch): Propagate location. * tree-outof-ssa.c (set_location_for_edge): Handle EH edges specially. (eliminate_build): Likewise. From-SVN: r273132
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 29f3339..b1f04ee 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -921,7 +921,7 @@ assign_filter_values (void)
static basic_block
emit_to_new_bb_before (rtx_insn *seq, rtx_insn *insn)
{
- rtx_insn *last;
+ rtx_insn *next, *last;
basic_block bb;
edge e;
edge_iterator ei;
@@ -934,7 +934,16 @@ emit_to_new_bb_before (rtx_insn *seq, rtx_insn *insn)
force_nonfallthru (e);
else
ei_next (&ei);
- last = emit_insn_before (seq, insn);
+
+ /* Make sure to put the location of INSN or a subsequent instruction on SEQ
+ to avoid inheriting the location of the previous instruction. */
+ next = insn;
+ while (next && !NONDEBUG_INSN_P (next))
+ next = NEXT_INSN (next);
+ if (next)
+ last = emit_insn_before_setloc (seq, insn, INSN_LOCATION (next));
+ else
+ last = emit_insn_before (seq, insn);
if (BARRIER_P (last))
last = PREV_INSN (last);
bb = create_basic_block (seq, last, BLOCK_FOR_INSN (insn)->prev_bb);