From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A9F093858D37; Wed, 16 Feb 2022 10:05:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9F093858D37 From: "burnus at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2022 10:05:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104563 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_targe= t_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 fa= ils as follows. I think the problem is that scalar/a/test_struct appear multiple times, whi= ch 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 =3D 1 a(:) =3D 42 test_struct%b(:) =3D 42 scalar =3D 80 !$omp target map(alloc: scalar, a, test_struct) map(to: scalar, a, test_struct) if (scalar /=3D 80 .OR. a(2) .ne. 42 .OR. test_struct%var /=3D 1 .OR. test_struct%b(2) /=3D 42) stop 1 !$omp end target END=