+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
/* 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;
};
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))
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);