public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/35164]  New: [4.3 regression] Unable to coalesce ab SSA_NAMEs
@ 2008-02-11 12:19 jakub at gcc dot gnu dot org
  2008-02-11 12:20 ` [Bug tree-optimization/35164] " jakub at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-02-11 12:19 UTC (permalink / raw)
  To: gcc-bugs

On x86_64 with -O2 the following testcase ICEs with:
D.11907_556(ab) and  D.11907_14(ab)
rh432296.C: In function `void foo(std::vector<B<D>, std::allocator<B<D> > >&)':
rh432296.C:52: internal compiler error: SSA corruption
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

That looks similar to the inlining AB problem Jan fixed, but this is with
current trunk.

Sorry for the left-over #include <vector>, didn't get to minimize this more
yet.
#include <vector>

struct A
{
  A ();
  virtual ~A ();
  inline void incRef ();
  inline void decRef ();
  virtual void free () {}
  int m_refCount;
};
void A::incRef () { m_refCount++; }
void A::decRef () { if (!m_refCount) { free (); return; } m_refCount--; }
template <class T> struct B;
struct C : public A
{
  static C *alloc ();
};
template <class T>
struct B
{
  typedef T DataT;
  B () : ptr (T::alloc ()) { }
  B (const B<T>& a) : ptr (a.get ()) { incRef (); }
  B (T *a_ptr) : ptr (a_ptr) { incRef (); }
  ~B () { decRef (); }
  B& operator= (const B<T>& a) { if (a.get () != this->get ()) { decRef (); ptr
= a.get (); incRef (); } return *this; }
  template<class U>
  operator B<U> () const { return B<U> (ptr); }
  template<class U>
  operator B<const U> () const { return B<const U> (ptr); }
  T* operator-> () const { return ptr; }
  T* get () const { return ptr; }
  void decRef () const { if (ptr != 0) ptr->decRef (); }
  void incRef () const { if (ptr != 0) ptr->incRef (); }
  T *ptr;
};
struct D : public C
{
  template <class T>
  inline void foo (const B<T> & x) { d.resize (1); d[0] = x; }
  std::vector<B <C> > d;
};
struct E : public C
{
  static E *alloc ();
};
struct F : public D
{
  static F *alloc ();
};
void foo (std::vector<B<D> > & x)
{
  for (int i = 0; i < 2; ++i)
    {
      B<F> l;
      B<E> m;
      l->foo (m);
      x.push_back (l);
    }
}


-- 
           Summary: [4.3 regression] Unable to coalesce ab SSA_NAMEs
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35164


^ permalink raw reply	[flat|nested] 17+ messages in thread
[parent not found: <bug-35164-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2020-07-28  5:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-11 12:19 [Bug tree-optimization/35164] New: [4.3 regression] Unable to coalesce ab SSA_NAMEs jakub at gcc dot gnu dot org
2008-02-11 12:20 ` [Bug tree-optimization/35164] " jakub at gcc dot gnu dot org
2008-02-12 12:01 ` jakub at gcc dot gnu dot org
2008-02-12 22:04 ` rguenth at gcc dot gnu dot org
2008-02-12 22:46 ` rguenth at gcc dot gnu dot org
2008-02-13  4:06 ` rakdver at kam dot mff dot cuni dot cz
2008-02-13  4:07 ` rakdver at gcc dot gnu dot org
2008-02-15  2:59 ` rakdver at gcc dot gnu dot org
2008-02-15  9:24 ` rguenth at gcc dot gnu dot org
2008-02-15  9:24 ` rguenth at gcc dot gnu dot org
2008-02-15 12:37 ` rguenth at gcc dot gnu dot org
2008-02-15 12:37 ` rguenth at gcc dot gnu dot org
2008-02-15 14:06 ` rakdver at kam dot mff dot cuni dot cz
2008-02-15 14:13 ` rguenther at suse dot de
2008-02-15 15:25 ` rguenth at gcc dot gnu dot org
2008-02-15 15:26 ` rguenth at gcc dot gnu dot org
     [not found] <bug-35164-4@http.gcc.gnu.org/bugzilla/>
2020-07-28  5:54 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).