From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4F49F3858C50; Wed, 26 Oct 2022 16:17:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F49F3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666801052; bh=oTLfvfkmgB01hBXOJOFk6mF7zwJPAju49Jv07lEelNc=; h=From:To:Subject:Date:From; b=FEzSkMr909j8sLaZW31j9fFvMqapNOpUJYNT1nheIypCGaCJreghfJGvaHeATa/Um rQDsX3oH5DNsvVp34p1r6//eHai062f4emBSqzJaK31gXbqooT9uTjNw4dGldMSPVI FReL0o+CQEVaaEKTfQ0yijSWg4pPXziq+dHRjj3w= From: "volker.weissmann at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/107418] New: lto-dump -gimple-stats Segmentation Fault Date: Wed, 26 Oct 2022 16:17:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: volker.weissmann at gmx dot 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 cc target_milestone 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=3D107418 Bug ID: 107418 Summary: lto-dump -gimple-stats Segmentation Fault Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: volker.weissmann at gmx dot de CC: marxin at gcc dot gnu.org Target Milestone: --- I don't understand what -gimple-stats does, but I don't think it should segfault: $ g++ bug.cpp -c -flto && lto-dump bug.o -gimple-stats during IPA pass: modref lto-dump: internal compiler error: Segmentation fault 0x1788bc4 internal_error(char const*, ...) ???:0 0x6e8ba3 cgraph_node::get_untransformed_body() ???:0 0x67ebd7 lto_main() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. bug.cpp: class MyClass { public: MyClass(){} }; void func() { new MyClass(); } I used the gcc from the Archlinux repository: $ g++ -v=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Using built-in specs. COLLECT_GCC=3Dg++ COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --enable-languages=3Dc,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-boots= trap --prefix=3D/usr --libdir=3D/usr/lib --libexecdir=3D/usr/lib --mandir=3D/usr= /share/man --infodir=3D/usr/share/info --with-bugurl=3Dhttps://bugs.archlinux.org/ --with-build-config=3Dbootstrap-lto --with-linker-hash-style=3Dgnu --with-system-zlib --enable-__cxa_atexit --enable-cet=3Dauto --enable-checking=3Drelease --enable-clocale=3Dgnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-obj= ect --enable-libstdcxx-backtrace --enable-link-serialization=3D1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=3Dposix --disable-libssp --disable-libstdc= xx-pch --disable-werror Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (GCC)=20 If I build gcc myself, I get a backtrace with line numbers: $ g++ bug.cpp -c -flto && lto-dump bug.o -gimple-stats=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 /home/volker/Documents/localgcc/../gcc/gcc/cgraph.cc:4001:23: runtime error: member access within null pointer of type 'struct lto_in_decl_state' during IPA pass: modref lto-dump: internal compiler error: Segmentation fault 0x2e693dd crash_signal /home/volker/Documents/localgcc/../gcc/gcc/toplev.cc:314 0x10203df cgraph_node::get_untransformed_body() /home/volker/Documents/localgcc/../gcc/gcc/cgraph.cc:4001 0xbd1cee lto_main() /home/volker/Documents/localgcc/../gcc/gcc/lto/lto-dump.cc:350 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Self-build-gcc: $ g++ -v=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Using built-in specs. COLLECT_GCC=3Dg++ COLLECT_LTO_WRAPPER=3D/home/volker/Documents/myroot/libexec/gcc/x86_64-pc-l= inux-gnu/13.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /home/volker/Documents/localgcc/../gcc/configure --enable-checking --disable-bootstrap --prefix=3D/home/volker/Documents/myr= oot Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.0.0 20221023 (experimental) (GCC)=