public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: hubicka at ucw dot cz <gcc-bugzilla@gcc.gnu.org>
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: [Bug bootstrap/97857] [11 Regression] profiledbootstrap broken freeing speculative call summary since r11-4987-g602c6cfc79ce4ae61e277107e0a60079c1a93a97
Date: Tue, 17 Nov 2020 00:30:17 +0100	[thread overview]
Message-ID: <20201116233017.GI32961@kam.mff.cuni.cz> (raw)
In-Reply-To: <bug-97857-4-2f73u43oHT@http.gcc.gnu.org/bugzilla/>

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) == 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 hash)
      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 hash)
       if (slot && !TYPE_CXX_ODR_P (*(tree *)slot))
 	{
 	  tree nonodr = *(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))
+			      == 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) == ARRAY_TYPE)
     bp_pack_value (bp, TYPE_NONALIASED_COMPONENT (expr), 1);


  reply	other threads:[~2020-11-16 23:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 18:22 [Bug bootstrap/97857] New: profiledbootstrap broken freeing speculative call summary hubicka at gcc dot gnu.org
2020-11-16 19:38 ` [Bug bootstrap/97857] [11 Regression] profiledbootstrap broken freeing speculative call summary since r11-4987-g602c6cfc79ce4ae61e277107e0a60079c1a93a97 marxin at gcc dot gnu.org
2020-11-16 19:48   ` Jan Hubicka
2020-11-16 19:48 ` hubicka at ucw dot cz
2020-11-16 19:50 ` marxin at gcc dot gnu.org
2020-11-16 19:54   ` Jan Hubicka
2020-11-16 19:54 ` hubicka at ucw dot cz
2020-11-16 19:58 ` marxin at gcc dot gnu.org
2020-11-16 20:03 ` marxin at gcc dot gnu.org
2020-11-16 20:09   ` Jan Hubicka
2020-11-16 20:09 ` hubicka at ucw dot cz
2020-11-16 21:27 ` hubicka at gcc dot gnu.org
2020-11-16 21:43   ` Jan Hubicka
2020-11-16 21:43 ` hubicka at ucw dot cz
2020-11-16 22:55 ` hubicka at ucw dot cz
2020-11-16 23:30   ` Jan Hubicka [this message]
2020-11-16 23:30 ` hubicka at ucw dot cz
2020-11-17  7:09 ` marxin at gcc dot gnu.org
2020-11-17 14:38 ` cvs-commit at gcc dot gnu.org
2020-11-17 14:43 ` hubicka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201116233017.GI32961@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-bugzilla@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).