Mark Mitchell
Fri Mar 19 08:14:00 GMT 2004

Jason Merrill wrote:

>Well, then it seems to me that you get to come up with another solution for
>hashing types across PCH.  This strategy is what Geoff suggested.
I've previously objected to the fact that the PCH design does not permit 
hashing on pointers. 

That's a good way to make things go slower: we need more space in trees 
to store these UIDs, and we have to read from memory more often when 
doing hashing operations because we have to indirect through a pointer 
instead of just reading from it.

It's possible that this is somehow less expensive than whatever would 
have to be done to PCH to support it, but I don't see that as being 
likely.   I do not believe that this tradeoff was benchmarked before 
committing to the PCH design.  Other PCH mechanisms do not have this 
issue, and that other compilers use pointer-hashing extensively.

If you need to make these kinds of changes because we screw things up 
horribly otherwise, I don't see we have any choice in the short term.  
But, the PCH implementation really should be fixed -- or someone should 
explain why it is that the fix is going to be more expensive than an 
extra word per _DECL and _TYPE node.

Mark Mitchell
CodeSourcery, LLC
(916) 791-8304

More information about the Gcc-patches mailing list