From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 498863858009; Sat, 13 Feb 2021 13:26:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 498863858009 From: "crillion at tiscali dot it" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99086] New: including and defaulting spaceship operator causes compiler segfault Date: Sat, 13 Feb 2021 13:26:15 +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: 10.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: crillion at tiscali dot it 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2021 13:26:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99086 Bug ID: 99086 Summary: including and defaulting spaceship operator causes compiler segfault Product: gcc Version: 10.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: crillion at tiscali dot it Target Milestone: --- Created attachment 50178 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50178&action=3Dedit an archive containing .ii and .s files for windows and linux Hi, a little program with a tiny class defaulting the spaceship operator and = the inclusion of header causes compiler segfault (the compiler gives segmentation error while compiling, no executable is produced). I could see this behaviour on these systems : (windows 10 64bit) (it's the g++ 10.2 from mingw-w64 distribution obtained by msys2) g++ --version g++ (Rev6, Built by MSYS2 project) 10.2.0 (linux opensuse 15.2 64bit, hosted on virtual box 6.1.16 r140961 (Qt5.6.2), running on my above windows system) > g++ --version g++ (SUSE Linux) 10.2.1 20200825 [revision c0746a1beb1ba073c7981eb09f55b3d993b32e5c] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D program.cpp : ------------------ #include class value_wrapper { public : bool operator<=3D>(const value_wrapper& rhs) const =3D defa= ult; private : unsigned short value_; }; int main(int, char**) { value_wrapper lhs, rhs; auto x =3D lhs < rhs; } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D batch file used to compile it (already including your recommended switches = in bug reporting instructions, which turn out not to mitigate the segfault err= or) windows : g++ -std=3Dc++20 -pedantic -Wall -Wextra -Werror=3Dreturn-type -Wshadow=3Dl= ocal -Wempty-body -fdiagnostics-color -s -Os -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations program.cpp -save-temps -o program_gpp.e= xe linux : g++ -std=3Dc++20 -pedantic -Wall -Wextra -Werror=3Dreturn-type -Wshadow=3Dl= ocal -Wempty-body -fdiagnostics-color -s -Os -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations program.cpp -save-temps -o program_gpp I add as attachment a 7zip archive containing the requested .ii and .s files respectively for the windows and linux compilation: program.ii.linux program.ii.windows program.s.linux program.s.windows I was originally using a field of type boost gregorian date, which in turn causes inclusion of . I could reduce boost include files just to = the inclusion of Sorry but I didn't reduce, nor inspect the header, since I consi= der standard library headers too complicated for me to analyze. Thanks, Marco=