aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2013-12-17 17:08:42 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2013-12-17 16:08:42 +0000
commit7656ee7297f0995750002facfed65d165e7244b4 (patch)
tree092d782a52277bb61cfb07c5b18347a2efe2f22d /gcc
parent18aacdca292bb1bd54aa8b6121ce819ee308a24e (diff)
downloadgcc-7656ee7297f0995750002facfed65d165e7244b4.zip
gcc-7656ee7297f0995750002facfed65d165e7244b4.tar.gz
gcc-7656ee7297f0995750002facfed65d165e7244b4.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-devirt.c11
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 <hubicka@ucw.cz>
+
+ * ipa-devirt.c (get_polymorphic_call_info): Fix offset calculatoin
+ in contains_type_p query.
+
2013-12-17 Thomas Schwinge <thomas@codesourcery.com>
* 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;