From patchwork Thu Jan 23 01:25:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1227568 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-518095-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=vozqh1Py; dkim=pass (2048-bit key; unprotected) header.d=marvell.com header.i=@marvell.com header.a=rsa-sha256 header.s=pfpt0818 header.b=bqEKbrZ8; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4834Nb2M6Tz9sR1 for ; Thu, 23 Jan 2020 12:26:05 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=IiVv6/V+pJWCEyAHKo9piZYy6hsSk1nBZdSh5zumDAyJtl/v5H uLB5DiMq5AZkonE+k4PUW3NCdes6VPCYUxLPhZ7DKWx/y40MxRoR1dwqesFOczrn oKjyI4n5GWeu85vN1dMjij4HASg0gpyM+5n8vRSkYR96bmURGL5B7Dtk4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=O2pwpT5DgYYUkKtLYwAPcBl06fU=; b=vozqh1PygqrkgWCTWWe8 gqlhpFEha/Gsk+sFXQv+OUd3vG3NHE7h7n+FXgXlUfP7gtOmf7xS61u8kYX4s5eJ LMA6gKZ7dSjKt3cwEvXrUMjU0Exx3l4vh6ganRtKBznL36PIZbnWn2cFth6gbNkO FPaj6WaltQPt8AFXldBpX+o= Received: (qmail 30254 invoked by alias); 23 Jan 2020 01:25:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 30246 invoked by uid 89); 23 Jan 2020 01:25:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx0b-0016f401.pphosted.com Received: from mx0b-0016f401.pphosted.com (HELO mx0b-0016f401.pphosted.com) (67.231.156.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Jan 2020 01:25:56 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00N1KoNd024619 for ; Wed, 22 Jan 2020 17:25:55 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=slWQtgHThdLv5WGOxlKW9mdm+x1gTJUpux4JRupn3yA=; b=bqEKbrZ8d8C3eRYGe+Q3Ccqg9yTKti3ERM519GwfLxCqByPyYtVVVtKO2xyeEh7ZZMoP Lya3YFtndCAbllIEP4KYSETNpxNMj9z/cvPqUWzwV8RKUCgomAarcbOFR980SsiocuNn E+++uJ9AZIOiFL9zHFl42OFvyd/DCpmvJP1R1EcDgf5Ru855KnAWqMflYu7ojqeqVzCO hzQhzFaKpbq2Vlsic15SbJxjhW1DBkPBVPHDGc6VzMPGIaSYmF+WZCgCTm8y7rCFwn5W YAEe+5AE1ZquffqKqlHFMTdEIPTZtviFinX7Gl/IiIqzaANG1u4mLP9+ThWc9wtGM2uN zg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2xm2dt9r6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 22 Jan 2020 17:25:54 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jan 2020 17:25:53 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 22 Jan 2020 17:25:53 -0800 Received: from linux.pinskiwright.org.com (unknown [10.11.201.32]) by maili.marvell.com (Postfix) with ESMTP id 0367C3F703F; Wed, 22 Jan 2020 17:25:49 -0800 (PST) From: To: CC: Andrew Pinski Subject: [PATCH] Fix patchable-function-entry on arc Date: Wed, 22 Jan 2020 17:25:24 -0800 Message-ID: <1579742724-5905-1-git-send-email-apinski@marvell.com> MIME-Version: 1.0 From: Andrew Pinski 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. --- gcc/ChangeLog | 4 ++++ gcc/config/arc/arc.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07e7356..55b2392 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 02ab339..22475f2 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)) {