+2017-08-06 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/alpha/alpha.c (alpha_reorg): If trap is the last active
+ insn in the function, emit NOP after the insn.
+
2017-08-06 Tom de Vries <tom@codesourcery.com>
* omp-expand.c (expand_oacc_for): Add missing edge probability for tile
if (current_function_has_exception_handlers ())
alpha_pad_function_end ();
+
+ /* CALL_PAL that implements trap insn, updates program counter to point
+ after the insn. In case trap is the last insn in the function,
+ emit NOP to guarantee that PC remains inside function boundaries.
+ This workaround is needed to get reliable backtraces. */
+
+ rtx_insn *insn = prev_active_insn (get_last_insn ());
+
+ if (insn && NONJUMP_INSN_P (insn))
+ {
+ rtx pat = PATTERN (insn);
+ if (GET_CODE (pat) == PARALLEL)
+ {
+ rtx vec = XVECEXP (pat, 0, 0);
+ if (GET_CODE (vec) == TRAP_IF
+ && XEXP (vec, 0) == const1_rtx)
+ emit_insn_after (gen_unop (), insn);
+ }
+ }
}
\f
static void