V3 PATCH: Static data members

Gabriel Dos Reis gdr@codesourcery.com
Wed Nov 15 18:36:00 GMT 2000

Mark Mitchell <mark@codesourcery.com> writes:


|   - It can emit them in object files where it doesn't need to.
|     This costs space.
| The second doesn't really impact the traditional "abstraction penalty"
| measurement.  It would take some really bizarre program before the
| amount of space allocated to static data members was a significant
| part of the space used by the program.

Template-based constants computations are exactly that: bizarre :-)

| So, I assume you have a case where the compiler generates worse code?

Yes, I have.

|     Gabriel> Get real!  I would appreciate any patch from you to
|     Gabriel> improve the compiler in that area.
| Send me a test case. :-)

Count on me! :-)


| Of course there is a tradeoff -- as library implementors you cannot
| simply say "well, the compiler should do a great job, so I don't have
| to do anything".  On the other hand, you must beware making the same
| mistake that glibc did with the horrid string optimization macros, or
| that libstdc++ V2 did with the funny libio games.

Don't worry, I'm welll aware of that.  My goal isn't to trade
correctness, nor readability against performance; my goal is to attain 
the best given a tool and its limitations.


| We are on the same team, compiler folks and library folks.  If the
| compiler has limitations that are making it hard to get V3 to perform
| well, we need to know about that.

If I understand correctly, there are optimizations we won't have
before GCC-3.x (x >= 1); on the other hand I find it quite unreasonable
to wait for grandissime optimizations before having a well performing
library, that was my point.

-- Gaby

More information about the Libstdc++ mailing list