This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21308] [3.4/4.0/4.1 Regression] Very high compile time
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Nov 2005 00:55:39 -0000
- Subject: [Bug c++/21308] [3.4/4.0/4.1 Regression] Very high compile time
- References: <bug-21308-4127@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from mmitchel at gcc dot gnu dot org 2005-11-06 00:55 -------
I thought that a key observation is that we only need to know (a) what empty
subobjects are at offset zero, and (b) what empty subobjects occur before the
location where we will next place a non-empty field or base. Therefore, we can
avoid recording the offsets for any of the empty objects in the array other
than those at offset zero.
However, I forgot that empty classes do not necessarily have size one:
class A {};
class B : public A {};
class C : public A, public B {}; // C empty, sizeof (C) == 2
So, the observation above has to be modified -- instead of just offset zero we
must care about empty objects at offsets < N, where N is the sizeof the largest
empty class we have thus far encountered in the translation unit.
That should still permit very considerable improvement. I plan to work on
implementing this improvement soon.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21308