+2004-12-20 Matt Austern <austern@apple.com>
+
+ PR c++/19044
+ * c-common.c (set_builtin_user_assembler_name): New.
+ * c-common.h (set_builtin_user_assembler_name): Declare.
+ * c-decl.c (finish_decl): Use set_builtin_user_assembler_name
+
2004-12-20 Diego Novillo <dnovillo@redhat.com>
PR tree-optimization/19080
main_identifier_node = get_identifier ("main");
}
+/* Look up the function in built_in_decls that corresponds to DECL
+ and set ASMSPEC as its user assembler name. DECL must be a
+ function decl that declares a builtin. */
+
+void
+set_builtin_user_assembler_name (tree decl, const char *asmspec)
+{
+ tree builtin;
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && asmspec != 0);
+
+ builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
+ set_user_assembler_name (builtin, asmspec);
+ if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY)
+ init_block_move_fn (asmspec);
+ else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET)
+ init_block_clear_fn (asmspec);
+}
+
tree
build_va_arg (tree expr, tree type)
{
frontends. */
extern void c_common_nodes_and_builtins (void);
+extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
+
extern void disable_builtin_function (const char *);
extern tree build_va_arg (tree, tree);
if (TREE_CODE (decl) == FUNCTION_DECL && asmspec)
{
if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
- {
- tree builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
- set_user_assembler_name (builtin, asmspec);
- if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY)
- init_block_move_fn (asmspec);
- else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET)
- init_block_clear_fn (asmspec);
- }
+ set_builtin_user_assembler_name (decl, asmspec);
set_user_assembler_name (decl, asmspec);
}
+2004-12-20 Matt Austern <austern@apple.com>
+
+ PR c++/19044
+ * decl.c (make_rtl_for_nonlocal_decl): Use set_builtin_user_assembler_name
+
2004-12-19 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (note_decl_for_pch): New function.
DECL_HARD_REGISTER (decl) = 1;
}
else
- set_user_assembler_name (decl, asmspec);
+ {
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
+ set_builtin_user_assembler_name (decl, asmspec);
+ set_user_assembler_name (decl, asmspec);
+ }
}
/* Handle non-variables up front. */
+2004-12-20 Matt Austern <austern@apple.com>
+
+ PR c++/19044
+ * g++.dg/ext/builtin6.C: New
+
2004-12-20 Diego Novillo <dnovillo@redhat.com>
PR tree-optimization/19080
--- /dev/null
+// PR c++/19044
+// Verify that alternate asm name for builtin named "foo" also gets
+// applied to its sibling "__builtin_foo".
+
+// { dg-do compile }
+// { dg-final { scan-assembler "fancy_sin" } }
+
+extern "C" double sin(double) __asm("_fancy_sin");
+
+double foo(double x) { return __builtin_sin(x); }
+