https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83983

amker at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amker at gcc dot gnu.org

--- Comment #8 from amker at gcc dot gnu.org ---
(In reply to Eric Botcazou from comment #6)
> > In other words, get_odr_type (t1, true) works on x86 and get_odr_type (t2,
> > true) works on ARM/SPARC, so maybe something like:
> > 
> > Index: ipa-devirt.c
> > ===================================================================
> > --- ipa-devirt.c        (revision 258068)
> > +++ ipa-devirt.c        (working copy)
> > @@ -686,7 +686,10 @@ odr_subtypes_equivalent_p (tree t1, tree t2,
> >          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)
> > +      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;
> >      }
> > 
> > is the proper thing to do.
> 
> This brings the missing warnings on SPARC (and presumably Aarch64 too) but
> gives the same order of warnings as on the HP-PA, so the test still formally
> fails.
> 
> In other words, the test is not sufficiently robust as currently written.

Yes, now on AArch64, we have:

/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_0.C:7:10: warning: type
'struct AsyncHooks' violates the C++ One Definition Rule [-Wodr]^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_1.C:2:10: note: a different
type is defined in another translation unit^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_0.C:8:21: note: the first
difference of corresponding definitions is field 'providers_'^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_1.C:3:21: note: a field of
same name but different type is defined in another translation unit^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_0.C:7:10: note: array types
have different bounds^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_0.C:6:8: warning: type
'struct Environment' violates the C++ One Definition Rule [-Wodr]^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_1.C:1:8: note: a different
type is defined in another translation unit^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_0.C:10:14: note: the first
difference of corresponding definitions is field 'async_hooks_'^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_1.C:5:14: note: a field of
same name but different type is defined in another translation unit^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_0.C:7:10: note: type
'struct AsyncHooks' itself violates the C++ One Definition Rule^M
/.../build/src/gcc/gcc/testsuite/g++.dg/lto/pr83121_1.C:2:10: note: the
incompatible type is defined here^M

FAIL: g++.dg/lto/pr83121  (test for LTO warnings, pr83121_0.C line 8)
FAIL: g++.dg/lto/pr83121  (test for LTO warnings, pr83121_1.C line 2)
FAIL: g++.dg/lto/pr83121  (test for LTO warnings, pr83121_1.C line 3)
FAIL: g++.dg/lto/pr83121 cp_lto_pr83121_0.o-cp_lto_pr83121_1.o link, -O0 -flto

Reply via email to