From patchwork Fri Nov 15 21:44:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1195870 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-513694-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="oXPV4Da6"; 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 47FBjV3R6Jz9s4Y for ; Sat, 16 Nov 2019 08:45:34 +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:in-reply-to:references :mime-version:content-transfer-encoding:content-type; q=dns; s= default; b=fswRCsCizzEO/JrOOtQm7ag70cT3HHXL6NUmfDnD+QX45BL9dcBjd JxWIpW0rHw8BIWknglp0a3bJsu88++lOWME+tjazhyEnPR724rwAWVWphvNVohPj n22pXAZH+IFKS8GXY/msNV1IGgRBOnRcY0nFnooDv1xKYEAceQh+0o= 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:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=default; bh=ztAp4yawCtcKimWi21Xn5a14Okw=; b=oXPV4Da6qkwbsoTNyan8MKzjzHoP 6PyMzo3I7SFoaHAE0C1mmNNnKjqbsM2ysw26CsR0UlLckUV+EYIwu27pAYeYDnFZ 2tcRFNmZ/F3cZyXDmxJFm1RAz21NzkxT6l6J1pnbCeNFbCxCHAUhOT5yknF93xZG lEBgdO+gu39k8GQ= Received: (qmail 56292 invoked by alias); 15 Nov 2019 21:45:16 -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 56248 invoked by uid 89); 15 Nov 2019 21:45:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1203, HContent-Transfer-Encoding:8bit X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Nov 2019 21:45:14 +0000 IronPort-SDR: Rn1XNl6UxWlRWA7u9AfobWbXmkj8rfL/mSD3ZtbQOy/EQ/36ShTqlzIu9Tvt8sSAJGN8N5QQAR 7paZAADUZRJgbb/GGkmv3meb4eFHoKfn0cTS2c0u6juJGvj6TMBFWb00hqFdAZaZTTzdsxhcnj hqIW8f3MZY622oPhuiRVxdSDn05DvMiCwDaO4ilj6B6p25G1ZQ4qBI3qgrWAqQ7Kdyoc3fvSA2 rwrp4mY+7ajKx3EK2Uv7b1EWr9vW9zuTtNL4U3v+caFWJIODi1hEGBr//1nJrwWufjfBEibjUw Rms= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 15 Nov 2019 13:45:12 -0800 IronPort-SDR: K4TGClM6MltnQM029L3Hj+jpFmJcSPDOP7q+JmCIRAz7Ar4+V/BJqEcGlENohgBwu58Ezcul/s 1BWdzzUiswtJtkctOh73KFYzn5WGpES3SiiZaRHBdVpxQam+lPnY5huHdENmjp9/M9HuMO2BPq bXvqv/A3tp2vfYuT/f+5ffdnOJMs7k2wpxQAy8nGS/IoaMS2ajxjrZ75M5YJKx60VqPzOJDNN3 OBiPQV1phU9xscyR6r98cjOSfvMW5DgRpTBYkyZt73EYsXb2Zmxnveen61q02xic+6Q8R2+YSP NxE= From: Julian Brown To: CC: , , , Andrew Stubbs Subject: [PATCH 11/13] AMD GCN symbol output with null cfun Date: Fri, 15 Nov 2019 13:44:04 -0800 Message-ID: <140d572813ba6d84a164819ae36caaeeaa99c14c.1573849744.git.julian@codesourcery.com> In-Reply-To: References: MIME-Version: 1.0 X-IsSubscribed: yes This patch checks that cfun is valid in the gcn_asm_output_symbol_ref function. This prevents a crash when that function is called with NULL cfun, i.e. when outputting debug symbols. OK? Thanks, Julian ChangeLog gcc/ * config/gcn/gcn.c (gcn_asm_output_symbol_ref): Handle null cfun. --- gcc/config/gcn/gcn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index 2f758ef3ddc..3584ac85021 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -5199,7 +5199,8 @@ void gcn_asm_output_symbol_ref (FILE *file, rtx x) { tree decl; - if ((decl = SYMBOL_REF_DECL (x)) != 0 + if (cfun + && (decl = SYMBOL_REF_DECL (x)) != 0 && TREE_CODE (decl) == VAR_DECL && AS_LDS_P (TYPE_ADDR_SPACE (TREE_TYPE (decl)))) { @@ -5214,7 +5215,8 @@ gcn_asm_output_symbol_ref (FILE *file, rtx x) { assemble_name (file, XSTR (x, 0)); /* FIXME: See above -- this condition is unreachable. */ - if ((decl = SYMBOL_REF_DECL (x)) != 0 + if (cfun + && (decl = SYMBOL_REF_DECL (x)) != 0 && TREE_CODE (decl) == VAR_DECL && AS_LDS_P (TYPE_ADDR_SPACE (TREE_TYPE (decl)))) fputs ("@abs32", file);