diff options
author | Richard Guenther <rguenther@suse.de> | 2011-05-13 11:02:28 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-05-13 11:02:28 +0000 |
commit | e834e95c36679e28a45cdd27b6d59ffd6b9c00f1 (patch) | |
tree | 34a02abafb70c287f26d660d86f6ad14184a53dd | |
parent | 3420348330cbc3b086b38563216e82fc0ce6e2e9 (diff) | |
download | gcc-e834e95c36679e28a45cdd27b6d59ffd6b9c00f1.zip gcc-e834e95c36679e28a45cdd27b6d59ffd6b9c00f1.tar.gz gcc-e834e95c36679e28a45cdd27b6d59ffd6b9c00f1.tar.bz2 |
re PR lto/48978 (excessive hash table allocation for large lto build)
2011-05-13 Richard Guenther <rguenther@suse.de>
PR lto/48978
* gimple.c (iterative_hash_gimple_type): Revert change in
pointer target and function result and argument hashing.
From-SVN: r173730
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple.c | 42 |
2 files changed, 40 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1a1b3b..1066045 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-05-13 Richard Guenther <rguenther@suse.de> + + PR lto/48978 + * gimple.c (iterative_hash_gimple_type): Revert change in + pointer target and function result and argument hashing. + 2011-05-13 Uros Bizjak <ubizjak@gmail.com> * config/i386/i386.md (*movxf_internal): Use !can_create_pseudo (). diff --git a/gcc/gimple.c b/gcc/gimple.c index c9ac991..28a6744 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -4110,10 +4110,20 @@ iterative_hash_gimple_type (tree type, hashval_t val, } /* For pointer and reference types, fold in information about the type - pointed to. */ + pointed to but do not recurse into possibly incomplete types to + avoid hash differences for complete vs. incomplete types. */ if (POINTER_TYPE_P (type)) - v = visit (TREE_TYPE (type), state, v, - sccstack, sccstate, sccstate_obstack); + { + if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (type))) + { + v = iterative_hash_hashval_t (TREE_CODE (TREE_TYPE (type)), v); + v = iterative_hash_name + (TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (type))), v); + } + else + v = visit (TREE_TYPE (type), state, v, + sccstack, sccstate, sccstate_obstack); + } /* For integer types hash the types min/max values and the string flag. */ if (TREE_CODE (type) == INTEGER_TYPE) @@ -4154,13 +4164,29 @@ iterative_hash_gimple_type (tree type, hashval_t val, v = visit (TYPE_METHOD_BASETYPE (type), state, v, sccstack, sccstate, sccstate_obstack); - /* Check result and argument types. */ - v = visit (TREE_TYPE (type), state, v, - sccstack, sccstate, sccstate_obstack); + /* For result types allow mismatch in completeness. */ + if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (type))) + { + v = iterative_hash_hashval_t (TREE_CODE (TREE_TYPE (type)), v); + v = iterative_hash_name + (TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (type))), v); + } + else + v = visit (TREE_TYPE (type), state, v, + sccstack, sccstate, sccstate_obstack); + for (p = TYPE_ARG_TYPES (type), na = 0; p; p = TREE_CHAIN (p)) { - v = visit (TREE_VALUE (p), state, v, - sccstack, sccstate, sccstate_obstack); + /* For argument types allow mismatch in completeness. */ + if (RECORD_OR_UNION_TYPE_P (TREE_VALUE (p))) + { + v = iterative_hash_hashval_t (TREE_CODE (TREE_VALUE (p)), v); + v = iterative_hash_name + (TYPE_NAME (TYPE_MAIN_VARIANT (TREE_VALUE (p))), v); + } + else + v = visit (TREE_VALUE (p), state, v, + sccstack, sccstate, sccstate_obstack); na++; } |