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 middle-end/104563] New: [OpenMP] ICE in install_var_field, at omp-low.cc:810 (multi map of same var)
Date: Wed, 16 Feb 2022 10:05:27 +0000	[thread overview]
Message-ID: <bug-104563-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 104563
           Summary: [OpenMP] ICE in install_var_field, at omp-low.cc:810
                    (multi map of same var)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Found in
https://github.com/SOLLVE/sollve_vv/blob/master/tests/5.0/target/test_target_mapping_before_alloc.F90
(See also https://github.com/SOLLVE/sollve_vv/issues/464 )

Compiling that testcase with GCC gfortran (7, 8, 9, 10, 11 and) mainline fails
as follows.

I think the problem is that scalar/a/test_struct appear multiple times, which
is invalid in OpenMP 4.5 but valid since 5.0.

Thus, the solution for 4.5 would be to diagnose this - and for 5.0 to accept
this.


tests/5.0/target/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.cc:810
0x732767 install_var_field
        ../../repos/gcc/gcc/omp-low.cc:810
0xeafbce scan_sharing_clauses
        ../../repos/gcc/gcc/omp-low.cc:1622
0xeb0feb scan_omp_target
        ../../repos/gcc/gcc/omp-low.cc:3050
0xeb221b scan_omp_1_stmt
        ../../repos/gcc/gcc/omp-low.cc:4241


Slightly reduced testcase:

SUBROUTINE foo
    INTEGER :: x, scalar
    INTEGER, DIMENSION(10) :: a

    TYPE structure
       INTEGER :: var
       INTEGER,DIMENSION(10) :: b
    END TYPE structure
    TYPE(structure) :: test_struct
    test_struct%var = 1
    a(:) = 42
    test_struct%b(:) = 42
    scalar = 80

    !$omp target map(alloc: scalar, a, test_struct) map(to: scalar, a,
test_struct)
      if (scalar /= 80 .OR. a(2) .ne. 42 .OR. test_struct%var /= 1 .OR.
test_struct%b(2) /= 42) stop 1
    !$omp end target
END

             reply	other threads:[~2022-02-16 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 10:05 burnus at gcc dot gnu.org [this message]
2022-02-17 17:02 ` [Bug middle-end/104563] " jakub at gcc dot gnu.org

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-104563-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).