From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 713A63847718; Wed, 3 Apr 2024 09:41:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 713A63847718 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712137270; bh=HGylAsrcmn1MzepEUlOcPTlt/PacvfdxuVu8yP6pAlI=; h=From:To:Subject:Date:From; b=JzAGYjEF3u2TMMorDeJOMe7MqGqIJRhtGxwqzfvOxcWbNWds8FX8PJEQo3vqJxZYk XWhLOVwszXLUEI3GXMI/YdG4coUzPTZ0eykG+CrZWKNPzObJztZXKxwaVQzOoAcpT1 LmEfz/27w6cdrNMUKrK/bHq002KsJlHWNV7r4sfs= From: "j.reuter@fz-juelich.de" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: j.reuter@fz-juelich.de 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114572 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=3D57859&action=3Dedit Preprocessed output GCC 13 (Fedora) Using the following source code, GCC 11 and 12 on Ubuntu 22.04 and 13 on Fe= dora 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=3D(const c1& other) { return *this; } }; int main( void ) { c1 c; #pragma omp parallel for lastprivate(c) for(int i =3D 0; i < 10; ++i){} } Compiling the code with: g++ -fopenmp gcc-error.cpp fails with: during RTL pass: expand gcc-error.cpp: In function =E2=80=98main._omp_fn.0=E2=80=99: gcc-error.cpp:16:5: internal compiler error: in assign_temp, at function.cc= :988 16 | for(int i =3D 0; i < 10; ++i){} | ^~~ Please submit a full bug report, with preprocessed source. See 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=