This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ Garbage Collecter
- To: tromey at cygnus dot com
- Subject: Re: C++ Garbage Collecter
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Fri, 27 Aug 1999 18:28:31 +0100 (BST)
- Cc: gcc at gcc dot gnu dot org
> Finally, I'm curious to know how aggressive gcc can be with these
> sorts of optimizations. I can imagine that in some bizarre situation
> it is useful to transform the last pointer to an object, and then
> later to transform it back in order to pass it as the `this' parameter
> to a method call. This would make the problem more likely to be seen
> in practice.
Well, regmove also makes such transformations. It's quite successful
for the SH port in lowering instruction counts and register pressure.
As to how much of the affected registers come from malloc, that's up to
experiments.
You could make a malloc package that can tell you if any given pointer
is from malloc, and then make loop.c and regmove.c insert some instrumentation
code to check if any pointer manipulation has been done on a pointer to
malloced memory.