aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2003-12-06 15:41:24 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2003-12-06 15:41:24 +0000
commit9be6533af6dcbffc1f2ae91d7d108cf5171b75d4 (patch)
tree2f7d4aaae8d876c7e1cfbc3505e9a5ea875eadfc
parente25c906af1f1022337e330728f3d46682216dbbc (diff)
downloadgcc-9be6533af6dcbffc1f2ae91d7d108cf5171b75d4.zip
gcc-9be6533af6dcbffc1f2ae91d7d108cf5171b75d4.tar.gz
gcc-9be6533af6dcbffc1f2ae91d7d108cf5171b75d4.tar.bz2
varasm.c (incorporeal_function_p): New.
* varasm.c (incorporeal_function_p): New. (assemble_external): Use it as a filter. * config/mips/mips.c (mips_output_external): Don't check for builtin functions here. From-SVN: r74368
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/mips/mips.c4
-rw-r--r--gcc/varasm.c29
3 files changed, 36 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 89d0735..1854cce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2003-12-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * varasm.c (incorporeal_function_p): New.
+ (assemble_external): Use it as a filter.
+ * config/mips/mips.c (mips_output_external): Don't check for builtin
+ functions here.
+
2003-12-06 Richard Earnshaw <reanrsha@arm.com>
* arm.md (IOR (COMPARISON) (AND)): New define_splits.
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 2ed6ab1..3a05443 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -5574,9 +5574,7 @@ mips_output_external (FILE *file ATTRIBUTE_UNUSED, tree decl, const char *name)
extern_head = p;
}
- if (TARGET_IRIX && mips_abi == ABI_32
- && TREE_CODE (decl) == FUNCTION_DECL
- && !DECL_BUILT_IN (decl))
+ if (TARGET_IRIX && mips_abi == ABI_32 && TREE_CODE (decl) == FUNCTION_DECL)
{
p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list));
p->next = extern_head;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 7f5ee56..5257810 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -137,6 +137,9 @@ static HOST_WIDE_INT 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 *);
@@ -1599,6 +1602,29 @@ contains_pointers_p (tree type)
}
}
+#ifdef ASM_OUTPUT_EXTERNAL
+/* 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
+incorporeal_function_p (tree decl)
+{
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
+ {
+ const char *name;
+
+ if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (decl) == BUILT_IN_ALLOCA)
+ return true;
+
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ if (strncmp (name, "__builtin_", strlen ("__builtin_")) == 0)
+ return true;
+ }
+ return false;
+}
+#endif
+
/* Output something to declare an external symbol to the assembler.
(Most assemblers don't need this, so we normally output nothing.)
Do nothing if DECL is not external. */
@@ -1619,7 +1645,8 @@ assemble_external (tree decl ATTRIBUTE_UNUSED)
rtx rtl = DECL_RTL (decl);
if (GET_CODE (rtl) == MEM && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF
- && ! SYMBOL_REF_USED (XEXP (rtl, 0)))
+ && !SYMBOL_REF_USED (XEXP (rtl, 0))
+ && !incorporeal_function_p (decl))
{
/* Some systems do require some output. */
SYMBOL_REF_USED (XEXP (rtl, 0)) = 1;