In some cases the jump could be to a return instruction and in those cases the
next_active_insn() function tries to follow an invalid pointer which leads to a
crash. This error did not manifest when using a 32-bit version of GCC which is
why I did not detect it before.
gcc/
* config/sparc/sparc.c (sparc_do_work_around_errata): Make sure
the jump is to a label.
From-SVN: r255807
+2017-12-19 Daniel Cederman <cederman@gaisler.com>
+
+ * config/sparc/sparc.c (sparc_do_work_around_errata): Make sure
+ the jump is to a label.
+
2017-12-19 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/83444
floating-point operation or a floating-point branch. */
if (sparc_fix_gr712rc
&& jump
+ && jump_to_label_p (jump)
&& get_attr_branch_type (jump) == BRANCH_TYPE_ICC)
{
rtx_insn *target = next_active_insn (JUMP_LABEL_AS_INSN (jump));
&& mem_ref (SET_SRC (set))
&& REG_P (SET_DEST (set)))
{
- if (jump)
+ if (jump && jump_to_label_p (jump))
{
rtx_insn *target = next_active_insn (JUMP_LABEL_AS_INSN (jump));
if (target && atomic_insn_for_leon3_p (target))