From: Jan Hubicka Date: Tue, 17 Dec 2013 16:08:42 +0000 (+0100) Subject: ipa-devirt.c (get_polymorphic_call_info): Fix offset calculatoin in contains_type_p... X-Git-Tag: releases/gcc-4.9.0~2025 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7656ee7297f0995750002facfed65d165e7244b4;p=thirdparty%2Fgcc.git ipa-devirt.c (get_polymorphic_call_info): Fix offset calculatoin in contains_type_p query. * ipa-devirt.c (get_polymorphic_call_info): Fix offset calculatoin in contains_type_p query. From-SVN: r206061 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d51d0613296c..3c7b0d57ac9b 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 f5b5926504c7..a3f2ad674e18 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;