]> gcc.gnu.org Git - gcc.git/commitdiff
dwarf2cfi.c (struct dw_trace_info): Add args_size_defined_for_eh.
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 13 Oct 2018 17:32:07 +0000 (17:32 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 13 Oct 2018 17:32:07 +0000 (17:32 +0000)
* dwarf2cfi.c (struct dw_trace_info): Add args_size_defined_for_eh.
(notice_args_size): Set it in the current trace if no insn that can
throw internally has been seen yet.
(connect_traces): When connecting args_size between traces, allow the
incoming values not to match if there is an insn setting it before the
first insn that can throw internally; in that case, force the creation
of a CFI note on this latter insn.

From-SVN: r265142

gcc/ChangeLog
gcc/dwarf2cfi.c

index 1f84d8776d0cabbf210e3463dced3b003beddb4e..49770e78a8539480743ada9f6ac5155a82b4930a 100644 (file)
@@ -1,3 +1,13 @@
+2018-10-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * dwarf2cfi.c (struct dw_trace_info): Add args_size_defined_for_eh.
+       (notice_args_size): Set it in the current trace if no insn that can
+       throw internally has been seen yet.
+       (connect_traces): When connecting args_size between traces, allow the
+       incoming values not to match if there is an insn setting it before the
+       first insn that can throw internally; in that case, force the creation
+       of a CFI note on this latter insn.
+
 2018-10-13  Jonathan Wakely  <jwakely@redhat.com>
 
        * opt-problem.h (opt_wrapper): Use template-argument-list when naming
index 4cfb91b8d40810ffb1331a1e084a917e0ed7f9c2..162d9f64f188f4f4a1a11c7c788cc3b514270018 100644 (file)
@@ -147,6 +147,9 @@ struct dw_trace_info
 
   /* True if we've seen different values incoming to beg_true_args_size.  */
   bool args_size_undefined;
+
+  /* True if we've seen an insn with a REG_ARGS_SIZE note before EH_HEAD.  */
+  bool args_size_defined_for_eh;
 };
 
 
@@ -942,6 +945,9 @@ notice_args_size (rtx_insn *insn)
   if (note == NULL)
     return;
 
+  if (!cur_trace->eh_head)
+    cur_trace->args_size_defined_for_eh = true;
+
   args_size = get_args_size (note);
   delta = args_size - cur_trace->end_true_args_size;
   if (known_eq (delta, 0))
@@ -2820,11 +2826,17 @@ connect_traces (void)
 
          if (ti->switch_sections)
            prev_args_size = 0;
+
          if (ti->eh_head == NULL)
            continue;
-         gcc_assert (!ti->args_size_undefined);
 
-         if (maybe_ne (ti->beg_delay_args_size, prev_args_size))
+         /* We require either the incoming args_size values to match or the
+            presence of an insn setting it before the first EH insn.  */
+         gcc_assert (!ti->args_size_undefined || ti->args_size_defined_for_eh);
+
+         /* In the latter case, we force the creation of a CFI note.  */
+         if (ti->args_size_undefined
+             || maybe_ne (ti->beg_delay_args_size, prev_args_size))
            {
              /* ??? Search back to previous CFI note.  */
              add_cfi_insn = PREV_INSN (ti->eh_head);
This page took 0.085436 seconds and 5 git commands to generate.