public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/112763] New: [OpenMP] ICE in gimplify_adjust_omp_clauses, at gimplify.cc:13238 – with defaultmap(firstprivate) for C++ member variables
Date: Wed, 29 Nov 2023 13:13:10 +0000	[thread overview]
Message-ID: <bug-112763-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 112763
           Summary: [OpenMP] ICE in gimplify_adjust_omp_clauses, at
                    gimplify.cc:13238 – with defaultmap(firstprivate) for
                    C++ member variables
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Created attachment 56718
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56718&action=edit
Testcase; compile with 'g++ -fopenmp -DDEFAULT_FIRSTPRIVATE' for this PR or
without -D for PR110347

The following code uses a C++ member variable and 'defaultmap(firstprivate)'
causes an ICE.

I am not quite sure what the result should be but an ICE is surely wrong.

Vaguely related to OpenMP spec issue #3343, strongly related is my email today
to the omp-lang@ spec email list.

* * *

In member function ‘void myClass::tgt()’:
28:14: internal compiler error: in gimplify_adjust_omp_clauses, at
gimplify.cc:13238
   28 |      #pragma omp target defaultmap(firstprivate) private(d) if (0)
      |              ^~~


0x880609 gimplify_adjust_omp_clauses
        ../../repos/gcc-trunk-commit/gcc/gimplify.cc:13238
0x10094b4 gimplify_omp_workshare
        ../../repos/gcc-trunk-commit/gcc/gimplify.cc:15783


Compile the attached testcase with:
 g++ -fopenmp -DDEFAULT_FIRSTPRIVATE
Note: it compiles with  -DNON_MEMBER (and fails at runtime, which might be
correct).

See also PR 110347 for the case of unset DEFAULT_FIRSTPRIVATE, i.e. using
  firstprivate(member_var)  instead of   default{,map}(firstprivate)

                 reply	other threads:[~2023-11-29 13:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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-112763-4@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).