From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 80B8B3854816; Wed, 5 May 2021 12:26:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80B8B3854816 From: "gavrilikhin.daniil at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100433] New: [modules] segfault with optimization greater than -O0 Date: Wed, 05 May 2021 12:26:48 +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: 11.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gavrilikhin.daniil at gmail dot com 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: Wed, 05 May 2021 12:26:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100433 Bug ID: 100433 Summary: [modules] segfault with optimization greater than -O0 Product: gcc Version: 11.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gavrilikhin.daniil at gmail dot com Target Milestone: --- Created attachment 50760 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50760&action=3Dedit 2 preprocessed files This code that uses modules with -O0 works well, but with -O1, -O2, or -O3 produces segfault.=20 No flags were helpful (and -fsanitize=3Dundefined does not work with module= s. There's already a bug report for it, however). P.S: Tried it without modules - worked well with any optimization level.=20 P.P.S: Additional info: the exact version of GCC: 11.1.1 20210428 (GCC) the system type: Ubuntu 21.04 hirsute the options given when GCC was configured/built: (Default Ubuntu 21.04 g++-= 11) ../configure -v --with-bugurl=3Dfile:///usr/share/doc/gcc-11/README.Bugs --enable-languages=3Dc,c++,go,objc,obj-c++ --prefix=3D/usr --with-gcc-major-version-only --program-suffix=3D-11 --program-prefix=3Dx86_64-linux-gnu- --enable-shared --enable-linker-build-= id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls --enable-clocale=3Dgnu --enable-libstdcxx-= debug --enable-libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=3Drelea= se --with-target-system-zlib=3Dauto --enable-objc-gc=3Dauto --enable-multiarch --disable-werror --with-arch-32=3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx32 --enable-multilib --with-tune=3Dgeneric --without-cuda-driver --enable-checking=3Drelease --build=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu the complete command line that triggers the bug: g++-11 -g -O3 -std=3Dc++20 -fmodules-ts -Wall -Wextra -Wpedantic -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations oauth2.cpp main.cpp the compiler output (error messages, warnings, etc.):=20 Nothing at compile time. Segmentation fault (core dumped) at runtime=