diff options
author | Richard Guenther <rguenther@suse.de> | 2011-08-10 15:08:14 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-08-10 15:08:14 +0000 |
commit | b126811e7dc390fe0dec552e6e7911b0dfbe2ecc (patch) | |
tree | b9a01e3bd62e45f7afb9af8a6261043a32f33a07 /gcc/cp | |
parent | 0e3a99ae913c732f015b0dcfecb85d3236cc142f (diff) | |
download | gcc-b126811e7dc390fe0dec552e6e7911b0dfbe2ecc.zip gcc-b126811e7dc390fe0dec552e6e7911b0dfbe2ecc.tar.gz gcc-b126811e7dc390fe0dec552e6e7911b0dfbe2ecc.tar.bz2 |
tree.h (can_trust_pointer_alignment): Remove.
2011-08-10 Richard Guenther <rguenther@suse.de>
* tree.h (can_trust_pointer_alignment): Remove.
* builtins.c (can_trust_pointer_alignment): Remove.
cp/
* call.c (build_over_call): Call memcpy unconditionally.
From-SVN: r177625
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/call.c | 18 |
2 files changed, 5 insertions, 17 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 65a2701..be846ce 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2011-08-10 Richard Guenther <rguenther@suse.de> + + * call.c (build_over_call): Call memcpy unconditionally. + 2011-08-08 Jason Merrill <jason@redhat.com> PR c++/50020 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index b0133e2..4494ecc 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -6767,33 +6767,17 @@ 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. - FIXME fix 22488 so we can go back to using MODIFY_EXPR - instead of an explicit call to memcpy. */ - + Use __builtin_memcpy for the bitwise copy. */ tree arg0, arg1, arg2, t; - tree test = NULL_TREE; arg2 = TYPE_SIZE_UNIT (as_base); arg1 = arg; arg0 = cp_build_addr_expr (to, complain); - if (!can_trust_pointer_alignment ()) - { - /* If we can't be sure about pointer alignment, a call - to __builtin_memcpy is expanded as a call to memcpy, which - is invalid with identical args. Otherwise it is - expanded as a block move, which should be safe. */ - arg0 = save_expr (arg0); - arg1 = save_expr (arg1); - test = build2 (EQ_EXPR, boolean_type_node, arg0, arg1); - } t = implicit_built_in_decls[BUILT_IN_MEMCPY]; t = build_call_n (t, 3, arg0, arg1, arg2); t = convert (TREE_TYPE (arg0), t); - if (test) - t = build3 (COND_EXPR, TREE_TYPE (t), test, arg0, t); val = cp_build_indirect_ref (t, RO_NULL, complain); TREE_NO_WARNING (val) = 1; } |