[PATCH]: An almost working copying collector for gcc

Daniel Berlin dberlin@dberlin.org
Thu Dec 12 21:13:00 GMT 2002


On Thursday, December 12, 2002, at 11:39  PM, Zack Weinberg wrote:

> Daniel Berlin <dberlin@dberlin.org> writes:
>
>>> But i'll rewrite it to work on the pch-branch, and see if it's any
>>> easier.
>>>
>> It was.
>> We have locals we expect to be the same between collections.
>> Which means i'm gonna have to do stack scanning for pointers.
>
> Wouldn't it be easier and more portable to get rid of those locals?
>
Well, no.
You can't.
Let me give you an example.

decl in rest_of_compilation starts out pointing to 
current_function_decl.
rest_of_compilation calls ggc_collect.
current_function_decl moves.
We still expect decl to point to current_function_decl afterwards.
(before you point out it's a function parameter, and thus, in a 
register, it gets pushed to the stack in this particular case, and 
restored later).

In reality, we'll do mostly copying collection rather than stack 
rewriting if it's worth it. Or steal all the stack boundary finding 
code from Boehm.
I'm only doing stack rewriting as a cheap hack on this platform so i 
can get performance figures before i go implementing more.
Make sense?

> ... Has anyone tried writing a ggc-boehm.c that just wraps the Boehm
> GC that we already have in-tree?  I think that'd give interesting
> benchmark numbers to compare with, if nothing else.

> zw



More information about the Gcc-patches mailing list