This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto][patch] Really fix builtins this time
- From: Rafael Espindola <espindola at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 31 Dec 2008 14:43:54 +0000
- Subject: [lto][patch] Really fix builtins this time
The problem that some builtins (nextafter for example) should be
present is the symbol table. Others (like __builtin_frame_address)
should not. This patch fixes the problem by using the same function
that assemble_external_real uses to select what should be in the
symbol table.
2008-12-31 Rafael Avila de Espindola <espindola@google.com>
* lto-section-out.c (write_symbol_vec): Use incorporeal_function_p.
* tree.h (incorporeal_function_p): New.
* varasm.c (incorporeal_function_p): Not static anymore.
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-section-out.c b/gcc/lto-section-out.c
index 3a226b3..83fba02 100644
--- a/gcc/lto-section-out.c
+++ b/gcc/lto-section-out.c
@@ -1078,7 +1078,7 @@ write_symbol_vec (htab_t hash, struct lto_output_stream *stream,
if (!TREE_PUBLIC (t))
continue;
- if (TREE_CODE (t) == FUNCTION_DECL && DECL_BUILT_IN (t))
+ if (incorporeal_function_p (t))
continue;
gcc_assert (!DECL_ABSTRACT (t));
diff --git a/gcc/tree.h b/gcc/tree.h
index fe2df95..fc64a67 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5093,6 +5093,7 @@ extern void mark_decl_referenced (tree);
extern void notice_global_symbol (tree);
extern void set_user_assembler_name (tree, const char *);
extern void process_pending_assemble_externals (void);
+extern bool incorporeal_function_p (tree);
extern void finish_aliases_1 (void);
extern void finish_aliases_2 (void);
extern tree emutls_decl (tree);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index ff0f536..0d4d89e 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -103,9 +103,6 @@ static alias_set_type const_alias_set;
static const char *strip_reg_name (const char *);
static int contains_pointers_p (tree);
-#ifdef ASM_OUTPUT_EXTERNAL
-static bool incorporeal_function_p (tree);
-#endif
static void decode_addr_const (tree, struct addr_const *);
static hashval_t const_desc_hash (const void *);
static int const_desc_eq (const void *, const void *);
@@ -2248,7 +2245,7 @@ static GTY(()) tree pending_assemble_externals;
/* True if DECL is a function decl for which no out-of-line copy exists.
It is assumed that DECL's assembler name has been set. */
-static bool
+bool
incorporeal_function_p (tree decl)
{
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))