]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/69838 (Lra deletes EH_REGION)
authorJakub Jelinek <jakub@redhat.com>
Fri, 19 Feb 2016 16:25:58 +0000 (17:25 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 19 Feb 2016 16:25:58 +0000 (17:25 +0100)
PR middle-end/69838
* lra.c (lra_process_new_insns): If non-call exceptions are enabled,
call copy_reg_eh_region_note_forward on before and/or after sequences
and remove note from insn if it no longer can throw.

From-SVN: r233562

gcc/ChangeLog
gcc/lra.c

index 07b7338826b5fb6b2a9d25116c1adc8341eda2b6..587a53461cffcc8000a3bfa4071d70c09442ac9b 100644 (file)
@@ -1,5 +1,10 @@
 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/69838
+       * lra.c (lra_process_new_insns): If non-call exceptions are enabled,
+       call copy_reg_eh_region_note_forward on before and/or after sequences
+       and remove note from insn if it no longer can throw.
+
        PR target/69820
        * config/i386/sse.md (VI_512): Only include V64QImode and V32HImode
        if TARGET_AVX512BW.
index ee92ca57e63c946c7f6562884fa82f67e1ecc79d..a6ce36529f8db0c91ffcbf90dcbcfa38d4119fc0 100644 (file)
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -1742,20 +1742,29 @@ lra_process_new_insns (rtx_insn *insn, rtx_insn *before, rtx_insn *after,
     }
   if (before != NULL_RTX)
     {
+      if (cfun->can_throw_non_call_exceptions)
+       copy_reg_eh_region_note_forward (insn, before, NULL);
       emit_insn_before (before, insn);
       push_insns (PREV_INSN (insn), PREV_INSN (before));
       setup_sp_offset (before, PREV_INSN (insn));
     }
   if (after != NULL_RTX)
     {
+      if (cfun->can_throw_non_call_exceptions)
+       copy_reg_eh_region_note_forward (insn, after, NULL);
       for (last = after; NEXT_INSN (last) != NULL_RTX; last = NEXT_INSN (last))
        ;
       emit_insn_after (after, insn);
       push_insns (last, insn);
       setup_sp_offset (after, last);
     }
+  if (cfun->can_throw_non_call_exceptions)
+    {
+      rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+      if (note && !insn_could_throw_p (insn))
+       remove_note (insn, note);
+    }
 }
-
 \f
 
 /* Replace all references to register OLD_REGNO in *LOC with pseudo