summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-10 15:08:14 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-10 15:08:14 +0000
commitc43db984e8c67dffe136cd279da9c03170d2d765 (patch)
treeb9a01e3bd62e45f7afb9af8a6261043a32f33a07
parent7dfa155b0b11c07d4bebe38f9d27e2ec9f2646ae (diff)
downloadgcc-c43db984e8c67dffe136cd279da9c03170d2d765.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177625 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/builtins.c10
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/call.c18
-rw-r--r--gcc/tree.h1
5 files changed, 10 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7d5b49224b3..a727916693f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-10 Richard Guenther <rguenther@suse.de>
+
+ * tree.h (can_trust_pointer_alignment): Remove.
+ * builtins.c (can_trust_pointer_alignment): Remove.
+
2011-08-10 Artjoms Sinkarovs <artyom.shinakroff@gmail.com>
* c-typeck.c (scalar_to_vector): New function. Try scalar to
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 723e07f42a8..6c16821c348 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -453,16 +453,6 @@ get_object_alignment (tree exp)
return align;
}
-/* Returns true iff we can trust that alignment information has been
- calculated properly. */
-
-bool
-can_trust_pointer_alignment (void)
-{
- /* We rely on TER to compute accurate alignment information. */
- return (optimize && flag_tree_ter);
-}
-
/* Return the alignment in bits of EXP, a pointer valued expression.
The alignment returned is, by default, the alignment of the thing that
EXP points to. If it is not a POINTER_TYPE, 0 is returned.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 65a270147a7..be846ce52a3 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 b0133e21709..4494eccfa39 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;
}
diff --git a/gcc/tree.h b/gcc/tree.h
index 2fa5999c615..c8d292a3d4f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5358,7 +5358,6 @@ extern tree build_va_arg_indirect_ref (tree);
extern tree build_string_literal (int, const char *);
extern bool validate_arglist (const_tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
-extern bool can_trust_pointer_alignment (void);
extern bool is_builtin_name (const char *);
extern bool is_builtin_fn (tree);
extern unsigned int get_object_alignment_1 (tree, unsigned HOST_WIDE_INT *);