public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99400] New: OpenMP: ICE in install_var_field, at omp-low.c:789 with "map(alloc: A) map(to: A)"
@ 2021-03-05  7:39 burnus at gcc dot gnu.org
  2021-07-20 16:56 ` [Bug fortran/99400] " gscfq@t-online.de
  0 siblings, 1 reply; 2+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-05  7:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

* [Bug fortran/99400] OpenMP: ICE in install_var_field, at omp-low.c:789 with "map(alloc: A) map(to: A)"
  2021-03-05  7:39 [Bug fortran/99400] New: OpenMP: ICE in install_var_field, at omp-low.c:789 with "map(alloc: A) map(to: A)" burnus at gcc dot gnu.org
@ 2021-07-20 16:56 ` gscfq@t-online.de
  0 siblings, 0 replies; 2+ messages in thread
From: gscfq@t-online.de @ 2021-07-20 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

G. Steinmetz <gscfq@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gscfq@t-online.de

--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---

Additional test case :

$ cat z1.f90
program p
   integer :: i, n = 2
   !$omp target map(n, n)
   i = n
   !$omp end target
end

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

end of thread, other threads:[~2021-07-20 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05  7:39 [Bug fortran/99400] New: OpenMP: ICE in install_var_field, at omp-low.c:789 with "map(alloc: A) map(to: A)" burnus at gcc dot gnu.org
2021-07-20 16:56 ` [Bug fortran/99400] " gscfq@t-online.de

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