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] Fix problems with DECL_ABSTRACT


The proper solution is to just remove all DECL_ABSTRACT decls before
writing the IL to disk. This hack will do for now.

2008-09-30 Rafael Espindola  <espindola@google.com>

	* lto-function-in.c (get_resolution): Assert the decl is not DECL_ABSTRACT.
	(input_function_decl): Don't merge DECL_ABSTRACT function decls.

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-in.c b/gcc/lto-function-in.c
index 6540541..b5e20a7 100644
--- a/gcc/lto-function-in.c
+++ b/gcc/lto-function-in.c
@@ -2852,6 +2852,7 @@ get_resolution (struct data_in *data_in, unsigned index)
       /* Fake symbol resolution in the case no resolution file was provided. */
       tree t = VEC_index (tree, data_in->globals_index, index);
       gcc_assert (TREE_PUBLIC (t));
+      gcc_assert (!DECL_ABSTRACT (t));
       if (DECL_EXTERNAL (t))
 	return LDPR_RESOLVED_IR;
       else
@@ -2945,11 +2946,11 @@ input_function_decl (struct lto_input_block *ib, struct data_in *data_in)
 
   /* If the function has already been declared, merge the
      declarations.  */
-  if (TREE_PUBLIC (decl))
+  if (TREE_PUBLIC (decl) && !DECL_ABSTRACT (decl))
     {
       enum ld_plugin_symbol_resolution resolution =
 	get_resolution (data_in, index);
-      tree merged = lto_symtab_merge_var (decl, resolution);
+      tree merged = lto_symtab_merge_fn (decl, resolution);
       /* If merge fails, use the original declaraction.  */
       if (merged != error_mark_node)
 	decl = merged;

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