From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B18AE3858D38; Thu, 27 Apr 2023 10:37:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B18AE3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682591879; bh=2rsIf+g1+s3lC5hQf7550YXsssby97V6xdxNFyO3vDI=; h=From:To:Subject:Date:From; b=JE3J5s32+lvczRSPaX5uNg7rQ998gaB0QmImZ4z2P7OUhYeSyfedhvc929jU51kUm F75gDdQMlTBlB0Q/b7YpLYVRoIVROa+kMFKg/HhmCAdyNv5DUvz2e9f5vCkD86IOTJ hCXRL13OqAtJPghvo5R0r+fOO1OBm3VMrcefw9ak= From: "patrick.begou@univ-grenoble-alpes.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/109646] New: OpenACC attach directive fails with "pointer target not mapped for attach" Date: Thu, 27 Apr 2023 10:37:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: patrick.begou@univ-grenoble-alpes.fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109646 Bug ID: 109646 Summary: OpenACC attach directive fails with "pointer target not mapped for attach" Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: patrick.begou@univ-grenoble-alpes.fr CC: jakub at gcc dot gnu.org Target Milestone: --- Created attachment 54940 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54940&action=3Dedit Small test case to reproduce the problem Using GNU Fortran (GCC) 12.2.1 20230302 [OG12] in OpenACC offloading. the "!$acc enter data attach" directive fails with the message "libgomp: pointer target not mapped for attach" A small test-case is provide. Compilation: gfortran -g -fopenacc tranform.f90 -o transform Execution: ./transform=20 In add_new_transform for [Premiere] In add_new_transform : [Premiere] is the first transform In add_new_transform done for [Premiere] In add_new_transform for [Seconde] In add_new_transform insert [Seconde] after [Premiere] libgomp: pointer target not mapped for attach Test runs fine with nvfortran 22.5 (nvfortran -acc -g tranform.f90 -o transform) Test runs fine with Cray Fortran 15.0.1 (ftn -hacc -g tranform.f90 -o transform) Correct poutput is: In add_new_transform for [Premiere] In add_new_transform : [Premiere] is the first transform In add_new_transform done for [Premiere] In add_new_transform for [Seconde] In add_new_transform insert [Seconde] after [Premiere] In add_new_transform done for [Seconde] Found 2 Stack size of the call giving the error: Thread 1 "transform" hit Breakpoint 2, gomp_attach_pointer (devicep=3Ddevicep@entry=3D0x634120, aq=3Daq@entry=3D0x0,=20 mem_map=3Dmem_map@entry=3D0x634208, n=3Dn@entry=3D0xb96cc0, attach_to= =3D12150352, bias=3D, cbufp=3D0x0,=20 allow_zero_length_array_sections=3Dfalse) at ../../../gcc/libgomp/target.c:1012 1012 gomp_fatal ("pointer target not mapped for attach"); (gdb) where #0 gomp_attach_pointer (devicep=3Ddevicep@entry=3D0x634120, aq=3Daq@entry= =3D0x0, mem_map=3Dmem_map@entry=3D0x634208,=20 n=3Dn@entry=3D0xb96cc0, attach_to=3D12150352, bias=3D, c= bufp=3D0x0, allow_zero_length_array_sections=3Dfalse) at ../../../gcc/libgomp/target.c:1012 #1 0x00007ffff736c007 in goacc_enter_data_internal (aq=3D, kinds=3D, sizes=3D,=20 hostaddrs=3D0x7fffffffcc70, mapnum=3D, acc_dev=3D) at ../../../gcc/libgomp/oacc-mem.c:1217 #2 goacc_enter_exit_data_internal (flags_m=3D, mapnum=3D, hostaddrs=3D0x7fffffffcc70,=20 sizes=3D, kinds=3D, data_enter=3Ddata_enter@entry=3Dtrue, async=3D,=20 num_waits=3D, ap=3D) at ../../../gcc/libgomp/oacc-mem.c:1534 #3 0x00007ffff736cc0c in GOACC_enter_data (flags_m=3D, mapnum=3D,=20 hostaddrs=3D, sizes=3D, kinds=3D, async=3D, num_waits=3D0) at ../../../gcc/libgomp/oacc-mem.c:1607 #4 0x000000000040148f in transforms_defs_m::add_new_transform (transform=3D0x606a20, name=3D...,=20 new_ptr=3D, _name=3D7) at tranform.f90:87 #5 0x0000000000401698 in MAIN__ () at tranform.f90:138=