From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2100) id 38B41385803A; Tue, 19 Oct 2021 18:13:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38B41385803A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Giuliano Belinassi To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/giulianob/heads/pfe_backport_clean)] Fix patchable-function-entry on arc X-Act-Checkin: gcc X-Git-Author: Andrew Pinski X-Git-Refname: refs/users/giulianob/heads/pfe_backport_clean X-Git-Oldrev: d8467ff619da4cbf13bb0f154492d7dcd8c88eba X-Git-Newrev: 3fd4df4852bd75b3f5c87b0eb7927f5286ea3ae0 Message-Id: <20211019181303.38B41385803A@sourceware.org> Date: Tue, 19 Oct 2021 18:13:03 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2021 18:13:03 -0000 https://gcc.gnu.org/g:3fd4df4852bd75b3f5c87b0eb7927f5286ea3ae0 commit 3fd4df4852bd75b3f5c87b0eb7927f5286ea3ae0 Author: Andrew Pinski Date: Wed Jan 22 23:34:34 2020 +0000 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. gcc/ChangeLog 2021-10-07 Giuliano Belinassi Backport from mainline 2020-01-22 Andrew Pinski * config/arc/arc.c (output_short_suffix): Check insn for nullness. Diff: --- gcc/config/arc/arc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 92fecad93d9..5e92983929d 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -4195,6 +4195,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)) {