http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48849
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2011.05.19 08:49:11 AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-19 08:49:11 UTC --- Btw, I looked into similar ICEs I get on x86_64 SPEC2k6 and the issue is that LTO TYPE_CANONICAL merging behaves different than the middle-end when it constructs new pointer types (that is what I was looking at, similar issues apply to vector and complex and array types I think). That is, for the middle-end the canonical type of a pointer type is a pointer to the canonical pointed-to type while LTO TYPE_CANONICAL building does something different. Now, a simple patch like Index: gcc/gimple.c =================================================================== --- gcc/gimple.c (revision 173724) +++ gcc/gimple.c (working copy) @@ -4830,6 +4830,25 @@ gimple_register_canonical_type (tree t) if (TYPE_MAIN_VARIANT (t) != t) gimple_register_canonical_type (TYPE_MAIN_VARIANT (t)); + /* For pointer and reference types do as the middle-end does - the + canonical type is a pointer to the canonical pointed-to type. */ + if (TREE_CODE (t) == POINTER_TYPE) + { + TYPE_CANONICAL (t) + = build_pointer_type_for_mode + (gimple_register_canonical_type (TREE_TYPE (t)), + TYPE_MODE (t), TYPE_REF_CAN_ALIAS_ALL (t)); + return TYPE_CANONICAL (t); + } + else if (TREE_CODE (t) == REFERENCE_TYPE) + { + TYPE_CANONICAL (t) + = build_reference_type_for_mode + (gimple_register_canonical_type (TREE_TYPE (t)), + TYPE_MODE (t), TYPE_REF_CAN_ALIAS_ALL (t)); + return TYPE_CANONICAL (t); + } + if (gimple_canonical_types == NULL) gimple_canonical_types = htab_create_ggc (16381, gimple_canonical_type_hash, gimple_canonical_type_eq, 0); that I tested after analyzing the issue doesn't work as the middle-end pointer-type building depends on properly setup TYPE_POINTER_TO lists which we are only about to construct when re-building canonical types. Anyway, I was working on this but got distracted.