From: Jan Hubicka Date: Mon, 16 Dec 2013 10:52:48 +0000 (+0100) Subject: re PR ipa/59473 (ice in get_class_context with -O3) X-Git-Tag: releases/gcc-4.9.0~2061 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b4e93c3586ba3c7ceeb21a809c14e190ef0c997;p=thirdparty%2Fgcc.git re PR ipa/59473 (ice in get_class_context with -O3) PR ipa/59473 * ipa-devirt.c (get_class_context): Do not ICE when type is found at wrong offset. From-SVN: r206012 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3821a88a805..32cce163e7bb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-12-14 Jan Hubicka + + PR ipa/59473 + * ipa-devirt.c (get_class_context): Do not ICE when type is found + at wrong offset. + 2013-12-16 Jakub Jelinek PR libgomp/58756 diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index c1f8d8792259..f5b5926504c7 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -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; }