From patchwork Thu Jan 23 12:46:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 1227882 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-518128-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.a=rsa-sha1 header.s=default header.b=FUDlQFxX; 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 483MTs0lVQz9sSH for ; Thu, 23 Jan 2020 23:46:40 +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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=JAe/TncEUMF0rYzzWLU8mOprAyV+zlJMgz7twwaKxOE8kJT64y m7rzD8cjVYA/auUi24cOGbsqSbwL5WwlgvqrOKaqF3Gebc6Zn+WeYVbvKPSsFOpH 3E3b5F3C1UyswtbKC0yYSZGiMaIouzggc4YHjrLj/wTQc2C5qGby3vlhU= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=gXQSSlgyZdNjXOwOHeaeOLpRFvc=; b=FUDlQFxXvrnDaKMi1Kez FFdJC3m3orimp5PMwDb7602Y3MbDTbNOM7Dl+io/XGEz2YugVEnNl7TxNN211K/P 4a8uTBb6rr70CBA5dYxE2g8Wl8ptnu7bL8ZBMjpRTBfCriiIL/QTk4q11NxnWW9v AX1eRIUUWRufnP3xO7FR/Bg= Received: (qmail 110148 invoked by alias); 23 Jan 2020 12:46:34 -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 110139 invoked by uid 89); 23 Jan 2020 12:46:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1085 X-HELO: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Jan 2020 12:46:33 +0000 IronPort-SDR: dMUkfUUAd59YoyBvpfdb+jktx49KEvcm/7TbUf4tIco74yeZXFCtfZloLcPg6Ekw4Cl6p9x/UI 9aRcpxeRfZZIt5QJs0lL+SyOkhme5zwvM/38Nl8ZxyKwq4R0cfzHgZtORmBluJklU5bwLwKqMA Y9lZjXlFYXAoKzrdEo9UqdvGHuxkIoXfp1zzG6K6q6I9gJ2MrpL1F89JCrJoSxTJ2syYV+YDBL T1UNncuqrtmgrVG4i1bxSkTrrI7mNxf4ccVFwlXSf5OSz09r3ZD89rCNi0/gDFI0wXTIzoJ6X9 Utc= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 23 Jan 2020 04:46:31 -0800 IronPort-SDR: 2ZZQlylf1ysYxWurSfEpc3mW9d6X6AwgnbUBNHYsSsYVfvbIM/XnEVGw85arnl4l4Lwn+Q9vW/ nmN0TiI96Pxw== To: "gcc-patches@gcc.gnu.org" From: Andrew Stubbs Subject: [committed, libgomp,amdgcn] Fix plugin-gcn.c bug Message-ID: Date: Thu, 23 Jan 2020 12:46:24 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 I've committed this patch to fix a bug in the OpenMP argument parsing. It was using a value instead of a mask to read from the arguments. Since the value in question happens to be zero, the comparison would always return true. I've not observed any bad behaviour from this, but in theory it could read attempt to read any unhandled argument as the thread limit. Andrew Fix libgomp plugin-gcn bug 2020-01-23 Andrew Stubbs libgomp/ * plugin/plugin-gcn.c (parse_target_attributes): Use correct mask for the device id. diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index de470a3dd33..7854c142f05 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -1228,7 +1228,8 @@ parse_target_attributes (void **input, grid_attrs_found = true; break; } - else if ((id & GOMP_TARGET_ARG_DEVICE_ALL) == GOMP_TARGET_ARG_DEVICE_ALL) + else if ((id & GOMP_TARGET_ARG_DEVICE_MASK) + == GOMP_TARGET_ARG_DEVICE_ALL) { gcn_dims_found = true; switch (id & GOMP_TARGET_ARG_ID_MASK)