summaryrefslogtreecommitdiffstats
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-28 19:58:52 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-28 19:58:52 +0000
commitd459e0d8b669bbf8bb3b9446daeba0a82eb1c727 (patch)
tree331faf76cb1d514411e5707a36e1f12f9c9dcbdb /gcc/expr.c
parent0f0ea0b3525ba845f21423eb88d4679b48fb357a (diff)
downloadppe42-gcc-d459e0d8b669bbf8bb3b9446daeba0a82eb1c727.tar.gz
ppe42-gcc-d459e0d8b669bbf8bb3b9446daeba0a82eb1c727.zip
* c-decl.c (finish_decl): When prototype with asmspec is found
for built-in, adjust built_in_decls as well as expr.c decls. * expr.c (init_block_move_fn, init_block_clear_fn): New functions. (emit_block_move_libcall_fn, clear_storage_libcall_fn): Use it. * expr.c (init_block_move_fn, init_block_clear_fn): New prototypes. * gcc.c-torture/execute/string-opt-asm-1.c: New test. * gcc.c-torture/execute/string-opt-asm-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66181 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c70
1 files changed, 50 insertions, 20 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0d6118778b8..73f9baf6eb5 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1994,15 +1994,14 @@ emit_block_move_via_libcall (dst, src, size)
static GTY(()) tree block_move_fn;
-static tree
-emit_block_move_libcall_fn (for_call)
- int for_call;
+void
+init_block_move_fn (asmspec)
+ const char *asmspec;
{
- static bool emitted_extern;
- tree fn = block_move_fn, args;
-
- if (!fn)
+ if (!block_move_fn)
{
+ tree fn, args;
+
if (TARGET_MEM_FUNCTIONS)
{
fn = get_identifier ("memcpy");
@@ -2027,14 +2026,30 @@ emit_block_move_libcall_fn (for_call)
block_move_fn = fn;
}
+ if (asmspec)
+ {
+ SET_DECL_RTL (block_move_fn, NULL_RTX);
+ SET_DECL_ASSEMBLER_NAME (block_move_fn, get_identifier (asmspec));
+ }
+}
+
+static tree
+emit_block_move_libcall_fn (for_call)
+ int for_call;
+{
+ static bool emitted_extern;
+
+ if (!block_move_fn)
+ init_block_move_fn (NULL);
+
if (for_call && !emitted_extern)
{
emitted_extern = true;
- make_decl_rtl (fn, NULL);
- assemble_external (fn);
+ make_decl_rtl (block_move_fn, NULL);
+ assemble_external (block_move_fn);
}
- return fn;
+ return block_move_fn;
}
/* A subroutine of emit_block_move. Copy the data via an explicit
@@ -3089,15 +3104,14 @@ clear_storage_via_libcall (object, size)
static GTY(()) tree block_clear_fn;
-static tree
-clear_storage_libcall_fn (for_call)
- int for_call;
+void
+init_block_clear_fn (asmspec)
+ const char *asmspec;
{
- static bool emitted_extern;
- tree fn = block_clear_fn, args;
-
- if (!fn)
+ if (!block_clear_fn)
{
+ tree fn, args;
+
if (TARGET_MEM_FUNCTIONS)
{
fn = get_identifier ("memset");
@@ -3121,14 +3135,30 @@ clear_storage_libcall_fn (for_call)
block_clear_fn = fn;
}
+ if (asmspec)
+ {
+ SET_DECL_RTL (block_clear_fn, NULL_RTX);
+ SET_DECL_ASSEMBLER_NAME (block_clear_fn, get_identifier (asmspec));
+ }
+}
+
+static tree
+clear_storage_libcall_fn (for_call)
+ int for_call;
+{
+ static bool emitted_extern;
+
+ if (!block_clear_fn)
+ init_block_clear_fn (NULL);
+
if (for_call && !emitted_extern)
{
emitted_extern = true;
- make_decl_rtl (fn, NULL);
- assemble_external (fn);
+ make_decl_rtl (block_clear_fn, NULL);
+ assemble_external (block_clear_fn);
}
- return fn;
+ return block_clear_fn;
}
/* Generate code to copy Y into X.
OpenPOWER on IntegriCloud