From: Andrew Pinski Date: Wed, 22 Jan 2020 23:34:34 +0000 (+0000) Subject: Fix patchable-function-entry on arc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41fe06f89f96c5f9599855a2778c8a3dd7efe22d;p=gcc.git Fix patchable-function-entry on arc The problem here is arc looks at current_output_insn unconditional but sometimes current_output_insn is NULL. With patchable-function-entry, it will be. This is similar to how the nios2, handles "%.". Committed as obvious after a simple test with -fpatchable-function-entry=1. ChangeLog: * config/arc/arc.c (output_short_suffix): Check insn for nullness. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07e73568056..55b23927f76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2020-01-22 Andrew Pinski + + * config/arc/arc.c (output_short_suffix): Check insn for nullness. + 2020-01-22 David Malcolm PR analyzer/93307 diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 02ab339df40..22475f2732e 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -5537,6 +5537,8 @@ static void output_short_suffix (FILE *file) { rtx_insn *insn = current_output_insn; + if (!insn) + return; if (arc_verify_short (insn, cfun->machine->unalign, 1)) {