aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-08-12 08:55:05 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-08-12 08:55:05 +0000
commit6aeb8c9919b5b816a32fcf8400b85d9b91752059 (patch)
tree88501efa7f691a8047eed2a88aa3396008ce5ecd /gcc
parentf895fc2a0d23a15668d829cec8c9bfaa98ae5615 (diff)
downloadgcc-6aeb8c9919b5b816a32fcf8400b85d9b91752059.zip
gcc-6aeb8c9919b5b816a32fcf8400b85d9b91752059.tar.gz
gcc-6aeb8c9919b5b816a32fcf8400b85d9b91752059.tar.bz2
call.c (build_over_call): Instead of memcpy use an assignment of two MEM_REFs.
2011-08-12 Richard Guenther <rguenther@suse.de> * call.c (build_over_call): Instead of memcpy use an assignment of two MEM_REFs. From-SVN: r177691
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/call.c21
2 files changed, 17 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f5989f4..47d636e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-12 Richard Guenther <rguenther@suse.de>
+
+ * call.c (build_over_call): Instead of memcpy use an
+ assignment of two MEM_REFs.
+
2011-08-11 Romain Geissler <romain.geissler@gmail.com>
Brian Hackett <bhackett1024@gmail.com>
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 4494ecc..a3b0f8a 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6766,19 +6766,22 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
}
else
{
- /* We must only copy the non-tail padding parts.
- Use __builtin_memcpy for the bitwise copy. */
- tree arg0, arg1, arg2, t;
+ /* We must only copy the non-tail padding parts. */
+ tree arg0, arg2, t;
+ tree array_type, alias_set;
arg2 = TYPE_SIZE_UNIT (as_base);
- arg1 = arg;
arg0 = cp_build_addr_expr (to, complain);
- t = implicit_built_in_decls[BUILT_IN_MEMCPY];
- t = build_call_n (t, 3, arg0, arg1, arg2);
-
- t = convert (TREE_TYPE (arg0), t);
- val = cp_build_indirect_ref (t, RO_NULL, complain);
+ array_type = build_array_type (char_type_node,
+ build_index_type
+ (size_binop (MINUS_EXPR,
+ arg2, size_int (1))));
+ alias_set = build_int_cst (build_pointer_type (type), 0);
+ t = build2 (MODIFY_EXPR, void_type_node,
+ build2 (MEM_REF, array_type, arg0, alias_set),
+ build2 (MEM_REF, array_type, arg, alias_set));
+ val = build2 (COMPOUND_EXPR, TREE_TYPE (to), t, to);
TREE_NO_WARNING (val) = 1;
}