diff options
author | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-12-15 03:41:41 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-12-15 03:41:41 +0000 |
commit | bebecd51b6d2bb0f29423a582b0294183392e0d4 (patch) | |
tree | 5c599da445c4658615bd7d6ae1567f48487ceaa6 /gcc/tree.c | |
parent | 1bf7c3241444b26d2b89b7731de198a9139b7d4e (diff) | |
download | gcc-bebecd51b6d2bb0f29423a582b0294183392e0d4.zip gcc-bebecd51b6d2bb0f29423a582b0294183392e0d4.tar.gz gcc-bebecd51b6d2bb0f29423a582b0294183392e0d4.tar.bz2 |
re PR lto/64043 (ICE (segfault) with LTO: in tree_check/tree.h:2758 get_binfo_at_offset/tree.c:11914)
PR lto/64043
* tree.c (virtual_method_call_p): Return false when OTR type has
no BINFO.
* g++.dg/lto/pr64043_0.C: New testcase.
From-SVN: r218727
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -11864,12 +11864,17 @@ virtual_method_call_p (tree target) { if (TREE_CODE (target) != OBJ_TYPE_REF) return false; - target = TREE_TYPE (target); - gcc_checking_assert (TREE_CODE (target) == POINTER_TYPE); - target = TREE_TYPE (target); - if (TREE_CODE (target) == FUNCTION_TYPE) + tree t = TREE_TYPE (target); + gcc_checking_assert (TREE_CODE (t) == POINTER_TYPE); + t = TREE_TYPE (t); + if (TREE_CODE (t) == FUNCTION_TYPE) + return false; + gcc_checking_assert (TREE_CODE (t) == METHOD_TYPE); + /* If we do not have BINFO associated, it means that type was built + without devirtualization enabled. Do not consider this a virtual + call. */ + if (!TYPE_BINFO (obj_type_ref_class (target))) return false; - gcc_checking_assert (TREE_CODE (target) == METHOD_TYPE); return true; } |