re PR ipa/83983 (FAIL: g++.dg/lto/pr83121 (test for LTO warnings, pr83121_0.C line 8))

PR ipa/83983
	* ipa-devirt.c (odr_subtypes_equivalent_p): Get the ODR type of both
	arguments if they are comparable.

From-SVN: r258133
This commit is contained in:
Eric Botcazou 2018-03-02 09:57:43 +00:00 committed by Eric Botcazou
parent 587b2f674c
commit 2265b6fed1
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2018-03-02 Eric Botcazou <ebotcazou@adacore.com>
PR ipa/83983
* ipa-devirt.c (odr_subtypes_equivalent_p): Get the ODR type of both
arguments if they are comparable.
2018-03-02 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/84634

View File

@ -684,9 +684,14 @@ odr_subtypes_equivalent_p (tree t1, tree t2,
{
if (!types_same_for_odr (t1, t2, true))
return false;
/* Limit recursion: If subtypes are ODR types and we know
that they are same, be happy. */
if (!odr_type_p (t1) || !get_odr_type (t1, true)->odr_violated)
/* Limit recursion: if subtypes are ODR types and we know that they are
same, be happy. We need to call get_odr_type on both subtypes since
we don't know which among t1 and t2 defines the common ODR type and
therefore which call will report the ODR violation, if any. */
if (!odr_type_p (t1)
|| !odr_type_p (t2)
|| (!get_odr_type (t1, true)->odr_violated
&& !get_odr_type (t2, true)->odr_violated))
return true;
}