aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-devirt.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-02-05 16:34:25 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2014-02-05 16:34:25 +0100
commitadd5c7634eb4e3cc62110bcaaacc19b70d62a6f0 (patch)
tree5dc90fd212c99fdb514aebbb39ddb9a13526b358 /gcc/ipa-devirt.c
parent54e19c00d9a901e0c55f812c2f7f98392976f5b2 (diff)
downloadgcc-add5c7634eb4e3cc62110bcaaacc19b70d62a6f0.zip
gcc-add5c7634eb4e3cc62110bcaaacc19b70d62a6f0.tar.gz
gcc-add5c7634eb4e3cc62110bcaaacc19b70d62a6f0.tar.bz2
re PR ipa/59947 (Segmentation fault with #pragma GCC optimize ("O2"), ICE in get_odr_type)
PR ipa/59947 * ipa-devirt.c (possible_polymorphic_call_targets): Fix a comment typo and formatting issue. If odr_hash hasn't been created, return vNULL and set *completep to false. * g++.dg/opt/pr59947.C: New test. From-SVN: r207512
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r--gcc/ipa-devirt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index f137874..c110a98 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -1359,7 +1359,7 @@ devirt_variable_node_removal_hook (varpool_node *n,
temporarily change to one of base types. INCLUDE_DERIVER_TYPES make
us to walk the inheritance graph for all derivations.
- If COMPLETEP is non-NULL, store true if the list is complette.
+ If COMPLETEP is non-NULL, store true if the list is complete.
CACHE_TOKEN (if non-NULL) will get stored to an unique ID of entry
in the target cache. If user needs to visit every target list
just once, it can memoize them.
@@ -1378,7 +1378,7 @@ possible_polymorphic_call_targets (tree otr_type,
static struct cgraph_node_hook_list *node_removal_hook_holder;
pointer_set_t *inserted;
pointer_set_t *matched_vtables;
- vec <cgraph_node *> nodes=vNULL;
+ vec <cgraph_node *> nodes = vNULL;
odr_type type, outer_type;
polymorphic_call_target_d key;
polymorphic_call_target_d **slot;
@@ -1386,6 +1386,13 @@ possible_polymorphic_call_targets (tree otr_type,
tree binfo, target;
bool final;
+ if (!odr_hash.is_created ())
+ {
+ if (completep)
+ *completep = false;
+ return nodes;
+ }
+
type = get_odr_type (otr_type, true);
/* Lookup the outer class type we want to walk. */