From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26073 invoked by alias); 23 Jan 2020 13:46:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 26058 invoked by uid 89); 23 Jan 2020 13:46:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-19.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,KAM_LOTSOFHASH,SPF_PASS autolearn=ham version=3.3.1 spammy=H*UA:https, dominique, gr=c3=bc=c3?= X-HELO: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Jan 2020 13:46:32 +0000 IronPort-SDR: oq7S4Nq0FfHdH7rICPqPngXzbo6hnG4ODwTHFkw7oUCc1PdyYcGhwAvRupjGgXDoXDQgie87+P gVlQWNh3OFRpKVSoNQbkpB32mCidAjhc47Hnh687VJwZLv8baHMfqihrkwzgA5JPKZWAVrrrax NRWWHsERDKrl+g5KKYnz5nNnzfn3nMdA6XJHISgn8ZtzGFHUDeIGl6TCY7lnqRtbn7fBuHxNkh hIqjXvhmCZWyXeqbH2NMvd1wJlSldkA2kF8YR6SIiFF+mKjRWGH5rOuIXmOe9oLWCYZ9QpcoY5 nhg= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 23 Jan 2020 05:46:30 -0800 IronPort-SDR: 0Wx1XsVrtTwmSfXVvC/6DmwAaWA0fXaQWF4T1+m7piiJB6YLMc3yVaOcrDrfH4pUBLaTv7eu5Q i4pyFx0+YqQw== From: Thomas Schwinge To: , Jan Hubicka , Martin Liska CC: Richard Biener , Subject: Re: Fix false -Wodr warnings In-Reply-To: References: <20190414205904.ojeyug5rlayaig4q@kam.mff.cuni.cz> User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Thu, 23 Jan 2020 13:53:00 -0000 Message-ID: <87lfpythen.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-Path: tschwing@mentor.com X-SW-Source: 2020-01/txt/msg01578.txt.bz2 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 4223 Hi! On 2019-04-15T13:55:39+0200, Richard Biener wr= ote: > On Sun, Apr 14, 2019 at 10:59 PM Jan Hubicka wrote: >> this patch fixes false warning that is output when different -std >> settings are used. In this case C++ FE produces same declaration in >> different representations which differ by 0 sized fileds only. >> The patch makes them to be ignored (and I checked we ignore them for >> canonical type merging too) >> >> Bootstrapped/regtested x86_64-linux, comitted. In 13ef7dc2448c0f9d8981577bb5448ee9b6842b1c "Backport d2a0371d2641e85c5e6ca396029be32204d976df", Martin backported this to releases/gcc-8, but without including the fix-up for... > The testcase is bogus > > WARNING: lto.exp does not support dg-do > WARNING: lto.exp does not support dg-options in primary source file ... that one. As obvious, pushed Dominique's trunk r270390/commit ef9387d8fe79219a106c3f9d6c6a87b0a9065d54 to releases/gcc-8 in 8e55f241ab8c754a2ab8ec2fe39afd9173589401 "pr89358_0.C: Replace dg-* with dg-lto-*.", see attached. Gr=C3=BC=C3=9Fe Thomas >> PR lto/89358 >> * g++.dg/lto/pr89358_0.C: New testcase. >> * g++.dg/lto/pr89358_1.C: New testcase. >> * ipa-devirt.c (skip_in_fields_list_p): New. >> (odr_types_equivalent_p): Use it. >> Index: testsuite/g++.dg/lto/pr89358_0.C >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- testsuite/g++.dg/lto/pr89358_0.C (nonexistent) >> +++ testsuite/g++.dg/lto/pr89358_0.C (working copy) >> @@ -0,0 +1,11 @@ >> +/* { dg-do link } */ >> +/* { dg-options "-std=3Dc++17" } */ >> +#include >> + >> +extern void test(); >> + >> +int main() >> +{ >> + std::map m; >> + test(); >> +} >> Index: testsuite/g++.dg/lto/pr89358_1.C >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- testsuite/g++.dg/lto/pr89358_1.C (nonexistent) >> +++ testsuite/g++.dg/lto/pr89358_1.C (working copy) >> @@ -0,0 +1,7 @@ >> +/* { dg-options "-std=3Dc++14" } */ >> +#include >> + >> +void test() >> +{ >> + std::map m; >> +} >> Index: ipa-devirt.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- ipa-devirt.c (revision 270324) >> +++ ipa-devirt.c (working copy) >> @@ -1282,6 +1282,24 @@ warn_types_mismatch (tree t1, tree t2, l >> inform (loc_t2, "the incompatible type is defined here"); >> } >> >> +/* Return true if T should be ignored in TYPE_FIELDS for ODR comparsion= . */ >> + >> +static bool >> +skip_in_fields_list_p (tree t) >> +{ >> + if (TREE_CODE (t) !=3D FIELD_DECL) >> + return true; >> + /* C++ FE introduces zero sized fields depending on -std setting, see >> + PR89358. */ >> + if (DECL_SIZE (t) >> + && integer_zerop (DECL_SIZE (t)) >> + && DECL_ARTIFICIAL (t) >> + && DECL_IGNORED_P (t) >> + && !DECL_NAME (t)) >> + return true; >> + return false; >> +} >> + >> /* Compare T1 and T2, report ODR violations if WARN is true and set >> WARNED to true if anything is reported. Return true if types match. >> If true is returned, the types are also compatible in the sense of >> @@ -1548,9 +1566,9 @@ odr_types_equivalent_p (tree t1, tree t2 >> f1 =3D TREE_CHAIN (f1), f2 =3D TREE_CHAIN (f2)) >> { >> /* Skip non-fields. */ >> - while (f1 && TREE_CODE (f1) !=3D FIELD_DECL) >> + while (f1 && skip_in_fields_list_p (f1)) >> f1 =3D TREE_CHAIN (f1); >> - while (f2 && TREE_CODE (f2) !=3D FIELD_DECL) >> + while (f2 && skip_in_fields_list_p (f2)) >> f2 =3D TREE_CHAIN (f2); >> if (!f1 || !f2) >> break; --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-pr89358_0.C-Replace-dg-with-dg-lto.gcc-8.patch Content-Transfer-Encoding: quoted-printable Content-length: 1436 =46rom 8e55f241ab8c754a2ab8ec2fe39afd9173589401 Mon Sep 17 00:00:00 2001 From: Dominique d'Humieres Date: Tue, 16 Apr 2019 15:24:58 +0200 Subject: [PATCH] pr89358_0.C: Replace dg-* with dg-lto-*. 2019-04-16 Dominique d'Humieres * g++.dg/lto/pr89358_0.C: Replace dg-* with dg-lto-*. (cherry picked from trunk r270390/commit ef9387d8fe79219a106c3f9d6c6a87b0a9= 065d54) --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/g++.dg/lto/pr89358_0.C | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c2c5559b9b5..1d0ed10a84ac 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2020-01-23 Thomas Schwinge + + Backport: + 2019-04-16 Dominique d'Humieres + + * g++.dg/lto/pr89358_0.C: Replace dg-* with dg-lto-*. + 2020-01-22 Joseph Myers =20 Backport from mainline: diff --git a/gcc/testsuite/g++.dg/lto/pr89358_0.C b/gcc/testsuite/g++.dg/lt= o/pr89358_0.C index aebd2127c0cf..328c60c2fb18 100644 --- a/gcc/testsuite/g++.dg/lto/pr89358_0.C +++ b/gcc/testsuite/g++.dg/lto/pr89358_0.C @@ -1,5 +1,5 @@ -/* { dg-do link } */ -/* { dg-options "-std=3Dc++17" } */ +/* { dg-lto-do link } */ +/* { dg-lto-options "-std=3Dc++17" } */ #include =20 extern void test(); --=20 2.17.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 658 -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEU9WEfWKGQazCmycCAKI7+41Q4XkFAl4po6EACgkQAKI7+41Q 4Xnq8wv+Oz310G7odKO7pKioHyOB+AzUmtTfAubg+CtG3W0ryMqoVV8c/2Sb7M03 kFHQL4FpKrT+tdajnP21ZF6yPL3VOQWPd7BziGD6W0KyPVGnXq+sppGH2Qk6baE3 Buv13OV0Jq2a3l4ztFDzvaIXpgTLemNPCesLJaFVQ+hOBsf/zrUf2NdiYaCDQaQe s/BnF9nqRp48iJd+H3EL/hSbN3nPXMEtNXq25s4kvSmLqFxALNlEsXzSxYmn1xMR 73LChbKS2h9lI/qTJsiq+kIyqLwvQxZurlmYf4PeRckpstVRmudM1YAZGX5qGhte RlQ1ByuWz1gAUcoL+4maRoktfgC2pbRosZpW/yXmJPax2K0+5Vrd5jLjsA1ttv9U YbRmxVDCQ9zJDfqvGHBZ5bXmyA5SYJ0ir+AD4oIwUsC0+MkPjit83ll2SEHz81Qj MrRHRSD+PJzgqPRaIfylbvV2domKXR0uGnPsyfSOtznQb5Rg6L7+8ggk0ab2GmUm EAhxes5d =pmBs -----END PGP SIGNATURE----- --==-=-=--