From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B863396EC8D; Mon, 16 Nov 2020 23:30:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B863396EC8D From: "hubicka at ucw dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/97857] [11 Regression] profiledbootstrap broken freeing speculative call summary since r11-4987-g602c6cfc79ce4ae61e277107e0a60079c1a93a97 Date: Mon, 16 Nov 2020 23:30:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at ucw dot cz X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Nov 2020 23:30:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97857 --- Comment #11 from Jan Hubicka --- This patch fixes the issue by making the conflict with C type sticky via clearing the CXX bit. I checked that it recovers profiledbootstrap, hwoever I want to look into the code tomorrow bit more to be sure that it does not disable more than it should. Honza diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index 880e527c590..91571d8e82a 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -211,8 +211,6 @@ type_with_linkage_p (const_tree t) if (!TYPE_CONTEXT (t)) return false; - gcc_checking_assert (TREE_CODE (t) =3D=3D ENUMERAL_TYPE || TYPE_CXX_ODR_= P (t)); - return true; } diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c index 6944c469f89..0a3033c3695 100644 --- a/gcc/lto/lto-common.c +++ b/gcc/lto/lto-common.c @@ -415,8 +415,8 @@ gimple_register_canonical_type_1 (tree t, hashval_t has= h) that we can use to lookup structurally equivalent non-ODR type. In case we decide to treat type as unique ODR type we recompute hash based on name and let TBAA machinery know about our decision. */ - if (RECORD_OR_UNION_TYPE_P (t) - && odr_type_p (t) && !odr_type_violation_reported_p (t)) + if (RECORD_OR_UNION_TYPE_P (t) && odr_type_p (t) + && TYPE_CXX_ODR_P (t) && !odr_type_violation_reported_p (t)) { /* Anonymous namespace types never conflict with non-C++ types. */ if (type_with_linkage_p (t) && type_in_anonymous_namespace_p (t)) @@ -434,6 +434,7 @@ gimple_register_canonical_type_1 (tree t, hashval_t has= h) if (slot && !TYPE_CXX_ODR_P (*(tree *)slot)) { tree nonodr =3D *(tree *)slot; + gcc_checking_assert (!flag_ltrans); if (symtab->dump_file) { fprintf (symtab->dump_file, diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index d7a451cfef4..237c87fbf62 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -343,7 +343,15 @@ pack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr) { bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1); bp_pack_value (bp, TYPE_FINAL_P (expr), 1); - bp_pack_value (bp, TYPE_CXX_ODR_P (expr), 1); + /* alias_ptr_types_compatible_p relies on fact that during LTO + types do not get refined from WPA time to ltrans. */ + gcc_checking_assert (!in_lto_p + || !TYPE_CANONICAL (expr) + || TYPE_CXX_ODR_P (TYPE_CANONICAL (expr)) + =3D=3D TYPE_CXX_ODR_P (expr)); + bp_pack_value (bp, flag_wpa && TYPE_CANONICAL (expr) + ? TYPE_CXX_ODR_P (TYPE_CANONICAL (expr)) + : TYPE_CXX_ODR_P (expr), 1); } else if (TREE_CODE (expr) =3D=3D ARRAY_TYPE) bp_pack_value (bp, TYPE_NONALIASED_COMPONENT (expr), 1);=