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

            Bug ID: 83125
           Summary: [8 regeression] ICE in edge_badness, at
                    ipa-inline.c:1025
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

r254663 PASS
r254924 FAIL
r255090 FAIL

sound similar to PR83001 and PR83051

PASS if I lower
-O level
  or
--param early-inlining-insns value
  or
--param max-early-inliner-iterations value
  or
remove -fPIC -DPIC

$ g++ -Werror -Wall -O2 --param early-inlining-insns=36 --param
max-early-inliner-iterations=20 -std=c++98 -c -fpreprocessed x.ii  -fPIC -DPIC
during IPA pass: inline
x.ii:43:10: internal compiler error: in edge_badness, at ipa-inline.c:1024
 t::~t() {}
          ^
0x9e3f48 edge_badness
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:1023
0x18e6859 update_edge_key
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:1223
0x18e6d98 update_caller_keys
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:1345
0x18e6cdb update_caller_keys
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:1334
0x18e819b inline_small_functions
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:2051
0x18e819b ipa_inline
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:2442
0x18e819b execute
        /home/dimhen/src/gcc_current/gcc/ipa-inline.c:2849
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.

$ cat x.ii
class a {
public:
  void b(int *);
};
struct c {
  c *d;
};
struct G : c {
  int *e();
};
template <typename> struct f {
  typedef G *h;
  a i();
  void j();
  h k;
  void l() {
    int m = *k->e();
    i().b(&m);
    j();
  }
  void n(h);
  ~f() {
    G o;
    n(&o);
  }
};
template <typename g> void f<g>::n(h p) {
  h q, r = 0;
  while (p) {
    q = h(p->d);
    n(q);
  }
  l();
  p = r;
}
struct D {
  f<int> s;
};
struct t {
  ~t();
  D v;
};
t::~t() {}

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl,extra
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --with-tune=native
Thread model: posix
gcc version 8.0.0 20171123 (experimental) [trunk revision 255090] (GCC)

Reply via email to