From 3b4e93c3586ba3c7ceeb21a809c14e190ef0c997 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 16 Dec 2013 11:52:48 +0100 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/ipa-devirt.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3821a88a80..32cce163e7b 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 c1f8d879225..f5b5926504c 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; }