public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/100010] New: ICE in lto_output_node, at lto-cgraph.c:447 (-fdevirtualize-at-ltrans)
@ 2021-04-10  1:36 alex.miller at gmx dot de
  2021-04-11 18:56 ` [Bug lto/100010] [8/9/10/11 Regression] ICE in lto_output_node, at lto-cgraph.c:447 (-fdevirtualize-at-ltrans) since r6-6384-gceda2c69d5219719 marxin at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: alex.miller at gmx dot de @ 2021-04-10  1:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100010
           Summary: ICE in lto_output_node, at lto-cgraph.c:447
                    (-fdevirtualize-at-ltrans)
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alex.miller at gmx dot de
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Building lcdf-typetools-2.108 fails with an ICE while linking the mmafm tool
(with gcc-10 using the flags "-O3 -flto -fdevirtualize-at-ltrans").

Here's a reduced sample that reproduces the issue (even with -O2):
---
struct String {
        String(char);
        ~String();
};
struct ErrorHandler {
        virtual String decorate(const String &);
};
String ErrorHandler::decorate(const String &str) {
        decorate(str);
        return 0;
}
struct LandmarkErrorHandler : ErrorHandler {
        String _landmark;
        LandmarkErrorHandler();
        String decorate(const String &);
};
String LandmarkErrorHandler::decorate(const String &) {
        return ErrorHandler::decorate(0);
}
struct Charstring {
        virtual ~Charstring();
        virtual void process() = 0;
} *interpret_cs;
Charstring::~Charstring() {}
struct : Charstring {
        void process() {}
} _cdv;
int main() {
        LandmarkErrorHandler();
        interpret_cs->process();
}
---

$ g++ -O2 -flto -fdevirtualize-at-ltrans a.cc
during IPA pass: static-var
lto1: internal compiler error: in lto_output_node, at lto-cgraph.c:447
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Reducing the sources seems a bit brittle, like often with LTO:
* Combining all sources in a single file changed the error message to
  "lto1: internal compiler error: Segmentation fault", but minimizing made
  the error location reappear. The result is very similar to a multi-file
  reduction.
* Reduced sample fails with -O2, full sources need -O3.
* With g++-9.3.0 the reduced sample doesn't trigger the ICE, but the original
  sources do (at lto-cgraph.c:453).
Let me know if you need another sample.

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

end of thread, other threads:[~2023-07-07 10:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-10  1:36 [Bug lto/100010] New: ICE in lto_output_node, at lto-cgraph.c:447 (-fdevirtualize-at-ltrans) alex.miller at gmx dot de
2021-04-11 18:56 ` [Bug lto/100010] [8/9/10/11 Regression] ICE in lto_output_node, at lto-cgraph.c:447 (-fdevirtualize-at-ltrans) since r6-6384-gceda2c69d5219719 marxin at gcc dot gnu.org
2021-04-12  8:14 ` rguenth at gcc dot gnu.org
2021-04-12  9:58 ` hubicka at gcc dot gnu.org
2021-05-14  9:54 ` [Bug lto/100010] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:20 ` rguenth at gcc dot gnu.org
2022-02-11  7:07 ` xry111 at mengyan1223 dot wang
2022-05-27  9:44 ` [Bug lto/100010] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:44 ` jakub at gcc dot gnu.org
2022-08-16  8:03 ` yinyuefengyi at gmail dot com
2023-07-07 10:39 ` [Bug lto/100010] [11/12/13/14 " rguenth 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).