From: dnovillo@google.com (Diego Novillo)
To: reply@codereview.appspotmail.com, crowl@google.com,
gchare@google.com, gcc-patches@gcc.gnu.org
Subject: [pph] Stream and restore static_aggregates (issue4626096)
Date: Wed, 06 Jul 2011 04:18:00 -0000 [thread overview]
Message-ID: <20110706040822.573AA1DA1D1@topo.tor.corp.google.com> (raw)
This patch is a partial fix for c1eabi1.cc. We were missing static
initializers. There is another source of assembly difference in that
file, so I still need to dig some more.
This fixes x2nontrivinit.cc, however.
I am still not happy with the way we add bindings and symbols to
namespaces. We are missing several things, but I'm not quite sure
what yet. We'll need to restructure pph_add_bindings_to_namespace.
Tested on x86_64. Committed to branch.
Diego.
* pph-streamer-in.c (pph_add_bindings_to_namespace): Recurse into
each namespace bindings, if needed.
(pph_read_file_contents): Add static aggregates from STREAM into
static_aggregates.
* pph-streamer-out.c (pph_write_file_contents): Write
static_aggregates.
testsuite/ChangeLog.pph
* g++.dg/pph/x2nontrivinit.cc: Mark fixed.
diff --git a/gcc/cp/ChangeLog.pph b/gcc/cp/ChangeLog.pph
index 46b18be..a70ab0e 100644
--- a/gcc/cp/ChangeLog.pph
+++ b/gcc/cp/ChangeLog.pph
@@ -1,3 +1,12 @@
+2011-07-05 Diego Novillo <dnovillo@google.com>
+
+ * pph-streamer-in.c (pph_add_bindings_to_namespace): Recurse into
+ each namespace bindings, if needed.
+ (pph_read_file_contents): Add static aggregates from STREAM into
+ static_aggregates.
+ * pph-streamer-out.c (pph_write_file_contents): Write
+ static_aggregates.
+
2011-07-04 Gabriel Charette <gchare@google.com>
* pph-streamer-in.c (pph_add_bindings_to_namespace):
diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c
index 72536a5..0bab93b 100644
--- a/gcc/cp/pph-streamer-in.c
+++ b/gcc/cp/pph-streamer-in.c
@@ -1167,11 +1167,9 @@ pph_add_bindings_to_namespace (struct cp_binding_level *bl, tree ns)
/* Pushing a decl into a scope clobbers its DECL_CHAIN.
Preserve it. */
chain = DECL_CHAIN (t);
-
- /* FIXME pph: we should first check to see if it isn't already there.
- If it is, we should use this function recursively to merge
- the bindings in T in the corresponding namespace. */
pushdecl_into_namespace (t, ns);
+ if (NAMESPACE_LEVEL (t))
+ pph_add_bindings_to_namespace (NAMESPACE_LEVEL (t), t);
}
}
@@ -1314,7 +1312,7 @@ pph_read_file_contents (pph_stream *stream)
cpp_ident_use *bad_use;
const char *cur_def;
cpp_idents_used idents_used;
- tree fndecl, t, file_keyed_classes;
+ tree fndecl, t, file_keyed_classes, file_static_aggregates;
unsigned i;
VEC(tree,gc) *file_unemitted_tinfo_decls;
@@ -1342,6 +1340,9 @@ pph_read_file_contents (pph_stream *stream)
for (i = 0; VEC_iterate (tree, file_unemitted_tinfo_decls, i, t); i++)
VEC_safe_push (tree, gc, unemitted_tinfo_decls, t);
+ file_static_aggregates = pph_in_tree (stream);
+ static_aggregates = chainon (file_static_aggregates, static_aggregates);
+
/* Expand all the functions with bodies that we read from STREAM. */
for (i = 0; VEC_iterate (tree, stream->fns_to_expand, i, fndecl); i++)
{
diff --git a/gcc/cp/pph-streamer-out.c b/gcc/cp/pph-streamer-out.c
index acc0352..abe05a2 100644
--- a/gcc/cp/pph-streamer-out.c
+++ b/gcc/cp/pph-streamer-out.c
@@ -1202,6 +1202,7 @@ pph_write_file_contents (pph_stream *stream, cpp_idents_used *idents_used)
pph_dump_namespace (pph_logfile, global_namespace);
pph_out_tree (stream, keyed_classes, false);
pph_out_tree_vec (stream, unemitted_tinfo_decls, false);
+ pph_out_tree (stream, static_aggregates, false);
}
diff --git a/gcc/testsuite/ChangeLog.pph b/gcc/testsuite/ChangeLog.pph
index 530adb5..da45f01 100644
--- a/gcc/testsuite/ChangeLog.pph
+++ b/gcc/testsuite/ChangeLog.pph
@@ -1,3 +1,7 @@
+2011-07-05 Diego Novillo <dnovillo@google.com>
+
+ * g++.dg/pph/x2nontrivinit.cc: Mark fixed.
+
2011-07-04 Diego Novillo <dnovillo@google.com>
* g++.dg/pph/pph.map: Sort.
diff --git a/gcc/testsuite/g++.dg/pph/x2nontrivinit.cc b/gcc/testsuite/g++.dg/pph/x2nontrivinit.cc
index b142ac2..96ecce2 100644
--- a/gcc/testsuite/g++.dg/pph/x2nontrivinit.cc
+++ b/gcc/testsuite/g++.dg/pph/x2nontrivinit.cc
@@ -1,3 +1 @@
-// pph asm xdiff
-
#include "x2nontrivinit.h"
--
This patch is available for review at http://codereview.appspot.com/4626096
next reply other threads:[~2011-07-06 4:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 4:18 Diego Novillo [this message]
2011-07-06 17:17 ` Gabriel Charette
2011-07-06 18:32 ` Diego Novillo
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=20110706040822.573AA1DA1D1@topo.tor.corp.google.com \
--to=dnovillo@google.com \
--cc=crowl@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gchare@google.com \
--cc=reply@codereview.appspotmail.com \
/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).