aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2020-07-15 23:31:34 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-07-15 23:31:34 -0300
commitb917f6bf4192a0e910de6752ad0e95fbba309e2f (patch)
tree2e417f5628ea71a58f6d87b868aa5ac83750d06f
parent33c9262ecfa1bc812f957b8f7e859e1679e90c79 (diff)
downloadgcc-b917f6bf4192a0e910de6752ad0e95fbba309e2f.zip
gcc-b917f6bf4192a0e910de6752ad0e95fbba309e2f.tar.gz
gcc-b917f6bf4192a0e910de6752ad0e95fbba309e2f.tar.bz2
Get bootstrap to work with symbol promotion.
Previously, bootstrap was failing when compiling `genattrtab.c' because a required varnode was being mistakenly removed of the symbol table. This commit addresses this. gcc/ChangeLog 2020-07-14 Giuliano Belinassi <giuliano.belinassi@usp.br> * symtab.c (find_by_order): New function. (find_by_name): New function. (find_by_asm_naem): New function. * lto-cgraph.c (handle_node_in_boundary): Promote varnode in boundary to be external.
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/cgraph.h9
-rw-r--r--gcc/lto-cgraph.c5
-rw-r--r--gcc/symtab.c34
4 files changed, 55 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 55474f0..9019521 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2020-07-14 Giuliano Belinassi <giuliano.belinassi@usp.br>
+ * symtab.c (find_by_order): New function.
+ (find_by_name): New function.
+ (find_by_asm_naem): New function.
+ * lto-cgraph.c (handle_node_in_boundary): Promote varnode in boundary
+ to be external.
+
+2020-07-14 Giuliano Belinassi <giuliano.belinassi@usp.br>
+
* cgraphunit.c (ipa_passes): Move split_outputs to.
(symbol_table::compile): Here. Also make sure it runs after the IPA
transformation stage.
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 962670c..a7779c1 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -463,6 +463,15 @@ public:
Return NULL if there's no such node. */
static symtab_node *get_for_asmname (const_tree asmname);
+ /* Get symtab node by order. */
+ static symtab_node *find_by_order (int order);
+
+ /* Get symtab_node by its name. */
+ static symtab_node *find_by_name (const char *);
+
+ /* Get symtab_node by its ASM name. */
+ static symtab_node *find_by_asm_name (const char *);
+
/* Verify symbol table for internal consistency. */
static DEBUG_FUNCTION void verify_symtab_nodes (void);
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 1971fdb..c57d16a 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -2126,7 +2126,10 @@ handle_node_in_boundary (symtab_node *node, bool keep_body)
}
}
else if (is_a <varpool_node *> (node) && !DECL_EXTERNAL (node->decl))
- node->in_other_partition = true;
+ {
+ DECL_EXTERNAL (node->decl) = true;
+ node->in_other_partition = true;
+ }
}
/* Check the boundary and expands it if necessary, including more nodes or
diff --git a/gcc/symtab.c b/gcc/symtab.c
index a5fba15..f56dd69 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -2493,3 +2493,37 @@ symtab_node::output_to_lto_symbol_table_p (void)
}
return true;
}
+
+DEBUG_FUNCTION symtab_node *
+symtab_node::find_by_order (int order)
+{
+ symtab_node *node;
+ FOR_EACH_SYMBOL (node)
+ if (node->order == order)
+ return node;
+
+ return NULL;
+}
+
+DEBUG_FUNCTION symtab_node *
+symtab_node::find_by_name (const char * name)
+{
+ symtab_node *node;
+ FOR_EACH_SYMBOL (node)
+ if (!strcmp (node->name (), name))
+ return node;
+
+ return NULL;
+}
+
+DEBUG_FUNCTION symtab_node *
+symtab_node::find_by_asm_name (const char *asm_name)
+{
+ symtab_node *node;
+ FOR_EACH_SYMBOL (node)
+ if (!strcmp (node->asm_name (), asm_name))
+ return node;
+
+ return NULL;
+
+}