From f9db59d91a12a7c7e334372a8784d0dd84a2efeb Mon Sep 17 00:00:00 2001 From: hubicka Date: Tue, 17 Dec 2013 16:08:42 +0000 Subject: [PATCH] * ipa-devirt.c (get_polymorphic_call_info): Fix offset calculatoin in contains_type_p query. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206061 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/ipa-devirt.c | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d51d061..3c7b0d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-12-17 Jan Hubicka + + * ipa-devirt.c (get_polymorphic_call_info): Fix offset calculatoin + in contains_type_p query. + 2013-12-17 Thomas Schwinge * omp-low.c (tmp_ompfn_id_num): Remove leftover variable diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index f5b5926..a3f2ad6 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -982,23 +982,22 @@ get_polymorphic_call_info (tree fndecl, is known. */ else if (DECL_P (base)) { - context->outer_type = TREE_TYPE (base); - gcc_assert (!POINTER_TYPE_P (context->outer_type)); + gcc_assert (!POINTER_TYPE_P (TREE_TYPE (base))); /* Only type inconsistent programs can have otr_type that is not part of outer type. */ - if (!contains_type_p (context->outer_type, - context->offset, *otr_type)) + if (!contains_type_p (TREE_TYPE (base), + context->offset + offset2, *otr_type)) return base_pointer; + context->outer_type = TREE_TYPE (base); context->offset += offset2; - base_pointer = NULL; /* Make very conservative assumption that all objects may be in construction. TODO: ipa-prop already contains code to tell better. merge it later. */ context->maybe_in_construction = true; context->maybe_derived_type = false; - return base_pointer; + return NULL; } else break; -- 2.7.4