aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-objcp-common.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-09-22 20:20:25 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-09-22 20:20:25 +0000
commitd68d0df68c2554379ff97c4b8eddd214938f3594 (patch)
tree64126ac13ada2e7fada1d568beda9eb54e09c681 /gcc/cp/cp-objcp-common.c
parenta93952d2bee108c94f802aa14be0348bcf4bcb29 (diff)
downloadgcc-d68d0df68c2554379ff97c4b8eddd214938f3594.zip
gcc-d68d0df68c2554379ff97c4b8eddd214938f3594.tar.gz
gcc-d68d0df68c2554379ff97c4b8eddd214938f3594.tar.bz2
re PR bootstrap/81926 (go/parse.o differs between stage2 and stage3)
PR bootstrap/81926 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup. From-SVN: r253109
Diffstat (limited to 'gcc/cp/cp-objcp-common.c')
-rw-r--r--gcc/cp/cp-objcp-common.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index 183e7f7..267fcca 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -162,13 +162,13 @@ cp_get_debug_type (const_tree type)
types on the fly for the debug info only, they would not be attached
to any GC root and always be swept, so we would make the contents of
the debug info depend on the collection points. */
- struct tree_map in, *h;
+ struct tree_map in, *h, **slot;
in.base.from = CONST_CAST_TREE (type);
in.hash = htab_hash_pointer (type);
- h = debug_type_hash->find_with_hash (&in, in.hash);
- if (h)
- return h->to;
+ slot = debug_type_hash->find_slot_with_hash (&in, in.hash, INSERT);
+ if (*slot)
+ return (*slot)->to;
tree t = build_offset_type (TYPE_PTRMEMFUNC_OBJECT_TYPE (type),
TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (type)));
@@ -177,7 +177,7 @@ cp_get_debug_type (const_tree type)
h->base.from = CONST_CAST_TREE (type);
h->hash = htab_hash_pointer (type);
h->to = t;
- *debug_type_hash->find_slot_with_hash (h, h->hash, INSERT) = h;
+ *slot = h;
return t;
}