From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8323F3858405; Thu, 21 Oct 2021 16:42:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8323F3858405 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102854] [OpenMP] Bogus "initializer expression refers to iteration variable" when using templates Date: Thu, 21 Oct 2021 16:42:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: openmp, rejects-valid 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: attachments.created 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, 21 Oct 2021 16:42:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102854 --- Comment #2 from Jakub Jelinek --- Created attachment 51647 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51647&action=3Dedit gcc12-pr102854-wip.patch WIP patch. Clearly still more work is needed, apparently pointer iterators in non-rectangular loops are rejected, like: void foo () { int a[1024]; int *p, *q; #pragma omp parallel for collapse(2) for (p =3D &a[0]; p < &a[512]; p++) for (q =3D p + 64; q < p + 128; q++) ; } and enabling it result in ICEs during omp-expand.c. Furthermore, for both pointer and random access iterator non-rect loops, I should verify we only allow the var-outer, var-outer + a2, a2 + var-outer and var-outer - a2 forms and no others and test code generation.=