number of vector template instances and pointers

Dan Kegel dank@kegel.com
Mon Sep 20 14:56:00 GMT 2004


Fery wrote:
> When I create two vectors with different pointer types (e.g.
> vector<char*> and vector<int*>), gcc compiles in two instances of vector
> code. In SH architecture, it means cca. n * 10K of code, which is quite
> big in our project.
> 
> The question is, can I somehow force the compiler to use the same code
> for the two template instances?

If the object code generated for the two is really identical,
then if you really wanted to, you could write a whole-program
optimizer pass that combined them.

This is a topic for the gcc or libstdc++ mailing lists, though,
where people actually know something about this, so I'm redirecting there.
- Dan

-- 
My technical stuff: http://kegel.com
My politics: see http://www.misleader.org for examples of why I'm for regime change

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list