public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/102854] [OpenMP] Bogus "initializer expression refers to iteration variable" when using templates
Date: Wed, 27 Oct 2021 07:28:56 +0000	[thread overview]
Message-ID: <bug-102854-4-5wNlQyoXhd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102854-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:6b0f35299bd1468ebc13b900a73b7cac6181a2aa

commit r12-4732-g6b0f35299bd1468ebc13b900a73b7cac6181a2aa
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Oct 27 09:16:48 2021 +0200

    openmp: Don't reject some valid initializers or conditions of
non-rectangular loops [PR102854]

    In C++, if an iterator has or might have (e.g. dependent type) class type
we
    remember the original init expressions and check those separately for
presence
    of iterators, because for class iterators we turn those into expressions
that
    always do contain reference to the current iterator.  But this resulted in
    rejecting valid non-rectangular loop where the dependent type is later
instantiated
    to an integral type.

    Non-rectangular loops with class random access iterators remain broken,
that is something
    to be fixed incrementally.

    2021-10-27  Jakub Jelinek  <jakub@redhat.com>

            PR c++/102854
    gcc/c-family/
            * c-common.h (c_omp_check_loop_iv_exprs): Add enum tree_code
argument.
            * c-omp.c (c_omp_check_loop_iv_r): For trees other than decls,
            TREE_VEC, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, POINTER_PLUS_EXPR or
            conversions temporarily clear the 3rd bit from d->kind while
walking
            subtrees.
            (c_omp_check_loop_iv_exprs): Add CODE argument.  Or in 4 into
data.kind
            if possibly non-rectangular.
    gcc/cp/
            * semantics.c (handle_omp_for_class_iterator,
            finish_omp_for): Adjust c_omp_check_loop_iv_exprs caller.
    gcc/testsuite/
            * g++.dg/gomp/loop-3.C: Don't expect some errors.
            * g++.dg/gomp/loop-7.C: New test.

  parent reply	other threads:[~2021-10-27  7:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20  9:43 [Bug c++/102854] New: " burnus at gcc dot gnu.org
2021-10-20 11:40 ` [Bug c++/102854] " burnus at gcc dot gnu.org
2021-10-21 16:42 ` jakub at gcc dot gnu.org
2021-10-27  7:28 ` cvs-commit at gcc dot gnu.org [this message]
2023-07-14 15:29 ` burnus at gcc dot gnu.org
2023-07-21 10:34 ` burnus 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-102854-4-5wNlQyoXhd@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).