public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pph] Fix many segmentation faults when restoring C++ ASTs (issue4441070)
@ 2011-04-27  3:36 Diego Novillo
  0 siblings, 0 replies; only message in thread
From: Diego Novillo @ 2011-04-27  3:36 UTC (permalink / raw)
  To: reply, crowl, gcc-patches


I have been testing the C++ streamer with a collection of 6,576
C test cases taken from the GCC testsuite.

These C programs build fine with g++, so I encapsulated them inside a
single header file and created a .cc file that simply #includes it.

The intent is to make sure we can PPH generate and read a single
header file.  

Before this patch, we were failing to build about 1,800 test cases.
Most of those failures were due to the streamer reading an LTO tag for
a language-specific code and confusing it with a decl reference.  This
was happening because LTO tag codes were overlapping with language
specific tree codes.

With this patch the number of failures goes from 1,800 to 146.

I will be adding a .exp file to the testsuite in a future patch.
Right now, I'm testing this from a shell script.

Tested on x86_64.  Committed to the branch.


Diego.

ChangeLog.pph
2011-04-26  Diego Novillo  <dnovillo@google.com>

	* lto-streamer.h (enum LTO_tags): Change LTO_bb0 to begin
	after MAX_TREE_CODES.

diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index 8d5b1d2..b6f4b79 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -268,7 +268,7 @@ enum LTO_tags
 
      Conversely, to map between LTO tags and tree/gimple codes, the
      reverse operation must be applied.  */
-  LTO_bb0 = 1 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE,
+  LTO_bb0 = 1 + MAX_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE,
   LTO_bb1,
 
   /* EH region holding the previous statement.  */

--
This patch is available for review at http://codereview.appspot.com/4441070

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-26 23:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-27  3:36 [pph] Fix many segmentation faults when restoring C++ ASTs (issue4441070) Diego Novillo

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).