> I've tested your patch a little bit and hit the gcc_assert above:
> 
> markus@x4 tmp % cat test.ii
> class A {
> public:
>   unsigned length;
> };
> class B {};
> class MultiTermDocs : public virtual B {
> protected:
>   A readerTermDocs;
>   A subReaders;
>   virtual B *m_fn1(int *);
>   virtual ~MultiTermDocs();
> };
> class C : MultiTermDocs {
>   B *m_fn1(int *);
> };
> MultiTermDocs::~MultiTermDocs() {
>   if (&readerTermDocs) {
>     B *a;
>     for (unsigned i = 0; i < subReaders.length; i++)
>       (a != 0);
>   }
> }
> 
> B *C::m_fn1(int *) { return 0; }

Thanks!  It is the case where we see a construction vtable store.  There is no
BINFO for that, so we need to give up trying to analyze the type.
We will need to improve our representation to handle this eventually, but
that is definitely not stage3 material.

I actualy wondered about this and tried to construct a testcase that did not
trigger for some reason and concluded that I probably don't care when it does
not fire for firefox.  Your testing (and reduced testcaes) are very useful.

I will drop the abort and add your testcase before comitting the patch.
I wonder if we can reproduce this as wrong code bug for gcc-4.8.  Basically
virtual calls in the destructors of the virtual base should get devirtualized
the wrong way.

Honza
> 
> markus@x4 tmp % g++ -O2 test.ii
> test.ii: In destructor ‘virtual C::~C()’:
> test.ii:24:32: internal compiler error: in vtable_pointer_value_to_binfo, at 
> ipa-devirt.c:1082
>  B *C::m_fn1(int *) { return 0; }
>                                 ^
> 0x9ca774 vtable_pointer_value_to_binfo(tree_node*)
>         ../../gcc/gcc/ipa-devirt.c:1082
> 0x9e22b9 extr_type_from_vtbl_ptr_store
>         ../../gcc/gcc/ipa-prop.c:606
> 0x9e22b9 check_stmt_for_type_change
>         ../../gcc/gcc/ipa-prop.c:648
> 0xc18343 walk_aliased_vdefs_1
>         ../../gcc/gcc/tree-ssa-alias.c:2472
> 0xc1846d walk_aliased_vdefs(ao_ref*, tree_node*, bool (*)(ao_ref*, 
> tree_node*, void*), void*, bitmap_head**)
>         ../../gcc/gcc/tree-ssa-alias.c:2491
> 0x9e1cba detect_type_change
>         ../../gcc/gcc/ipa-prop.c:702
> 0x9e8b63 compute_complex_assign_jump_func
>         ../../gcc/gcc/ipa-prop.c:1089
> 0x9e8b63 ipa_compute_jump_functions_for_edge
>         ../../gcc/gcc/ipa-prop.c:1635
> 0x9eb882 ipa_compute_jump_functions
>         ../../gcc/gcc/ipa-prop.c:1675
> 0x9eb882 ipa_analyze_node(cgraph_node*)
>         ../../gcc/gcc/ipa-prop.c:2212
> 0x103ea7f ipcp_generate_summary
>         ../../gcc/gcc/ipa-cp.c:3709
> 0xaa4906 execute_ipa_summary_passes(ipa_opt_pass_d*)
>         ../../gcc/gcc/passes.c:2027
> 0x833dbb ipa_passes
>         ../../gcc/gcc/cgraphunit.c:2070
> 0x833dbb compile()
>         ../../gcc/gcc/cgraphunit.c:2174
> 0x834304 finalize_compilation_unit()
>         ../../gcc/gcc/cgraphunit.c:2329
> 0x62efce cp_write_global_declarations()
>         ../../gcc/gcc/cp/decl2.c:4447
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> 
> 
> -- 
> Markus

Reply via email to