From: Eric Botcazou Date: Mon, 18 Sep 2017 09:15:32 +0000 (+0000) Subject: re PR target/81361 (broken exception handling at -O2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0eeb9f3d7cb92d0e32fb7e206ba61ec74268c386;p=gcc.git re PR target/81361 (broken exception handling at -O2) PR target/81361 * dwarf2cfi.c (add_cfis_to_fde): Do not generate DW_CFA_set_loc after switching to a new text section. From-SVN: r252914 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fe4fcfaefbb..17b0d7c71f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-09-18 Eric Botcazou + + PR target/81361 + * dwarf2cfi.c (add_cfis_to_fde): Do not generate DW_CFA_set_loc after + switching to a new text section. + 2017-09-18 Richard Biener * graphite-scop-detection.c (scop_detection::stmt_has_simple_data_ref): diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index b2ee8d6cf02..45b5e3099d2 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -2209,20 +2209,13 @@ add_cfis_to_fde (void) { dw_fde_ref fde = cfun->fde; rtx_insn *insn, *next; - /* We always start with a function_begin label. */ - bool first = false; for (insn = get_insns (); insn; insn = next) { next = NEXT_INSN (insn); if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_SWITCH_TEXT_SECTIONS) - { - fde->dw_fde_switch_cfi_index = vec_safe_length (fde->dw_fde_cfi); - /* Don't attempt to advance_loc4 between labels - in different sections. */ - first = true; - } + fde->dw_fde_switch_cfi_index = vec_safe_length (fde->dw_fde_cfi); if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_CFI) { @@ -2247,8 +2240,7 @@ add_cfis_to_fde (void) /* Set the location counter to the new label. */ xcfi = new_cfi (); - xcfi->dw_cfi_opc = (first ? DW_CFA_set_loc - : DW_CFA_advance_loc4); + xcfi->dw_cfi_opc = DW_CFA_advance_loc4; xcfi->dw_cfi_oprnd1.dw_cfi_addr = label; vec_safe_push (fde->dw_fde_cfi, xcfi); @@ -2263,7 +2255,6 @@ add_cfis_to_fde (void) insn = NEXT_INSN (insn); } while (insn != next); - first = false; } } }