From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 75ECC3857027; Thu, 17 Feb 2022 17:02:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75ECC3857027 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/104563] [OpenMP] ICE in install_var_field, at omp-low.cc:810 (multi map of same var) Date: Thu, 17 Feb 2022 17:02:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: jakub 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: Message-ID: In-Reply-To: References: 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: Thu, 17 Feb 2022 17:02:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104563 --- Comment #1 from Jakub Jelinek --- Trying the hopefully matching rewrite of the test into C/C++: void foo (void) { int x, scalar; int a[10]; struct S { int var; int b[10]; } test_struct; int i; test_struct.var =3D 1; for (i =3D 0; i < 10; i++) { a[i] =3D 42; test_struct.b[i] =3D 42; } scalar =3D 80; #pragma omp target map(alloc: scalar, a, test_struct) map(to: scalar, a, test_struct) if (scalar !=3D 80 || a[1] !=3D 42 || test_struct.var !=3D 1 || test_stru= ct.b[1] !=3D 42) __builtin_abort (); } is right now rejected by GCC: pr104563.c: In function =E2=80=98void foo()=E2=80=99: pr104563.c:15:44: error: =E2=80=98test_struct=E2=80=99 appears more than on= ce in map clauses 15 | #pragma omp target map(alloc: scalar, a, test_struct) map(to: sca= lar, a, test_struct) | ^~~~~~~~~~~ pr104563.c:15:41: error: =E2=80=98a=E2=80=99 appears more than once in map = clauses 15 | #pragma omp target map(alloc: scalar, a, test_struct) map(to: sca= lar, a, test_struct) | ^ pr104563.c:15:33: error: =E2=80=98scalar=E2=80=99 appears more than once in= map clauses 15 | #pragma omp target map(alloc: scalar, a, test_struct) map(to: sca= lar, a, test_struct) | ^~~~~~ I agree it is invalid OpenMP 4.5, valid in OpenMP 5.0. But as we clearly don't support it for C/C++, IMHO we shouldn't support it = for Fortran either, especially when the support in the middle-end for it isn't there yet (other= wise it wouldn't ICE).=