public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/107418] New: lto-dump -gimple-stats Segmentation Fault
@ 2022-10-26 16:17 volker.weissmann at gmx dot de
  2022-10-26 16:23 ` [Bug lto/107418] " volker.weissmann at gmx dot de
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: volker.weissmann at gmx dot de @ 2022-10-26 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

            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 <https://bugs.archlinux.org/> for instructions.

bug.cpp:
class MyClass  {
  public:
  MyClass(){}
};
void func() {
  new MyClass();
}

I used the gcc from the Archlinux repository:
$ g++ -v                                                                        
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/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=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-build-config=bootstrap-lto --with-linker-hash-style=gnu
--with-system-zlib --enable-__cxa_atexit --enable-cet=auto
--enable-checking=release --enable-clocale=gnu --enable-default-pie
--enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object
--enable-libstdcxx-backtrace --enable-link-serialization=1
--enable-linker-build-id --enable-lto --enable-multilib --enable-plugin
--enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (GCC) 

If I build gcc myself, I get a backtrace with line numbers:
$ g++ bug.cpp -c -flto && lto-dump bug.o -gimple-stats                          
/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 <https://gcc.gnu.org/bugs/> for instructions.

Self-build-gcc:
$ g++ -v                                                                        
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/volker/Documents/myroot/libexec/gcc/x86_64-pc-linux-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=/home/volker/Documents/myroot
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20221023 (experimental) (GCC)

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

* [Bug lto/107418] lto-dump -gimple-stats Segmentation Fault
  2022-10-26 16:17 [Bug lto/107418] New: lto-dump -gimple-stats Segmentation Fault volker.weissmann at gmx dot de
@ 2022-10-26 16:23 ` volker.weissmann at gmx dot de
  2022-10-27  8:14 ` [Bug lto/107418] lto-dump -gimple-stats ICE " marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: volker.weissmann at gmx dot de @ 2022-10-26 16:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Volker Weißmann <volker.weissmann at gmx dot de> ---
If you don't like that I enabled -flto, but disabled the optimizer, tell me,
then I minify another example that triggers the same segfault, even if -Os is
given.

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

* [Bug lto/107418] lto-dump -gimple-stats ICE Segmentation Fault
  2022-10-26 16:17 [Bug lto/107418] New: lto-dump -gimple-stats Segmentation Fault volker.weissmann at gmx dot de
  2022-10-26 16:23 ` [Bug lto/107418] " volker.weissmann at gmx dot de
@ 2022-10-27  8:14 ` marxin at gcc dot gnu.org
  2022-10-27  8:32 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-27  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-10-27
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Mine, thanks for the bug report.

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

* [Bug lto/107418] lto-dump -gimple-stats ICE Segmentation Fault
  2022-10-26 16:17 [Bug lto/107418] New: lto-dump -gimple-stats Segmentation Fault volker.weissmann at gmx dot de
  2022-10-26 16:23 ` [Bug lto/107418] " volker.weissmann at gmx dot de
  2022-10-27  8:14 ` [Bug lto/107418] lto-dump -gimple-stats ICE " marxin at gcc dot gnu.org
@ 2022-10-27  8:32 ` cvs-commit at gcc dot gnu.org
  2022-10-27  8:33 ` marxin at gcc dot gnu.org
  2022-10-27  8:33 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-27  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:be6c75547385c69706370f4e792b04295f708a5a

commit r13-3523-gbe6c75547385c69706370f4e792b04295f708a5a
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Oct 27 10:29:17 2022 +0200

    lto: do not load LTO stream for aliases [PR107418]

            PR lto/107418

    gcc/lto/ChangeLog:

            * lto-dump.cc (lto_main): Do not load LTO stream for aliases.

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

* [Bug lto/107418] lto-dump -gimple-stats ICE Segmentation Fault
  2022-10-26 16:17 [Bug lto/107418] New: lto-dump -gimple-stats Segmentation Fault volker.weissmann at gmx dot de
                   ` (2 preceding siblings ...)
  2022-10-27  8:32 ` cvs-commit at gcc dot gnu.org
@ 2022-10-27  8:33 ` marxin at gcc dot gnu.org
  2022-10-27  8:33 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-27  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Martin Liska
<marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:ca0220d42e075194ca1341c98a0a9a9f3fd1c719

commit r12-8872-gca0220d42e075194ca1341c98a0a9a9f3fd1c719
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Oct 27 10:29:17 2022 +0200

    lto: do not load LTO stream for aliases [PR107418]

            PR lto/107418

    gcc/lto/ChangeLog:

            * lto-dump.cc (lto_main): Do not load LTO stream for aliases.

    (cherry picked from commit be6c75547385c69706370f4e792b04295f708a5a)

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed for GCC 12/13 releases.

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

* [Bug lto/107418] lto-dump -gimple-stats ICE Segmentation Fault
  2022-10-26 16:17 [Bug lto/107418] New: lto-dump -gimple-stats Segmentation Fault volker.weissmann at gmx dot de
                   ` (3 preceding siblings ...)
  2022-10-27  8:33 ` marxin at gcc dot gnu.org
@ 2022-10-27  8:33 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-27  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Martin Liska
<marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:ca0220d42e075194ca1341c98a0a9a9f3fd1c719

commit r12-8872-gca0220d42e075194ca1341c98a0a9a9f3fd1c719
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Oct 27 10:29:17 2022 +0200

    lto: do not load LTO stream for aliases [PR107418]

            PR lto/107418

    gcc/lto/ChangeLog:

            * lto-dump.cc (lto_main): Do not load LTO stream for aliases.

    (cherry picked from commit be6c75547385c69706370f4e792b04295f708a5a)

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed for GCC 12/13 releases.

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

end of thread, other threads:[~2022-10-27  8:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 16:17 [Bug lto/107418] New: lto-dump -gimple-stats Segmentation Fault volker.weissmann at gmx dot de
2022-10-26 16:23 ` [Bug lto/107418] " volker.weissmann at gmx dot de
2022-10-27  8:14 ` [Bug lto/107418] lto-dump -gimple-stats ICE " marxin at gcc dot gnu.org
2022-10-27  8:32 ` cvs-commit at gcc dot gnu.org
2022-10-27  8:33 ` marxin at gcc dot gnu.org
2022-10-27  8:33 ` cvs-commit 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).