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

            Bug ID: 64059
           Summary: [5 Regression] ICE: Segmentation fault in
                    ipa-polymorphic-call.c:1593
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

Reduced from PR63671 comment 14:

markus@x4 ~ % cat tramp3d-v4.ii
class A;
class B
{
public:
  A *operator->();
};
class C
{
public:
  virtual void m_fn1 ();
};
class A
{
public:
  C *m_fn2 ();
};
class D
{
public:
  void
  m_fn3 ()
  {
    list_m->m_fn2 ()->m_fn1 ();
  }
  B list_m;
};

class F
{
public:
  D m_fn4 ();
};
class G
{
public:
  F m_fn5 (int, int);
};
class H
{
public:
  void
  m_fn6 ()
  {
    fieldEngine_m.m_fn5 (0, 0).m_fn4 ().m_fn3 ();
  }
  G fieldEngine_m;
};

void
fn1 (H a)
{
  a.m_fn6 ();
}

markus@x4 ~ % g++ -r -nostdlib -O2 -flto -fno-devirtualize tramp3d-v4.ii
tramp3d-v4.ii: In member function ‘D::m_fn3()’:
tramp3d-v4.ii:53:1: internal compiler error: Segmentation fault
 }
 ^
0xc7542f crash_signal
        ../../gcc/gcc/toplev.c:359
0xac92b8 tree_check
        ../../gcc/gcc/tree.h:2763
0xac92b8 ipa_polymorphic_call_context::get_dynamic_type(tree_node*, tree_node*,
tree_node*, gimple_statement_base*)
        ../../gcc/gcc/ipa-polymorphic-call.c:1593
0xae4c04 ipa_analyze_call_uses
        ../../gcc/gcc/ipa-prop.c:2173
0xae4c04 ipa_analyze_stmt_uses
        ../../gcc/gcc/ipa-prop.c:2192
0xae4c04 ipa_analyze_params_uses_in_bb
        ../../gcc/gcc/ipa-prop.c:2232
0xae4c04 analysis_dom_walker::before_dom_children(basic_block_def*)
        ../../gcc/gcc/ipa-prop.c:2316
0x12202d7 dom_walker::walk(basic_block_def*)
        ../../gcc/gcc/domwalk.c:188
0xaeb839 ipa_analyze_node(cgraph_node*)
        ../../gcc/gcc/ipa-prop.c:2373
0x125c77f ipcp_generate_summary
        ../../gcc/gcc/ipa-cp.c:4254
0xbba939 execute_ipa_summary_passes(ipa_opt_pass_d*)
        ../../gcc/gcc/passes.c:2137
0x8d39fe ipa_passes
        ../../gcc/gcc/cgraphunit.c:2074
0x8d39fe symbol_table::compile()
        ../../gcc/gcc/cgraphunit.c:2187
0x8d5177 symbol_table::finalize_compilation_unit()
        ../../gcc/gcc/cgraphunit.c:2340
0x6ac91b cp_write_global_declarations()
        ../../gcc/gcc/cp/decl2.c:4688
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions

Reply via email to