From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6627 invoked by alias); 30 Jun 2011 20:24:31 -0000 Received: (qmail 6617 invoked by uid 22791); 30 Jun 2011 20:24:30 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Jun 2011 20:24:13 +0000 Received: from kpbe16.cbf.corp.google.com (kpbe16.cbf.corp.google.com [172.25.105.80]) by smtp-out.google.com with ESMTP id p5UKOA6Y006013; Thu, 30 Jun 2011 13:24:11 -0700 Received: from gchare.mtv.corp.google.com (gchare.mtv.corp.google.com [172.18.111.122]) by kpbe16.cbf.corp.google.com with ESMTP id p5UKO9qP011408; Thu, 30 Jun 2011 13:24:09 -0700 Received: by gchare.mtv.corp.google.com (Postfix, from userid 138564) id D5A291C1942; Thu, 30 Jun 2011 13:24:08 -0700 (PDT) To: reply@codereview.appspotmail.com, crowl@google.com, dnovillo@google.com, gcc-patches@gcc.gnu.org Subject: [pph] Stream first/weak_object_global_name (issue4641086) Message-Id: <20110630202408.D5A291C1942@gchare.mtv.corp.google.com> Date: Thu, 30 Jun 2011 21:09:00 -0000 From: gchare@google.com (Gabriel Charette) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg02403.txt.bz2 first/weak_global_object_name are part of the global state. This seems to be used to produce the assembler names. They are set only once as early as possible in the parsing; thus we should define it to be whatever it was in the first pph (or even in the C file if it was set before any pph was even loaded. I'm not sure exactly what this does, but trying to find a fix for the asm diffs this is the first thing that I hit in the compiler logic that was different in the good compiler vs the pph compiler. With this fix this bit of logic is now correct. However, this doesn't fix any pph test (nor does it even change any pph asm (I diff'ed the old bad assemblies (*.s+pph) with the new ones)). Tested with bootstrap build and pph regression testing. 2011-06-30 Gabriel Charette * Make-lang.in (pph-streamer-out.o): Add dependence on output.h (pph-streamer-in.o): Add dependence on output.h * pph-streamer-in.c (pph_read_file_contents): Stream in first_global_object_name and weak_global_object_name. * gcc/cp/pph-streamer-out.c (pph_write_file_contents): Stream out first_global_object_name and weak_global_object_name. diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 0bb1a15..ec7596a 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -350,8 +350,8 @@ cp/pph-streamer.o: cp/pph-streamer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ cp/pph-streamer-out.o: cp/pph-streamer-out.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TREE_H) tree-pretty-print.h $(LTO_STREAMER_H) \ $(CXX_PPH_STREAMER_H) $(CXX_PPH_H) $(TREE_PASS_H) version.h \ - cppbuiltin.h tree-iterator.h + cppbuiltin.h tree-iterator.h output.h cp/pph-streamer-in.o: cp/pph-streamer-in.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TREE_H) tree-pretty-print.h $(LTO_STREAMER_H) \ $(CXX_PPH_STREAMER_H) $(CXX_PPH_H) $(TREE_PASS_H) version.h \ - cppbuiltin.h tree-iterator.h + cppbuiltin.h tree-iterator.h output.h diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c index 3ac5243..c341d50 100644 --- a/gcc/cp/pph-streamer-in.c +++ b/gcc/cp/pph-streamer-in.c @@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "version.h" #include "cppbuiltin.h" +#include "output.h" /* Wrapper for memory allocation calls that should have their results registered in the PPH streamer cache. DATA is the pointer returned @@ -1309,7 +1310,7 @@ pph_read_file_contents (pph_stream *stream) { bool verified; cpp_ident_use *bad_use; - const char *cur_def; + const char *cur_def, *pph_fgon, *pph_wgon; cpp_idents_used idents_used; tree fndecl; unsigned i; @@ -1325,6 +1326,16 @@ pph_read_file_contents (pph_stream *stream) /* Re-instantiate all the pre-processor symbols defined by STREAM. */ cpp_lt_replay (parse_in, &idents_used); + /* If first_global_object_name is not set yet, set it to the pph one. */ + pph_fgon = pph_in_string (stream); + if (!first_global_object_name) + first_global_object_name = pph_fgon; + + /* If weak_global_object_name is not set yet, set it to the pph one. */ + pph_wgon = pph_in_string (stream); + if (!weak_global_object_name) + weak_global_object_name = pph_wgon; + /* Read the bindings from STREAM and merge them with the current bindings. */ pph_in_scope_chain (stream); diff --git a/gcc/cp/pph-streamer-out.c b/gcc/cp/pph-streamer-out.c index acc0352..0d29f0b 100644 --- a/gcc/cp/pph-streamer-out.c +++ b/gcc/cp/pph-streamer-out.c @@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "version.h" #include "cppbuiltin.h" +#include "output.h" /* FIXME pph. This holds the FILE handle for the current PPH file that we are writing. It is necessary because the LTO callbacks do @@ -1197,9 +1198,14 @@ static void pph_write_file_contents (pph_stream *stream, cpp_idents_used *idents_used) { pph_out_identifiers (stream, idents_used); + + pph_out_string (stream, first_global_object_name); + pph_out_string (stream, weak_global_object_name); + pph_out_scope_chain (stream, scope_chain, false); if (flag_pph_dump_tree) pph_dump_namespace (pph_logfile, global_namespace); + pph_out_tree (stream, keyed_classes, false); pph_out_tree_vec (stream, unemitted_tinfo_decls, false); } -- This patch is available for review at http://codereview.appspot.com/4641086