[patch] Fix array type merging in LTO mode
Eric Botcazou
ebotcazou@adacore.com
Sun May 20 17:59:00 GMT 2012
Hi,
since http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00833.html, canonical type
merging for arrays takes hours instead of minutes for big Ada applications.
The problem is that iterative_hash_canonical_type doesn't hash TYPE_MIN_VALUE
and TYPE_MAX_VALUE for integer types anymore, so TYPE_DOMAIN is effectively
not hashed anymore and the number of collisions goes to the roof in Ada.
Fixed by the attached patch, which also removes a bogus comparison of the
TYPE_SIZE of TYPE_DOMAIN in gimple_[canonical]types_compatible_p. LTO
bootstrapped on x86_64-suse-linux, OK for mainline and 4.7 branch?
2012-05-20 Eric Botcazou <ebotcazou@adacore.com>
* gimple.c (gimple_types_compatible_p_1) <ARRAY_TYPE>: Remove bogus
size handling.
(gimple_canonical_types_compatible_p) <ARRAY_TYPE>: Likewise.
(iterative_hash_gimple_type): Adjust comment.
(iterative_hash_canonical_type): Likewise. Hash the bounds of the
domain for an array type.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 3003 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120520/32d6be00/attachment.bin>
More information about the Gcc-patches
mailing list