From patchwork Wed Nov 25 15:57:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 548634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 C2A59140187 for ; Thu, 26 Nov 2015 02:57:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=HJfJfCNu; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=xVYYuyybrwNGycoioFseuT/dZJWKN4CKiVS0WTYomOchYn7HIdt8w rj849uzRMxD3hqkZddyjIlrd47tto4AMLfPAMsFFsMX4SO+yT4yTJMDgVEFu2UNV NCKQBVv5R7gnwfyDDOl11SFRedQz80niR+G7SjCso0vDLNcTeb8q5s= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=MgfCqrAOnTB1dRTjP4NHRmRWvvg=; b=HJfJfCNudNksXV2asGBU ZNhZUrtCUacC0VTkSRMG/Q/VsSennMOARm/DZrdLuLG67IdOFAoTD5JgVTP1x0Q/ QdRbZXhdyrkwY+fGMb6WhphTqn/vRU1fwFzWOcB5OqhLZPkkVeGLt69HUgP0ypfZ lXq9KgeKKg6+Bv7DuzXRUjM= Received: (qmail 80158 invoked by alias); 25 Nov 2015 15:57:41 -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 80146 invoked by uid 89); 25 Nov 2015 15:57:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 25 Nov 2015 15:57:40 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A9056AB12 for ; Wed, 25 Nov 2015 15:55:57 +0000 (UTC) Date: Wed, 25 Nov 2015 16:57:37 +0100 From: Martin Jambor To: GCC Patches Subject: [hsa] Fix static local variable name conflict Message-ID: <20151125155737.GO6879@virgil.suse.cz> Mail-Followup-To: GCC Patches MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes Hi, the patch below makes libgomp/testsuite/libgomp.c/target-28.c pass on HSA, where it previously did not like the two static variables with the same name. Committed to the branch. Thanks, Martin 2015-11-25 Martin Jambor * hsa.c (hsa_get_declaration_name): Return ASM name for global variables. --- gcc/hsa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/hsa.c b/gcc/hsa.c index 7c9e0f6..8ab5da7 100644 --- a/gcc/hsa.c +++ b/gcc/hsa.c @@ -700,6 +700,8 @@ hsa_get_declaration_name (tree decl) } else if (TREE_CODE (decl) == FUNCTION_DECL) return cgraph_node::get_create (decl)->asm_name (); + else if (TREE_CODE (decl) == VAR_DECL && is_global_var (decl)) + return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); else return IDENTIFIER_POINTER (DECL_NAME (decl));