]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa-devirt.c (get_polymorphic_call_info): Fix offset calculatoin in contains_type_p...
authorJan Hubicka <hubicka@ucw.cz>
Tue, 17 Dec 2013 16:08:42 +0000 (17:08 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 17 Dec 2013 16:08:42 +0000 (16:08 +0000)
* ipa-devirt.c (get_polymorphic_call_info): Fix offset calculatoin
in contains_type_p query.

From-SVN: r206061

gcc/ChangeLog
gcc/ipa-devirt.c

index d51d0613296c623f4908af79ba7f853abef05c70..3c7b0d57ac9b615fcdb54a703972c0f72e5994fa 100644 (file)
@@ -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
index f5b5926504c73ec0fcf7cfc3b736ac598e641c36..a3f2ad674e1850ba5645690c4e4e2d1014fbbf3b 100644 (file)
@@ -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;