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

            Bug ID: 86323
           Summary: [9 regression]  internal compiler error: in
                    estimate_edge_growth, at ipa-inline.h:85
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: skpgkp1 at gmail dot com
  Target Milestone: ---

This issue appear while compiling HHVM Symbolizer.cpp

GCC 9 regressed with ICE, GCC 8 works fine.

Reproducer:
===========

$ cat Symbolizer.cpp.i
namespace a {
template <class ae> class af {
public:
  af(ae);
};
typedef af<char *> b;
namespace ag {
class ah {
public:
  void ai(b aj) { c(aj); }
  virtual void c(b);
};
class d : public ah {
  void c(b);
};
class e {
  void f(bool);
  void ai(b aj) { g.ai(aj); }
  d g;
};
void d::c(b) {}
void e::f(bool) { ai(""); }
} // namespace ag
} // namespace a

GCC 9 Fail with ICE
===================

$g++ --version
g++ (GCC) 9.0.0 20180621 (experimental)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++ -O3 --param max-early-inliner-iterations=50 -o Symbolizer.cpp.i.o -c
Symbolizer.cpp.i -Wno-write-strings
during GIMPLE pass: einline
Symbolizer.cpp.i: In member function ‘void a::ag::e::ai(a::b)’:
Symbolizer.cpp.i:24:1: internal compiler error: in estimate_edge_growth, at
ipa-inline.h:85
 } // namespace a
 ^
0x6f0fa6 estimate_edge_growth
        ../../gcc-main.3VD9/gcc/ipa-inline.h:85
0x6f0fa6 estimate_size_after_inlining(cgraph_node*, cgraph_edge*)
        ../../gcc-main.3VD9/gcc/ipa-inline-analysis.c:271
0x167a3c4 caller_growth_limits
        ../../gcc-main.3VD9/gcc/ipa-inline.c:186
0x167a3c4 can_inline_edge_by_limits_p
        ../../gcc-main.3VD9/gcc/ipa-inline.c:419
0x167b74f early_inline_small_functions
        ../../gcc-main.3VD9/gcc/ipa-inline.c:2681
0x167b74f early_inliner(function*)
        ../../gcc-main.3VD9/gcc/ipa-inline.c:2793
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.


GCC 8 works fine
================

$g++ --version
g++ (GCC) 8.1.1 20180621
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++ -O3 --param max-early-inliner-iterations=50 -o Symbolizer.cpp.i.o -c
Symbolizer.cpp.i -Wno-write-strings
$ echo $?
0

Reply via email to