Index: builtins.c =================================================================== --- builtins.c (revision 240888) +++ builtins.c (working copy) @@ -2356,7 +2356,7 @@ expand_builtin_cexpi (tree exp, rtx targ else { tree call, fn = NULL_TREE, narg; - tree ctype = build_complex_type (type); + tree ctype = build_complex_type (type, false); if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CEXPIF) fn = builtin_decl_explicit (BUILT_IN_CEXPF); @@ -2396,7 +2396,7 @@ expand_builtin_cexpi (tree exp, rtx targ } /* Now build the proper return type. */ - return expand_expr (build2 (COMPLEX_EXPR, build_complex_type (type), + return expand_expr (build2 (COMPLEX_EXPR, build_complex_type (type, false), make_tree (TREE_TYPE (arg), op2), make_tree (TREE_TYPE (arg), op1)), target, VOIDmode, EXPAND_NORMAL); @@ -7226,7 +7226,7 @@ fold_builtin_sincos (location_t loc, /* Canonicalize sincos to cexpi. */ if (TREE_CODE (arg0) == REAL_CST) { - tree complex_type = build_complex_type (type); + tree complex_type = build_complex_type (type, false); call = fold_const_call (as_combined_fn (fn), complex_type, arg0); } if (!call) @@ -8137,7 +8137,7 @@ fold_builtin_arith_overflow (location_t ? boolean_true_node : boolean_false_node, arg2); - tree ctype = build_complex_type (type); + tree ctype = build_complex_type (type, false); tree call = build_call_expr_internal_loc (loc, ifn, ctype, 2, arg0, arg1); tree tgt = save_expr (call); Index: gimple-fold.c =================================================================== --- gimple-fold.c (revision 240888) +++ gimple-fold.c (working copy) @@ -3210,7 +3210,7 @@ fold_builtin_atomic_compare_exchange (gi tree fndecl = gimple_call_fndecl (stmt); tree parmt = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); tree itype = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (parmt))); - tree ctype = build_complex_type (itype); + tree ctype = build_complex_type (itype, false); tree expected = TREE_OPERAND (gimple_call_arg (stmt, 1), 0); gimple *g = gimple_build_assign (make_ssa_name (TREE_TYPE (expected)), expected); @@ -3582,7 +3582,7 @@ gimple_fold_call (gimple_stmt_iterator * { if (overflow == NULL_TREE) overflow = build_zero_cst (TREE_TYPE (result)); - tree ctype = build_complex_type (TREE_TYPE (result)); + tree ctype = build_complex_type (TREE_TYPE (result), false); if (TREE_CODE (result) == INTEGER_CST && TREE_CODE (overflow) == INTEGER_CST) result = build_complex (ctype, result, overflow); Index: stor-layout.c =================================================================== --- stor-layout.c (revision 240888) +++ stor-layout.c (working copy) @@ -469,7 +469,7 @@ bitwise_type_for_mode (machine_mode mode return build_vector_type_for_mode (inner_type, mode); if (COMPLEX_MODE_P (mode)) - return build_complex_type (inner_type); + return build_complex_type (inner_type, false); gcc_checking_assert (GET_MODE_INNER (mode) == mode); return inner_type; Index: tree-ssa-dce.c =================================================================== --- tree-ssa-dce.c (revision 240888) +++ tree-ssa-dce.c (working copy) @@ -1194,7 +1194,7 @@ maybe_optimize_arith_overflow (gimple_st if (TREE_CODE (result) == INTEGER_CST && TREE_OVERFLOW (result)) result = drop_tree_overflow (result); tree overflow = build_zero_cst (type); - tree ctype = build_complex_type (type); + tree ctype = build_complex_type (type, false); if (TREE_CODE (result) == INTEGER_CST) result = build_complex (ctype, result, overflow); else Index: tree-ssa-math-opts.c =================================================================== --- tree-ssa-math-opts.c (revision 240888) +++ tree-ssa-math-opts.c (working copy) @@ -3736,7 +3736,7 @@ match_uaddsub_overflow (gimple_stmt_iter if (!ovf_use_seen || !use_seen) return false; - tree ctype = build_complex_type (type); + tree ctype = build_complex_type (type, false); tree rhs1 = gimple_assign_rhs1 (stmt); tree rhs2 = gimple_assign_rhs2 (stmt); gcall *g = gimple_build_call_internal (code == PLUS_EXPR Index: tree.c =================================================================== --- tree.c (revision 240888) +++ tree.c (working copy) @@ -2021,7 +2021,7 @@ build_complex (tree type, tree real, tre TREE_REALPART (t) = real; TREE_IMAGPART (t) = imag; - TREE_TYPE (t) = type ? type : build_complex_type (TREE_TYPE (real)); + TREE_TYPE (t) = type ? type : build_complex_type (TREE_TYPE (real), false); TREE_OVERFLOW (t) = TREE_OVERFLOW (real) | TREE_OVERFLOW (imag); return t; } @@ -8758,10 +8758,15 @@ build_offset_type (tree basetype, tree t return t; } -/* Create a complex type whose components are COMPONENT_TYPE. */ +/* Create a complex type whose components are COMPONENT_TYPE. + + If NAMED is true, the type is given a TYPE_NAME. We do not always + do so because this creates a DECL node and thus make the DECL_UIDs + dependent on the type canonicalization hashtable, which is GC-ed, + so the DECL_UIDs would not be stable wrt garbage collection. */ tree -build_complex_type (tree component_type) +build_complex_type (tree component_type, bool named) { tree t; inchash::hash hstate; @@ -8788,11 +8793,11 @@ build_complex_type (tree component_type) SET_TYPE_STRUCTURAL_EQUALITY (t); else if (TYPE_CANONICAL (component_type) != component_type) TYPE_CANONICAL (t) - = build_complex_type (TYPE_CANONICAL (component_type)); + = build_complex_type (TYPE_CANONICAL (component_type), named); } /* We need to create a name, since complex is a fundamental type. */ - if (! TYPE_NAME (t)) + if (!TYPE_NAME (t) && named) { const char *name; if (component_type == char_type_node) Index: tree.h =================================================================== --- tree.h (revision 240888) +++ tree.h (working copy) @@ -4042,7 +4042,7 @@ extern tree build_varargs_function_type_ extern tree build_method_type_directly (tree, tree, tree); extern tree build_method_type (tree, tree); extern tree build_offset_type (tree, tree); -extern tree build_complex_type (tree); +extern tree build_complex_type (tree, bool named = true); extern tree array_type_nelts (const_tree); extern tree value_member (tree, tree);