This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto][patch] Allocate enough space in lto_types_needed_for and lto_flags_needed_for


2008-09-11  Rafael Avila de Espindola  <espindola@google.com>

	* lto-function-out.c (lto_static_init):  Allocate enough space in
	lto_types_needed_for and lto_flags_needed_for.

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/lto-function-out.c b/gcc/lto-function-out.c
index c34321a..b3585c8 100644
--- a/gcc/lto-function-out.c
+++ b/gcc/lto-function-out.c
@@ -2046,7 +2046,13 @@ lto_static_init (void)
 
   initialized = true;
 
-  lto_flags_needed_for = sbitmap_alloc (NUM_TREE_CODES);
+/* FIXME lto: The size of this array should be NUM_TREE_CODES,
+   but that accounts only for the base tree codes.  We are currently
+   serializing certain FE-specific nodes, such as COMPOUND_LITERAL_EXPR.
+   Here, we generously allow for all tree codes.  This has the unpleasant
+   property of leaving many undefined entries in the array.  */
+
+  lto_flags_needed_for = sbitmap_alloc (MAX_TREE_CODES);
   sbitmap_ones (lto_flags_needed_for);
   RESET_BIT (lto_flags_needed_for, FIELD_DECL);
   RESET_BIT (lto_flags_needed_for, FUNCTION_DECL);
@@ -2060,7 +2066,13 @@ lto_static_init (void)
   RESET_BIT (lto_flags_needed_for, TRANSLATION_UNIT_DECL);
   RESET_BIT (lto_flags_needed_for, NAMESPACE_DECL);
 
-  lto_types_needed_for = sbitmap_alloc (NUM_TREE_CODES);
+/* FIXME lto: The size of this array should be NUM_TREE_CODES,
+   but that accounts only for the base tree codes.  We are currently
+   serializing certain FE-specific nodes, such as COMPOUND_LITERAL_EXPR.
+   Here, we generously allow for all tree codes.  This has the unpleasant
+   property of leaving many undefined entries in the array.  */
+
+  lto_types_needed_for = sbitmap_alloc (MAX_TREE_CODES);
 
   /* Global declarations and types will handle the
      type field by other means, so lto_types_needed_for

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]