Hi,
here is even better testcase (in a sense that my patch does not solve the wrong 
code issue)

Compile with ./xgcc -B ./ -O3 ~/t.C -S -fno-partial-inlining 
-fno-early-inlining -fdump-ipa-all -fdump-tree-all -fipa-cp -fno-ipa-sra

Here the sequence is bit different.  Here we have contstruction table store 
done within destructor that
sets it accoridng to the second parameter. We hover still produce PASSTHROUGH 
function for it and
we end up propagating the wrong type.

Honza


#include <stdlib.h>
class A {                                                                       
                                                                                
                                
public:                                                                         
                                                                                
                                
  unsigned length;                                                              
                                                                                
                                
};                                                                              
                                                                                
                                
class B {};                                                                     
                                                                                
                                
class MultiTermDocs : public virtual B {                                        
                                                                                
                                
protected:                                                                      
                                                                                
                                
  A readerTermDocs;                                                             
                                                                                
                                
  A subReaders;                                                                 
                                                                                
                                
  virtual B *m_fn1(int *) {}                                                    
                                                                                
                                 
  virtual inline  ~MultiTermDocs();                                             
                                                                                
                                        
  void wrap(void)
  {
  m_fn1(NULL);
  }
};                                                                              
                                                                                
                                
class C : MultiTermDocs {                                                       
                                                                                
                                
  B *m_fn1(int *);                                                              
                                                                                
                                
};                                                                              
                                                                                
                                
MultiTermDocs::~MultiTermDocs() {                                               
                                                                                
                                
  wrap ();
  if (&readerTermDocs) {                                                        
                                                                                
                                
    B *a;                                                                       
                                                                                
                                
    for (unsigned i = 0; i < subReaders.length; i++)                            
                                                                                
                                
      (a != 0);                                                                 
                                                                                
                                
  }                                                                             
                                                                                
                                
}                                                                               
                                                                                
                                
                                                                                
                                                                                
                                
B *C::m_fn1(int *) { abort (); }                                                
                                                                                
                                
                                                                                
                                                                                
                                
main()
{
  class C c;
}

Reply via email to