This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PCH vs. type canonicalization
- From: Geoff Keating <geoffk at apple dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 20 Feb 2004 15:12:32 -0800
- Subject: Re: PCH vs. type canonicalization
- References: <xyp4qtltkvl.fsf@miranda.boston.redhat.com>
On Feb 20, 2004, at 3:02 PM, Jason Merrill wrote:
I'm running into a bug which only appears with PCH; it turns out to be
a
problem whereby build_function_type isn't finding a version of the type
loaded from the PCH, because the hash calculation uses the tree
address of
the return type.
I suppose the right fix is to stop using the address in calculating the
hash of a type. Alternately, we could do something along the lines of
the
reorder functions for sorted field structures.
You can probably just use TYPE_UID instead of the pointer's address.
It's often better to avoid hashing based on pointers than to use
reorder functions, since reorder functions make building PCHs slower.
(Of course, sometimes hashing based on pointers is faster than the
alternative, so you really want to implement both and do measurements.)
--
Geoff Keating <geoffk@apple.com>