re PR ipa/59473 (ice in get_class_context with -O3)
authorJan Hubicka <jh@suse.cz>
Mon, 16 Dec 2013 10:52:48 +0000 (11:52 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 16 Dec 2013 10:52:48 +0000 (10:52 +0000)
PR ipa/59473
* ipa-devirt.c (get_class_context): Do not ICE when type is found
at wrong offset.

From-SVN: r206012

gcc/ChangeLog
gcc/ipa-devirt.c

index a3821a8..32cce16 100644 (file)
@@ -1,3 +1,9 @@
+2013-12-14   Jan Hubicka  <jh@suse.cz>
+
+       PR ipa/59473
+       * ipa-devirt.c (get_class_context): Do not ICE when type is found
+       at wrong offset.
+
 2013-12-16  Jakub Jelinek  <jakub@redhat.com>
 
        PR libgomp/58756
index c1f8d87..f5b5926 100644 (file)
@@ -848,6 +848,10 @@ get_class_context (ipa_polymorphic_call_context *context,
       if (TREE_CODE (type) == TREE_CODE (expected_type)
          && types_same_for_odr (type, expected_type))
        {
+         /* Type can not contain itself on an non-zero offset.  In that case
+            just give up.  */
+         if (offset != 0)
+           goto give_up;
          gcc_assert (offset == 0);
          return true;
        }