Bug 70598 - Fortran OpenACC host_data construct ICE
Summary: Fortran OpenACC host_data construct ICE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 6.0
: P3 major
Target Milestone: 7.0
Assignee: Chung-Lin Tang
URL:
Keywords: openacc, patch
Depends on:
Blocks:
 
Reported: 2016-04-08 13:39 UTC by Thomas Schwinge
Modified: 2017-07-04 20:40 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-04-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schwinge 2016-04-08 13:39:41 UTC
As once reported in <http://news.gmane.org/find-root.php?message_id=%3C87r3j4lcrd.fsf%40kepler.schwinge.homeip.net%3E> and thereabouts, there is no execution (libgomp) testing of the Fortran OpenACC host_data construct, and the one test case present on gomp-4_0-branch, libgomp.oacc-fortran/host_data-1.f90, runs into an ICE (for trunk as well as gomp-4_0-branch).  Please have a look at that, and also increase test coverage (for example, by translating C/C++ execution (libgomp) test cases, if applicable).

As the implementation of OpenACC host_data/use_device has been completely re-done during patch review (to match OpenMP's use_device_ptr clause), I suppose it's possible that there is some middle end infrastructure missing to deal with constructs generated by the Fortran front end.  Maybe Jakub can advise on that, in case he's already started implementing the Fortran support for OpenMP (which is currently missing).  Or maybe the ICE is due to something completely different.  ;-)
Comment 1 Tom de Vries 2016-04-09 07:26:35 UTC
On trunk, for -m64, we have XFAIL/UNRESOLVED:
...
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O0  (internal compiler error)
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O0  (test for excess errors)
UNRESOLVED: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O0  compilation failed to produce executa
ble
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O1  (internal compiler error)
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O1  (test for excess errors)
UNRESOLVED: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O1  compilation failed to produce executa
ble
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O2  (internal compiler error)
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O2  (test for excess errors)
UNRESOLVED: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O2  compilation failed to produce executa
ble
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler error)
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors)
UNRESOLVED: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -fomit-frame-pointer -funroll-loops -f
peel-loops -ftracer -finline-functions  compilation failed to produce executable
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -g  (internal compiler error)
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -g  (test for excess errors)
UNRESOLVED: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -g  compilation failed to produce exec
utable
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -Os  (internal compiler error)
XFAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -Os  (test for excess errors)
UNRESOLVED: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -Os  compilation failed to produce executa
ble
...

But for -m32, we have XPASS/FAIL:
...
XPASS: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O0  (test for excess errors)
FAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O0  execution test
XPASS: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O1  (test for excess errors)
FAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O1  execution test
XPASS: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O2  (test for excess errors)
FAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O2  execution test
XPASS: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
XPASS: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -g  (test for excess errors)
FAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -O3 -g  execution test
XPASS: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -Os  (test for excess errors)
FAIL: libgomp.oacc-fortran/host_data-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable  -Os  execution test
...
Comment 2 Tom de Vries 2016-04-09 07:28:11 UTC
(In reply to vries from comment #1)
> On trunk

Sorry, that should have been gomp-4_0-branch
Comment 3 Thomas Schwinge 2016-05-12 15:30:33 UTC
In <http://news.gmane.org/find-root.php?message_id=%3C2b4f59d5-be38-2814-27bb-73aa7ffb4b8f%40codesourcery.com%3E>, Chung-Lin has now posted a patch (pending review) that should make the OpenACC host_data construct usable in GCC Fortran.  (Problem discussed in <http://news.gmane.org/find-root.php?message_id=%3C878u0o6wwj.fsf%40kepler.schwinge.homeip.net%3E> before.)
Comment 4 Chung-Lin Tang 2016-08-14 18:19:42 UTC
Author: cltang
Date: Sun Aug 14 18:19:10 2016
New Revision: 239457

URL: https://gcc.gnu.org/viewcvs?rev=239457&root=gcc&view=rev
Log:
2016-08-14  Chung-Lin Tang  <cltang@codesourcery.com>

	PR fortran/70598

	gcc/fortran/
	* openmp.c (resolve_omp_clauses): Adjust use_device clause
	handling to only allow pointers and arrays.

	gcc/testsuite/
	* gfortran.dg/goacc/host_data-tree.f95: Adjust to use pointers
	in use_device clause.
	* gfortran.dg/goacc/uninit-use-device-clause.f95: Likewise.
	* gfortran.dg/goacc/list.f95: Adjust to catch
	"neither a POINTER nor an array" error messages.

	libgomp/
	* testsuite/libgomp.oacc-fortran/host_data-1.f90: New test.


Added:
    trunk/libgomp/testsuite/libgomp.oacc-fortran/host_data-1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/openmp.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/goacc/host_data-tree.f95
    trunk/gcc/testsuite/gfortran.dg/goacc/list.f95
    trunk/gcc/testsuite/gfortran.dg/goacc/uninit-use-device-clause.f95
    trunk/libgomp/ChangeLog
Comment 5 Jakub Jelinek 2016-12-21 10:59:05 UTC
GCC 6.3 is being released, adjusting target milestone.
Comment 6 Richard Biener 2017-07-04 08:50:04 UTC
GCC 6.4 is being released, adjusting target milestone.
Comment 7 Andrew Pinski 2017-07-04 20:40:58 UTC
Fixed.