This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31863] [4.1/4.2/4.3 Regression] g++-4.1: out of memory with -O1/-O2
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Sep 2007 11:58:24 -0000
- Subject: [Bug c++/31863] [4.1/4.2/4.3 Regression] g++-4.1: out of memory with -O1/-O2
- References: <bug-31863-14521@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from rguenth at gcc dot gnu dot org 2007-09-18 11:58 -------
Note that the double virtual inheritance in the Serializer template creates the
exponential behavior. You can fix this at the source level by instead
doing
template <class Key, class Head>
class Serializer<Key, Loki::Typelist<Head, Loki::NullType> >:
public virtual Serializer<Key, Head>
{
};
template <class Key, class Head, class Tail>
class Serializer<Key, Loki::Typelist<Head, Tail> >:
public virtual Serializer<Key, Head>,
public Serializer<Key, Tail>
{
};
template <class Key>
class Serializer<Key, Loki::NullType> : public virtual Factory<Key>
{
};
which also makes more sense(?). Back to marking this as possibly a C++
frontend bug - though I'm inclined to close this bug as INVALID.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|tree-optimization |c++
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31863