This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/21308] [3.4/4.0/4.1 Regression] Very high compile time



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]