From 3010ee5514a16902c1c31fd8afbbd0285d0134c0 Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Tue, 13 Aug 2019 11:04:52 +0000 Subject: Handle casesi dispatch tablejumps in create_trace_edges (as well) * rtlanal.c (tablejump_casesi_pattern): New function, to determine if a tablejump insn is a casesi dispatcher. Extracted from patch_jump_insn. * rtl.h (tablejump_casesi_pattern): Declare. * cfgrtl.c (patch_jump_insn): Use it. * dwarf2cfi.c (create_trace_edges): Use it. testsuite/ * gnat.dg/casesi.ad[bs], test_casesi.adb: New test. From-SVN: r274377 --- gcc/dwarf2cfi.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/dwarf2cfi.c') diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index d6aed35..95ba0f7 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -2445,6 +2445,13 @@ create_trace_edges (rtx_insn *insn) rtx_insn *lab = as_a (XEXP (RTVEC_ELT (vec, i), 0)); maybe_record_trace_start (lab, insn); } + + /* Handle casesi dispatch insns. */ + if ((tmp = tablejump_casesi_pattern (insn)) != NULL_RTX) + { + rtx_insn * lab = label_ref_label (XEXP (SET_SRC (tmp), 2)); + maybe_record_trace_start (lab, insn); + } } else if (computed_jump_p (insn)) { -- cgit v1.1