public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/99400] New: OpenMP: ICE in install_var_field, at omp-low.c:789 with "map(alloc: A) map(to: A)"
Date: Fri, 05 Mar 2021 07:39:26 +0000	[thread overview]
Message-ID: <bug-99400-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 99400
           Summary: OpenMP: ICE in install_var_field, at omp-low.c:789
                    with "map(alloc: A) map(to: A)"
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: openmp, patch
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

SOLLVE_VV Fortran test – this one is
https://github.com/SOLLVE/sollve_vv/pull/306

TRACKING: Patch exists on a branch (and was possibly submitted for mainline at
some point) – but it is not yet on mainline.

The testcase does "map(alloc: A) map(to: A)" which should be valid OpenMP 5 and
invalid OpenMP 4.5


The C testcase fails on *mainline* with:

tests/5.0/target/test_target_mapping_before_alloc.c:40:41: error: ‘a’ appears
more than once in map clauses

On the *OG10* (devel/omp/gcc-10) branch, the C and Fortran testcases compile.
(I have no done a run-time check.) Hence, one of Chung-Lin's mapping patches
did fix it...

TODO: Wait until it lands and then commit a Fortran testcase as well.


On mainline, gfortran fails as follows:

gfortran -fopenmp -I ompvv test_target_mapping_before_alloc.F90

during GIMPLE pass: omplower
test_target_mapping_before_alloc.F90:51:43:

   51 |     !$omp& test_struct) map(tofrom: errors)
      |                                           ^
internal compiler error: in install_var_field, at omp-low.c:789
0x6ed020 install_var_field
        ../../repos/gcc/gcc/omp-low.c:789
0xe06466 scan_sharing_clauses
        ../../repos/gcc/gcc/omp-low.c:1543
0xe07cdb scan_omp_target
        ../../repos/gcc/gcc/omp-low.c:2946
0xe08c14 scan_omp_1_stmt
        ../../repos/gcc/gcc/omp-low.c:4029


 * * *

    INTEGER :: errors, x, scalar
    INTEGER,DIMENSION(N) :: a

    TYPE structure
       INTEGER :: var
       INTEGER,DIMENSION(N) :: b
    END TYPE structure
    TYPE(structure) :: test_struct
    test_struct%var = 1

    DO x = 1, N
       a(x) = x
       test_struct%b(x) = x
    END DO

    scalar = 80
    errors = 0

    !$omp target map(alloc: scalar, a, test_struct) map(to: scalar, a, &
    !$omp& test_struct) map(tofrom: errors)
    IF (scalar .ne. 80 .OR. a(2) .ne. 2 .OR. test_struct%var .ne. 1 &
         & .OR. test_struct%b(2) .ne. 2) THEN
       errors = errors + 1
    END IF
    !$omp end target

             reply	other threads:[~2021-03-05  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05  7:39 burnus at gcc dot gnu.org [this message]
2021-07-20 16:56 ` [Bug fortran/99400] " gscfq@t-online.de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99400-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).