public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99086] New: including <iterator> and defaulting spaceship operator causes compiler segfault
@ 2021-02-13 13:26 crillion at tiscali dot it
  2021-02-14 20:50 ` [Bug c++/99086] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: crillion at tiscali dot it @ 2021-02-13 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99086
           Summary: including <iterator> 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=50178&action=edit
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 <iterator> 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]

==============
program.cpp :
------------------


#include <iterator>

class value_wrapper
{
        public :

                bool operator<=>(const value_wrapper& rhs) const = default;

        private :

                unsigned short value_;
};

int main(int, char**)
{
        value_wrapper lhs, rhs;

        auto x = lhs < rhs;
}

=================================
batch file used to compile it (already including your recommended switches in
bug reporting instructions, which turn out not to mitigate the segfault error)

windows :

g++ -std=c++20 -pedantic -Wall -Wextra -Werror=return-type -Wshadow=local
-Wempty-body -fdiagnostics-color -s -Os -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations program.cpp -save-temps -o program_gpp.exe

linux :
g++ -std=c++20 -pedantic -Wall -Wextra -Werror=return-type -Wshadow=local
-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 <iterator>. I could reduce boost include files just to the
inclusion of <iterator>
Sorry but I didn't reduce, nor inspect the <iterator> header, since I consider
standard library headers too complicated for me to analyze.

Thanks,
           Marco

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

end of thread, other threads:[~2021-04-13 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-13 13:26 [Bug c++/99086] New: including <iterator> and defaulting spaceship operator causes compiler segfault crillion at tiscali dot it
2021-02-14 20:50 ` [Bug c++/99086] " redi at gcc dot gnu.org
2021-02-14 20:55 ` redi at gcc dot gnu.org
2021-04-13 17:13 ` redi 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).