public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "j.reuter@fz-juelich.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/114572] New: [OpenMP] "internal compiler error: in assign_temp" with assignment operator and lastprivate clause
Date: Wed, 03 Apr 2024 09:41:09 +0000	[thread overview]
Message-ID: <bug-114572-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 114572
           Summary: [OpenMP] "internal compiler error: in assign_temp"
                    with assignment operator and lastprivate clause
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: j.reuter@fz-juelich.de
  Target Milestone: ---

Created attachment 57859
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57859&action=edit
Preprocessed output GCC 13 (Fedora)

Using the following source code, GCC 11 and 12 on Ubuntu 22.04 and 13 on Fedora
39 abort with an internal compiler error. I was also able to reproduce the
issue on Godbolt with GCC trunk:


struct c1
{
    ~c1(){}
    c1 operator=(const c1& other)
    {
        return *this;
    }
};

int main( void )
{
    c1 c;
    #pragma omp parallel for lastprivate(c)
    for(int i = 0; i < 10; ++i){}
}


Compiling the code with:
g++ -fopenmp gcc-error.cpp


fails with:
during RTL pass: expand
gcc-error.cpp: In function ‘main._omp_fn.0’:
gcc-error.cpp:16:5: internal compiler error: in assign_temp, at function.cc:988
   16 |     for(int i = 0; i < 10; ++i){}
      |     ^~~
Please submit a full bug report, with preprocessed source.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/cck1AuEN.out file, please attach this to
your bugreport.


Removing both the copy constructor and destructor fixes the issue. Adding
either of them independently causes the error to appear. The log file is
attached.

Godbolt: https://godbolt.org/z/nMve88eEo

             reply	other threads:[~2024-04-03  9:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03  9:41 j.reuter@fz-juelich.de [this message]
2024-04-03 11:28 ` [Bug c++/114572] " jakub at gcc dot gnu.org
2024-04-03 17:17 ` pinskia at gcc dot gnu.org
2024-04-04 14:49 ` jakub at gcc dot gnu.org
2024-04-05  7:34 ` cvs-commit at gcc dot gnu.org
2024-04-21  4:08 ` cvs-commit at gcc dot gnu.org
2024-04-23  6:45 ` jakub 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-114572-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).