aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-03-13 10:04:51 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-03-13 10:04:51 +0000
commit59a8062a6a11ed4be77fb103a37433f66e5c9d21 (patch)
tree1e1d0e9808fba5db56bad62d497dd59f27c39489 /gcc
parent0dbacfcfadec514b5ccd4ae70fe53dc589ae7439 (diff)
downloadgcc-59a8062a6a11ed4be77fb103a37433f66e5c9d21.zip
gcc-59a8062a6a11ed4be77fb103a37433f66e5c9d21.tar.gz
gcc-59a8062a6a11ed4be77fb103a37433f66e5c9d21.tar.bz2
re PR lto/84805 (ICE in get_odr_type, at ipa-devirt.c:2096 since r258133)
PR lto/84805 * ipa-devirt.c (odr_subtypes_equivalent_p): Do not get the ODR type of incomplete types. From-SVN: r258481
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ipa-devirt.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 74cb5eb..0937241 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-03-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR lto/84805
+ * ipa-devirt.c (odr_subtypes_equivalent_p): Do not get the ODR type of
+ incomplete types.
+
2018-03-13 Martin Liska <mliska@suse.cz>
PR ipa/84658.
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index fae8207..30d3757 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -656,7 +656,7 @@ set_type_binfo (tree type, tree binfo)
gcc_assert (!TYPE_BINFO (type));
}
-/* Compare T2 and T2 based on name or structure. */
+/* Compare T1 and T2 based on name or structure. */
static bool
odr_subtypes_equivalent_p (tree t1, tree t2,
@@ -678,7 +678,7 @@ odr_subtypes_equivalent_p (tree t1, tree t2,
return false;
/* For ODR types be sure to compare their names.
- To support -wno-odr-type-merging we allow one type to be non-ODR
+ To support -Wno-odr-type-merging we allow one type to be non-ODR
and other ODR even though it is a violation. */
if (types_odr_comparable (t1, t2, true))
{
@@ -690,6 +690,8 @@ odr_subtypes_equivalent_p (tree t1, tree t2,
therefore which call will report the ODR violation, if any. */
if (!odr_type_p (t1)
|| !odr_type_p (t2)
+ || !COMPLETE_TYPE_P (t1)
+ || !COMPLETE_TYPE_P (t2)
|| (!get_odr_type (t1, true)->odr_violated
&& !get_odr_type (t2, true)->odr_violated))
return true;