Patchwork (partially) fix lto bootstrap (PR bootstrap/48148)

login
register
mail settings
Submitter Jakub Jelinek
Date April 1, 2011, 9:18 p.m.
Message ID <20110401211840.GD18914@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/89345/
State New
Headers show

Comments

Jakub Jelinek - April 1, 2011, 9:18 p.m.
Hi!

richi's lto-cgraph.c change actually didn't do anything, because
DECL_ABSTRACT_ORIGIN is still NULL there, see PR for details.
This patch instead doesn't try to force dies for DECL_ABSTRACT_ORIGIN
DECL_EXTERNAL decls, as dwarf2out isn't prepared to handle them.

Bootstrapped/regtested on x86_64-linux and i686-linux,
attempted also LTO bootstrap, but it failed in other unrelated
places (x86_64 somewhere in Ada and i686 because it was trying
to emit .Ldebug_info0 twice).  I'll try to look at those later,
but this is a step forward, approved on IRC by rth.

2011-04-01  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/48148
	* dwarf2out.c (resolve_addr): Don't call force_decl_die
	if DECL_EXTERNAL has non-NULL DECL_ABSTRACT_ORIGIN.

	Revert:
	2011-03-17  Richard Guenther  <rguenther@suse.de>

	PR bootstrap/48148
	* lto-cgraph.c (input_overwrite_node): Clear the abstract
	origin for decls in other ltrans units.
	(input_varpool_node): Likewise.


	Jakub
H.J. Lu - April 5, 2011, 2:53 a.m.
On Fri, Apr 1, 2011 at 2:18 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> richi's lto-cgraph.c change actually didn't do anything, because
> DECL_ABSTRACT_ORIGIN is still NULL there, see PR for details.
> This patch instead doesn't try to force dies for DECL_ABSTRACT_ORIGIN
> DECL_EXTERNAL decls, as dwarf2out isn't prepared to handle them.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux,
> attempted also LTO bootstrap, but it failed in other unrelated
> places (x86_64 somewhere in Ada and i686 because it was trying
> to emit .Ldebug_info0 twice).  I'll try to look at those later,
> but this is a step forward, approved on IRC by rth.
>

Emitting .Ldebug_info0 twice is caused by revision 171033:

http://gcc.gnu.org/ml/gcc-cvs/2011-03/msg00455.html

Patch

--- gcc/dwarf2out.c.jj	2011-04-01 11:04:36.000000000 +0200
+++ gcc/dwarf2out.c	2011-04-01 18:08:30.864796302 +0200
@@ -23023,7 +23023,9 @@  resolve_addr (dw_die_ref die)
 	  {
 	    tree tdecl = SYMBOL_REF_DECL (a->dw_attr_val.v.val_addr);
 	    dw_die_ref tdie = lookup_decl_die (tdecl);
-	    if (tdie == NULL && DECL_EXTERNAL (tdecl))
+	    if (tdie == NULL
+		&& DECL_EXTERNAL (tdecl)
+		&& DECL_ABSTRACT_ORIGIN (tdecl) == NULL_TREE)
 	      {
 		force_decl_die (tdecl);
 		tdie = lookup_decl_die (tdecl);
--- gcc/lto-cgraph.c.jj	2011-03-17 16:20:09.000000000 +0100
+++ gcc/lto-cgraph.c	2011-04-01 18:02:37.570845862 +0200
@@ -975,7 +975,6 @@  input_overwrite_node (struct lto_file_de
 	  || node->clone_of->decl != node->decl))
     {
       DECL_EXTERNAL (node->decl) = 1;
-      DECL_ABSTRACT_ORIGIN (node->decl) = NULL_TREE;
       TREE_STATIC (node->decl) = 0;
     }
   node->alias = bp_unpack_value (bp, 1);
@@ -1147,7 +1146,6 @@  input_varpool_node (struct lto_file_decl
   if (node->in_other_partition)
     {
       DECL_EXTERNAL (node->decl) = 1;
-      DECL_ABSTRACT_ORIGIN (node->decl) = NULL_TREE;
       TREE_STATIC (node->decl) = 0;
     }
   aliases_p = bp_unpack_value (&bp, 1);