From 502e897d1afa16df33326d255120d7cd15df9363 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 20 Nov 2018 00:27:10 +0100 Subject: [PATCH] =?utf8?q?re=20PR=20ipa/87957=20(ICE=20tree=20check:=20exp?= =?utf8?q?ected=20tree=20that=20contains=20=E2=80=98decl=20minimal?= =?utf8?q?=E2=80=99=20structure,=20have=20=E2=80=98identifier=5Fnode?= =?utf8?q?=E2=80=99=20in=20warn=5Fodr,=20at=20ipa-devirt.c:1051=20since=20?= =?utf8?q?r265519)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit PR lto/87957 * ipa-devirt.c (free_enum_values): Do not ICE on ODR vilations. From-SVN: r266289 --- gcc/ChangeLog | 5 +++++ gcc/ipa-devirt.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0a1f956cb0d..6669b20b1f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-19 Jan Hubicka + + PR lto/87957 + * ipa-devirt.c (free_enum_values): Do not ICE on ODR vilations. + 2018-11-19 Sandra Loosemore PR driver/50250 diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index db8d34c4027..ca583c49309 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -2268,12 +2268,14 @@ free_enum_values () enum_values_freed = true; unsigned int i; for (i = 0; i < odr_types.length (); i++) - if (odr_types[i] && TREE_CODE (odr_types[i]->type) == ENUMERAL_TYPE) + if (odr_types[i]) { - TYPE_VALUES (odr_types[i]->type) = NULL; + if (TREE_CODE (odr_types[i]->type) == ENUMERAL_TYPE) + TYPE_VALUES (odr_types[i]->type) = NULL; if (odr_types[i]->types) for (unsigned int j = 0; j < odr_types[i]->types->length (); j++) - TYPE_VALUES ((*odr_types[i]->types)[j]) = NULL; + if (TREE_CODE ((*odr_types[i]->types)[j]) == ENUMERAL_TYPE) + TYPE_VALUES ((*odr_types[i]->types)[j]) = NULL; } enum_values_freed = true; } -- 2.30.2