+2009-07-13 Jason Merrill <jason@redhat.com>
+
+ * builtins.c (can_trust_pointer_alignment): New fn.
+ (get_pointer_alignment): Factor it out from here.
+ * tree.h: Declare it.
+
2009-07-14 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/predicates.md (offsettable_mem_operand): Test
return MIN (align, max_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.
But don't return more than MAX_ALIGN no matter what.
The alignment returned is, by default, the alignment of the thing that
{
unsigned int align, inner;
- /* We rely on TER to compute accurate alignment information. */
- if (!(optimize && flag_tree_ter))
+ if (!can_trust_pointer_alignment ())
return 0;
if (!POINTER_TYPE_P (TREE_TYPE (exp)))
+2009-07-13 Jason Merrill <jason@redhat.com>
+
+ * call.c (build_over_call): Use can_trust_pointer_alignment.
+
2009-07-14 Dodji Seketeli <dodji@redhat.com>
PR debug/40705
arg1 = arg;
arg0 = cp_build_unary_op (ADDR_EXPR, to, 0, complain);
- if (!(optimize && flag_tree_ter))
+ if (!can_trust_pointer_alignment ())
{
- /* When TER is off get_pointer_alignment returns 0, so a call
+ /* 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. When TER is on it is
+ 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);
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 int get_pointer_alignment (tree, unsigned int);
extern bool is_builtin_name (const char*);
extern int get_object_alignment (tree, unsigned int, unsigned int);