public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114572] New: [OpenMP] "internal compiler error: in assign_temp" with assignment operator and lastprivate clause
@ 2024-04-03  9:41 j.reuter@fz-juelich.de
  2024-04-03 11:28 ` [Bug c++/114572] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: j.reuter@fz-juelich.de @ 2024-04-03  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-23  6:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03  9:41 [Bug c++/114572] New: [OpenMP] "internal compiler error: in assign_temp" with assignment operator and lastprivate clause j.reuter@fz-juelich.de
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

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).