public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/65475] [5 Regression] ICE in odr_vtable_hasher::equal (Segmentation fault)
Date: Fri, 20 Mar 2015 08:29:00 -0000	[thread overview]
Message-ID: <bug-65475-4-ZQwvCbE8Ql@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65475-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The following should help:
Index: ipa-devirt.c
===================================================================
--- ipa-devirt.c        (revision 221528)
+++ ipa-devirt.c        (working copy)
@@ -1412,9 +1412,18 @@ add_type_duplicate (odr_type val, tree t
   if (!val->types_set)
     val->types_set = new hash_set<tree>;

+  /* Chose polymorphic type as leader (this happens only in case of ODR
+     violations.  */
+  if ((TREE_CODE (type) == RECORD_TYPE && TYPE_BINFO (type)
+       && polymorphic_type_binfo_p (TYPE_BINFO (type)))
+      && (TREE_CODE (val->type) != RECORD_TYPE || !TYPE_BINFO (val->type)
+          || !polymorphic_type_binfo_p (TYPE_BINFO (val->type))))
+    {
+      prevail = true;
+      build_bases = true;
+    }
   /* Always prefer complete type to be the leader.  */
-
-  if (!COMPLETE_TYPE_P (val->type) && COMPLETE_TYPE_P (type))
+  else if (!COMPLETE_TYPE_P (val->type) && COMPLETE_TYPE_P (type))
     {
       prevail = true;
       build_bases = TYPE_BINFO (type);


  parent reply	other threads:[~2015-03-20  5:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 19:44 [Bug lto/65475] New: " marxin at gcc dot gnu.org
2015-03-19 19:59 ` [Bug lto/65475] " marxin at gcc dot gnu.org
2015-03-19 22:21 ` hubicka at gcc dot gnu.org
2015-03-20  8:29 ` hubicka at gcc dot gnu.org [this message]
2015-03-20 10:07 ` marxin at gcc dot gnu.org
2015-03-20 10:58 ` rguenth at gcc dot gnu.org
2015-03-20 19:11 ` hubicka at ucw dot cz
2015-03-20 19:12 ` hubicka at gcc dot gnu.org
2015-03-20 21:41 ` hubicka at gcc dot gnu.org
2015-03-23  2:19 ` hubicka at gcc dot gnu.org
2015-03-23  3:01 ` hubicka at gcc dot gnu.org
2015-03-23 21:07 ` jakub 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=bug-65475-4-ZQwvCbE8Ql@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).