public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Diego Novillo" <dnovillo@google.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [lto] Fix binfo streaming
Date: Fri, 12 Sep 2008 14:35:00 -0000	[thread overview]
Message-ID: <b798aad50809120708r32b9b7e5y2d25fb880a130cc7@mail.gmail.com> (raw)

This testcase exposed a bug in binfo streaming.  Circular references
between decls and binfo caused a segmentation fault because when
reserving space for a newly created DECL we were using a NULL
placeholder, which caused problem when we needed to reference it again
before it had been completely built.

Tested on x86_64.


Diego.


2008-09-12  Bill Maddox  <maddox@google.com>

        * lto-function-in.c (input_var_decl): Enter DECL in the
        global vector even if it's only partially read.

testsuite/ChangeLog.lto:

        * g++.dg/lto/20080912.C:

Index: lto-function-in.c
===================================================================
--- lto-function-in.c   (revision 140314)
+++ lto-function-in.c   (working copy)
@@ -2901,7 +2901,7 @@ input_var_decl (struct lto_input_block *
      we must reserve the slot in the globals vector here,
      because the writer allocates the indices before writing
      out the type, etc.  */
-  index = global_vector_enter (data_in, NULL, true);
+  index = global_vector_enter (data_in, decl, true);

   /* omit locus, uid */
   input_tree (&decl->decl_minimal.name, ib, data_in);
Index: testsuite/g++.dg/lto/20080912.C
===================================================================
--- testsuite/g++.dg/lto/20080912.C     (revision 0)
+++ testsuite/g++.dg/lto/20080912.C     (revision 0)
@@ -0,0 +1,4 @@
+// { dg-do assemble }
+class Foo { virtual void f(); };
+class Bar:public Foo { };
+void func() { Bar(); }

                 reply	other threads:[~2008-09-12 14:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=b798aad50809120708r32b9b7e5y2d25fb880a130cc7@mail.gmail.com \
    --to=dnovillo@google.com \
    --cc=gcc-patches@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).