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

            Bug ID: 94202
           Summary: lto1: internal compiler error: in
                    do_estimate_edge_time, at ipa-inline-analysis.c:222
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sbergman at redhat dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

At least with current GCC 10 trunk on Linux x86-64:

> $ cat test.cc
> struct S1 {
>   virtual ~S1();
>   virtual void v();
> };
> struct S2: S1 {};
> struct S3: S1, S2 { void v(); };
> struct S4: S3 { void v(); };
> void S4::v() { S3::v(); }
> struct R {
>   S1 * m;
>   void f(S2 * x) {
>     static_cast<S1 *>(x)->v();
>     x->v();
>     m = x;
>   }
> };
> void f() {
>   R r;
>   r.f(new S4);
>   r.f(new S3);
> }

> $ g++ -flto -fPIC -O2 -shared test.cc
> test.cc:6:8: warning: direct base ‘S1’ inaccessible in ‘S3’ due to ambiguity 
> [-Winaccessible-base]
>     6 | struct S3: S1, S2 { void v(); };
>       |        ^~
> during IPA pass: inline
> lto1: internal compiler error: in do_estimate_edge_time, at 
> ipa-inline-analysis.c:222
> 0x63483d do_estimate_edge_time(cgraph_edge*, sreal*)
>         ../../src/gcc/ipa-inline-analysis.c:222
> 0xa6edc0 do_estimate_edge_size(cgraph_edge*)
>         ../../src/gcc/ipa-inline-analysis.c:318
> 0x15bb63e estimate_edge_size
>         ../../src/gcc/ipa-inline.h:78
> 0x15bb63e inline_small_functions
>         ../../src/gcc/ipa-inline.c:2052
> 0x15bb63e ipa_inline
>         ../../src/gcc/ipa-inline.c:2685
> 0x15bb63e execute
>         ../../src/gcc/ipa-inline.c:3087
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See <https://gcc.gnu.org/bugs/> for instructions.
> lto-wrapper: fatal error: /data/sbergman/gcc/trunk/inst/bin/g++ returned 1 
> exit status
> compilation terminated.
> /usr/bin/ld: error: lto-wrapper failed
> collect2: error: ld returned 1 exit status

What makes that

>               gcc_assert (chk_size == size && chk_time == time
>                           && chk_nonspec_time == nonspec_time
>                           && chk_hints == hints);

trigger is chk_hints=32 (i.e., INLINE_HINT_declared_inline) vs. hints=33 (i.e.,
INLINE_HINT_indirect_call|INLINE_HINT_declared_inline).

I don't know whether this is related to bug 92508, but that is claimed to be
fixed since November 2019.

Reply via email to