From patchwork Mon Aug 23 15:55:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1519803 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GtcKf24LJz9s1l for ; Tue, 24 Aug 2021 01:56:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E23E0385C41F for ; Mon, 23 Aug 2021 15:56:02 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id ABA5E3858C2C for ; Mon, 23 Aug 2021 15:55:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ABA5E3858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: hK2ExZ4OIUbfYeLhugiZIOTV1EKSb9cYriug8yW+JBsIPUO7zwtV77ja4LbM3dYC/PL+8vcZwk 6yVIQ6zx94mpoW6DhOBXBzEVD+J475leoOP03lTNR507ws2iPpIFQs/RvfNHPHShKeXvXZ2n+W NXWARXQOW8C5oXXSJ/YNzt2VUSBOb+ezUUgYzJ1SxhSfkxlGHrneE30narkoI7X8EBQqsVVsXh EuAYJunSRQ+EMTe1hnO658gElhx7rIIMYzplKEOKLDEJBOIySYLmhBnCWTIpFMLyEReqSoiDOK zvhbp/tBZayghRaE+YP2I/Po X-IronPort-AV: E=Sophos;i="5.84,344,1620720000"; d="scan'208,223";a="67509834" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 23 Aug 2021 07:55:39 -0800 IronPort-SDR: 6GPbKX4P1j1x2JbwXIjdqizAXqjXMgMHqjPrjbzgXuS4I3oguAszoAt1kWddOvaWPWEzmsnzZA xt0I+NR0TiantwFhmRCHPll13tnw2CeqMTjBioPMdYlZRujbdNn1M0tKpQrC/1wJ2msmBLgmLN sCUBt+3qtXOs0gJoQ/yT7zLPKyq5ubR+GiWyhqvJJD5FU2UjM1Gpqw95jvg76Uvpcq9FUqYwn5 r5Ki/6G4j99Z65Inrhnv+pfY1JwCjA4NWBl9G1O5Xn7/2pg0XmOXYugZoafzFaa4O2+nneaE1z ihg= From: Thomas Schwinge To: Jakub Jelinek , Subject: Add 'libgomp.c/address-space-1.c' (was: [ping] Re-unify 'omp_build_component_ref' and 'oacc_build_component_ref') In-Reply-To: <20210820144925.GK2380545@tucnak> References: <992c7c29-5773-45b6-6fb7-ffb71299a98f@mentor.com> <87r1f2puss.fsf@euler.schwinge.homeip.net> <87a6lhhkvp.fsf@euler.schwinge.homeip.net> <20210816082104.GU2380545@tucnak> <871r6pnqez.fsf@euler.schwinge.homeip.net> <20210820144925.GK2380545@tucnak> User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Mon, 23 Aug 2021 17:55:30 +0200 Message-ID: <871r6kqhot.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julian Brown Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi! On 2021-08-20T16:49:25+0200, Jakub Jelinek wrote: >> --- /dev/null >> +++ b/libgomp/testsuite/libgomp.c/address-space-1.c >> @@ -0,0 +1,24 @@ >> +/* Verify OMP instances of variables with address space. */ >> + >> +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ >> +/* { dg-require-effective-target offload_device_nonshared_as } */ I also added: +/* With Intel MIC (emulated) offloading: + offload error: process on the device 0 unexpectedly exited with code 0 + { dg-xfail-run-if TODO { offload_device_intel_mic } } */ Might this be a symptom related to my earlier comment: | [...] -- shouldn't we force generic | address space for all 'tree' types read in via LTO streaming for | offloading compilation? I assume that (in the general case) address | spaces are never compatible between host and offloading compilation? | For the attached "Add 'libgomp.c/address-space-1.c'", propagating the | '__seg_fs' address space across the offloading boundary (assuming I did | interpret the dumps correctly) doesn't seem to cause any problems, but | maybe it's problematic for other cases? ..., or it's yet another problem, of course. ;-) >> +#include >> + >> +int __seg_fs a; >> + >> +int >> +main (void) >> +{ >> + // a = 123; // SIGSEGV >> + int b; >> +#pragma omp target map(alloc: a) map(from: b) >> + { >> + a = 321; // no SIGSEGV (given 'offload_device_nonshared_as') >> + asm volatile ("" : : : "memory"); > > Maybe better asm volatile ("" : : "g" (&a) : "memory"); > so that the compiler doesn't think it could optimize it away to > just b = 321; Thanks. >> + b = a; >> + } >> + assert (b == 321); >> + >> + return 0; >> +} Pushed "Add 'libgomp.c/address-space-1.c'" to master branch in commit 29c355f76ceeb4639c21acaf52c50d35c8472720, see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 29c355f76ceeb4639c21acaf52c50d35c8472720 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 19 Aug 2021 15:14:51 +0200 Subject: [PATCH] Add 'libgomp.c/address-space-1.c' Intel MIC (emulated) offloading execution failure remains to be analyzed. libgomp/ * testsuite/libgomp.c/address-space-1.c: New file. Co-authored-by: Jakub Jelinek --- libgomp/testsuite/libgomp.c/address-space-1.c | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 libgomp/testsuite/libgomp.c/address-space-1.c diff --git a/libgomp/testsuite/libgomp.c/address-space-1.c b/libgomp/testsuite/libgomp.c/address-space-1.c new file mode 100644 index 00000000000..6ad57deec42 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/address-space-1.c @@ -0,0 +1,28 @@ +/* Verify OMP instances of variables with address space. */ + +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-require-effective-target offload_device_nonshared_as } */ + +/* With Intel MIC (emulated) offloading: + offload error: process on the device 0 unexpectedly exited with code 0 + { dg-xfail-run-if TODO { offload_device_intel_mic } } */ + +#include + +int __seg_fs a; + +int +main (void) +{ + // a = 123; // SIGSEGV + int b; +#pragma omp target map(alloc: a) map(from: b) + { + a = 321; // no SIGSEGV (given 'offload_device_nonshared_as') + asm volatile ("" : : "g" (&a) : "memory"); + b = a; + } + assert (b == 321); + + return 0; +} -- 2.25.1