public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/63246] New: OpenMP target: gimplifier produces unsuitable implicit map clauses if inside a data region
@ 2014-09-12 17:24 tschwinge at gcc dot gnu.org
  2014-09-12 18:49 ` [Bug middle-end/63246] " jakub at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2014-09-12 17:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63246

            Bug ID: 63246
           Summary: OpenMP target: gimplifier produces unsuitable implicit
                    map clauses if inside a data region
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org

Consider:

    int
    main(int argc, char **argv)
    {
    #define N 4
        short a[N];

    #pragma omp target data map(a[1:N-1])
        {
    #pragma omp target
          {
            a[1] = 51;
          }
        }

        return 0;
    }

..., which results in the following gimple:

    [...]
          #pragma omp target data map(tofrom:a[1] [len: 6]) map(alloc:a
[pointer assign, bias: 2])
            {
              try
                {
                  {
                    #pragma omp target map(tofrom:a [len: 8])
                      {
                        {
                          a[1] = 51;
    [...]

The outer data region sets up an expicit mapping for a subset of the array, and
the inner target construct then again gets an implicit map clause added for
*the whole* region.  A suitably equipped libgomp (for example, gomp-4_0-branch
with the non-shared memory host plugin) doesn't like this:

    libgomp: Trying to map into device [0x7fff6f513410..0x7fff6f513418) object
when[0x7fff6f513412..0x7fff6f513418) is already mapped


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug middle-end/63246] OpenMP target: gimplifier produces unsuitable implicit map clauses if inside a data region
  2014-09-12 17:24 [Bug middle-end/63246] New: OpenMP target: gimplifier produces unsuitable implicit map clauses if inside a data region tschwinge at gcc dot gnu.org
@ 2014-09-12 18:49 ` jakub at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-09-12 18:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63246

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
IMNSHO this is just a buggy testcase, whether something is present in map
clauses on target data region matters only for the actual allocations, but not
for what map clauses are explicit or implicit on the target region.  I've
already earlier today commented on the IMHO invalid textcase from OpenMP 4.0.1
examples 56.3[cf] in the ticket discussing bugs in the Examples document.
If you don't want the implicit map(a) clause, you should provide the
map(a[1:N-1]) there (which will not map anything, because it is already mapped,
but will DTRT wrt. pointer translation).


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-12 18:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12 17:24 [Bug middle-end/63246] New: OpenMP target: gimplifier produces unsuitable implicit map clauses if inside a data region tschwinge at gcc dot gnu.org
2014-09-12 18:49 ` [Bug middle-end/63246] " jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).