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] Don't write DECL_ABSTRACT_ORIGIN


We don't use it, and it sometimes it points to strange places and
causes problems. A particular instance I had was a VAR_DECL pointing
to a RESULT_DECL of a function that had been inlined away.

2009-01-21  Rafael Avila de Espindola  <espindola@google.com>

	* lto-function-in.c (input_local_var_decl): Don't read
	DECL_ABSTRACT_ORIGIN.
	* lto-function-out.c (output_local_var_decl): Don't write
	DECL_ABSTRACT_ORIGIN.

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 028dbe3..8e86464 100644
--- a/gcc/lto-function-in.c
+++ b/gcc/lto-function-in.c
@@ -1229,10 +1229,7 @@ input_local_var_decl (struct lto_input_block *ib, struct data_in *data_in,
     SET_DECL_DEBUG_EXPR (result, 
 			 input_expr_operand (ib, data_in, fn, 
 					     input_record_start (ib)));
-  if (variant & 0x8)
-    DECL_ABSTRACT_ORIGIN (result) 
-      = input_expr_operand (ib, data_in, fn, input_record_start (ib));
-  
+
   process_tree_flags (result, flags);
   LTO_DEBUG_UNDENT();
 
diff --git a/gcc/lto-function-out.c b/gcc/lto-function-out.c
index 01b990e..41ace08 100644
--- a/gcc/lto-function-out.c
+++ b/gcc/lto-function-out.c
@@ -1255,8 +1255,7 @@ output_local_var_decl (struct output_block *ob, int index)
   variant |= DECL_ATTRIBUTES (decl)      != NULL_TREE ? 0x01 : 0;
   variant |= DECL_SIZE_UNIT (decl)       != NULL_TREE ? 0x02 : 0;
   variant |= needs_backing_var                        ? 0x04 : 0;
-  variant |= DECL_ABSTRACT_ORIGIN (decl) != NULL_TREE ? 0x08 : 0;
-  
+
   tag = (is_var
 	 ? LTO_local_var_decl_body0
 	 : LTO_parm_decl_body0)
@@ -1339,9 +1338,11 @@ output_local_var_decl (struct output_block *ob, int index)
     output_expr_operand (ob, DECL_SIZE_UNIT (decl));
   if (needs_backing_var)
     output_expr_operand (ob, DECL_DEBUG_EXPR (decl));
-  if (DECL_ABSTRACT_ORIGIN (decl) != NULL_TREE)
-    output_expr_operand (ob, DECL_ABSTRACT_ORIGIN (decl));
-  
+
+  /* FIXME lto: We don't need DECL_ABSTRACT_ORIGIN. We should probably clear it
+   before getting here. It is created by the inliner after
+   reset_decl_lang_specific. */
+
   LTO_DEBUG_UNDENT();
 }
 

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