Commit 0eb77834 by Richard Guenther Committed by Richard Biener

tree.h (get_pointer_alignment): Remove max-align argument.

2011-08-10  Richard Guenther  <rguenther@suse.de>

	* tree.h (get_pointer_alignment): Remove max-align argument.
	(get_object_alignment): Likewise.
	* builtins.c (get_object_alignment_1): Adjust.
	(get_object_alignment): Remove max-align argument.
	(get_pointer_alignment): Likewise.
	(expand_builtin_strlen): Adjust.
	(expand_builtin_memcpy): Likewise.
	(expand_builtin_mempcpy_args): Likewise.
	(expand_builtin_strncpy): Likewise.
	(expand_builtin_memset_args): Likewise.
	(expand_builtin_memcmp): Likewise.
	(expand_builtin_strcmp): Likewise.
	(expand_builtin_strncmp): Likewise.
	(get_builtin_sync_mem): Likewise.
	(fold_builtin_memset): Likewise.
	(fold_builtin_memory_op): Likewise.
	(expand_builtin_memory_chk): Likewise.
	* emit-rtl.c (get_mem_align_offset): Likewise.
	(set_mem_attributes_minus_bitpos): Likewise.
	* expr.c (expand_assignment): Likewise.
	(expand_expr_real_1): Likewise.
	* tree-sra.c (tree_non_mode_aligned_mem_p): Likewise.
	* tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
	* tree-ssa-loop-ivopts.c (may_be_unaligned_p): Likewise.
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise.
	* value-prof.c (gimple_stringops_transform): Likewise.

From-SVN: r177620
parent 1c7836f0
2011-08-10 Richard Guenther <rguenther@suse.de>
* tree.h (get_pointer_alignment): Remove max-align argument.
(get_object_alignment): Likewise.
* builtins.c (get_object_alignment_1): Adjust.
(get_object_alignment): Remove max-align argument.
(get_pointer_alignment): Likewise.
(expand_builtin_strlen): Adjust.
(expand_builtin_memcpy): Likewise.
(expand_builtin_mempcpy_args): Likewise.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset_args): Likewise.
(expand_builtin_memcmp): Likewise.
(expand_builtin_strcmp): Likewise.
(expand_builtin_strncmp): Likewise.
(get_builtin_sync_mem): Likewise.
(fold_builtin_memset): Likewise.
(fold_builtin_memory_op): Likewise.
(expand_builtin_memory_chk): Likewise.
* emit-rtl.c (get_mem_align_offset): Likewise.
(set_mem_attributes_minus_bitpos): Likewise.
* expr.c (expand_assignment): Likewise.
(expand_expr_real_1): Likewise.
* tree-sra.c (tree_non_mode_aligned_mem_p): Likewise.
* tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
* tree-ssa-loop-ivopts.c (may_be_unaligned_p): Likewise.
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise.
* value-prof.c (gimple_stringops_transform): Likewise.
2011-08-10 Paulo J. Matos <paulo.matos@csr.com> 2011-08-10 Paulo J. Matos <paulo.matos@csr.com>
* doc/tm.texi.in (CLASS_MAX_NREGS): Fix typo. * doc/tm.texi.in (CLASS_MAX_NREGS): Fix typo.
......
...@@ -341,7 +341,7 @@ get_object_alignment_1 (tree exp, unsigned HOST_WIDE_INT *bitposp) ...@@ -341,7 +341,7 @@ get_object_alignment_1 (tree exp, unsigned HOST_WIDE_INT *bitposp)
align = MAX (pi->align * BITS_PER_UNIT, align); align = MAX (pi->align * BITS_PER_UNIT, align);
} }
else if (TREE_CODE (addr) == ADDR_EXPR) else if (TREE_CODE (addr) == ADDR_EXPR)
align = MAX (align, get_object_alignment (TREE_OPERAND (addr, 0), ~0U)); align = MAX (align, get_object_alignment (TREE_OPERAND (addr, 0)));
bitpos += mem_ref_offset (exp).low * BITS_PER_UNIT; bitpos += mem_ref_offset (exp).low * BITS_PER_UNIT;
} }
else if (TREE_CODE (exp) == TARGET_MEM_REF) else if (TREE_CODE (exp) == TARGET_MEM_REF)
...@@ -365,7 +365,7 @@ get_object_alignment_1 (tree exp, unsigned HOST_WIDE_INT *bitposp) ...@@ -365,7 +365,7 @@ get_object_alignment_1 (tree exp, unsigned HOST_WIDE_INT *bitposp)
align = MAX (pi->align * BITS_PER_UNIT, align); align = MAX (pi->align * BITS_PER_UNIT, align);
} }
else if (TREE_CODE (addr) == ADDR_EXPR) else if (TREE_CODE (addr) == ADDR_EXPR)
align = MAX (align, get_object_alignment (TREE_OPERAND (addr, 0), ~0U)); align = MAX (align, get_object_alignment (TREE_OPERAND (addr, 0)));
if (TMR_OFFSET (exp)) if (TMR_OFFSET (exp))
bitpos += TREE_INT_CST_LOW (TMR_OFFSET (exp)) * BITS_PER_UNIT; bitpos += TREE_INT_CST_LOW (TMR_OFFSET (exp)) * BITS_PER_UNIT;
if (TMR_INDEX (exp) && TMR_STEP (exp)) if (TMR_INDEX (exp) && TMR_STEP (exp))
...@@ -434,11 +434,10 @@ get_object_alignment_1 (tree exp, unsigned HOST_WIDE_INT *bitposp) ...@@ -434,11 +434,10 @@ get_object_alignment_1 (tree exp, unsigned HOST_WIDE_INT *bitposp)
return align; return align;
} }
/* Return the alignment in bits of EXP, an object. /* Return the alignment in bits of EXP, an object. */
Don't return more than MAX_ALIGN no matter what. */
unsigned int unsigned int
get_object_alignment (tree exp, unsigned int max_align) get_object_alignment (tree exp)
{ {
unsigned HOST_WIDE_INT bitpos = 0; unsigned HOST_WIDE_INT bitpos = 0;
unsigned int align; unsigned int align;
...@@ -451,7 +450,7 @@ get_object_alignment (tree exp, unsigned int max_align) ...@@ -451,7 +450,7 @@ get_object_alignment (tree exp, unsigned int max_align)
if (bitpos != 0) if (bitpos != 0)
align = (bitpos & -bitpos); align = (bitpos & -bitpos);
return MIN (align, max_align); return align;
} }
/* Returns true iff we can trust that alignment information has been /* Returns true iff we can trust that alignment information has been
...@@ -465,7 +464,6 @@ can_trust_pointer_alignment (void) ...@@ -465,7 +464,6 @@ can_trust_pointer_alignment (void)
} }
/* Return the alignment in bits of EXP, a pointer valued expression. /* 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 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. EXP points to. If it is not a POINTER_TYPE, 0 is returned.
...@@ -473,12 +471,12 @@ can_trust_pointer_alignment (void) ...@@ -473,12 +471,12 @@ can_trust_pointer_alignment (void)
expression is actually pointing at an object whose alignment is tighter. */ expression is actually pointing at an object whose alignment is tighter. */
unsigned int unsigned int
get_pointer_alignment (tree exp, unsigned int max_align) get_pointer_alignment (tree exp)
{ {
STRIP_NOPS (exp); STRIP_NOPS (exp);
if (TREE_CODE (exp) == ADDR_EXPR) if (TREE_CODE (exp) == ADDR_EXPR)
return get_object_alignment (TREE_OPERAND (exp, 0), max_align); return get_object_alignment (TREE_OPERAND (exp, 0));
else if (TREE_CODE (exp) == SSA_NAME else if (TREE_CODE (exp) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (exp))) && POINTER_TYPE_P (TREE_TYPE (exp)))
{ {
...@@ -490,7 +488,7 @@ get_pointer_alignment (tree exp, unsigned int max_align) ...@@ -490,7 +488,7 @@ get_pointer_alignment (tree exp, unsigned int max_align)
align = (pi->misalign & -pi->misalign); align = (pi->misalign & -pi->misalign);
else else
align = pi->align; align = pi->align;
return MIN (max_align, align * BITS_PER_UNIT); return align * BITS_PER_UNIT;
} }
return POINTER_TYPE_P (TREE_TYPE (exp)) ? BITS_PER_UNIT : 0; return POINTER_TYPE_P (TREE_TYPE (exp)) ? BITS_PER_UNIT : 0;
...@@ -2926,7 +2924,7 @@ expand_builtin_strlen (tree exp, rtx target, ...@@ -2926,7 +2924,7 @@ expand_builtin_strlen (tree exp, rtx target,
return expand_expr (len, target, target_mode, EXPAND_NORMAL); return expand_expr (len, target, target_mode, EXPAND_NORMAL);
} }
align = get_pointer_alignment (src, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; align = get_pointer_alignment (src) / BITS_PER_UNIT;
/* If SRC is not a pointer type, don't do this operation inline. */ /* If SRC is not a pointer type, don't do this operation inline. */
if (align == 0) if (align == 0)
...@@ -3026,9 +3024,8 @@ expand_builtin_memcpy (tree exp, rtx target) ...@@ -3026,9 +3024,8 @@ expand_builtin_memcpy (tree exp, rtx target)
tree src = CALL_EXPR_ARG (exp, 1); tree src = CALL_EXPR_ARG (exp, 1);
tree len = CALL_EXPR_ARG (exp, 2); tree len = CALL_EXPR_ARG (exp, 2);
const char *src_str; const char *src_str;
unsigned int src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT); unsigned int src_align = get_pointer_alignment (src);
unsigned int dest_align unsigned int dest_align = get_pointer_alignment (dest);
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
rtx dest_mem, src_mem, dest_addr, len_rtx; rtx dest_mem, src_mem, dest_addr, len_rtx;
HOST_WIDE_INT expected_size = -1; HOST_WIDE_INT expected_size = -1;
unsigned int expected_align = 0; unsigned int expected_align = 0;
...@@ -3135,9 +3132,8 @@ expand_builtin_mempcpy_args (tree dest, tree src, tree len, ...@@ -3135,9 +3132,8 @@ expand_builtin_mempcpy_args (tree dest, tree src, tree len,
else else
{ {
const char *src_str; const char *src_str;
unsigned int src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT); unsigned int src_align = get_pointer_alignment (src);
unsigned int dest_align unsigned int dest_align = get_pointer_alignment (dest);
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
rtx dest_mem, src_mem, len_rtx; rtx dest_mem, src_mem, len_rtx;
/* If either SRC or DEST is not a pointer type, don't do this /* If either SRC or DEST is not a pointer type, don't do this
...@@ -3390,8 +3386,7 @@ expand_builtin_strncpy (tree exp, rtx target) ...@@ -3390,8 +3386,7 @@ expand_builtin_strncpy (tree exp, rtx target)
use store_by_pieces, if it fails, punt. */ use store_by_pieces, if it fails, punt. */
if (tree_int_cst_lt (slen, len)) if (tree_int_cst_lt (slen, len))
{ {
unsigned int dest_align unsigned int dest_align = get_pointer_alignment (dest);
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
const char *p = c_getstr (src); const char *p = c_getstr (src);
rtx dest_mem; rtx dest_mem;
...@@ -3495,7 +3490,7 @@ expand_builtin_memset_args (tree dest, tree val, tree len, ...@@ -3495,7 +3490,7 @@ expand_builtin_memset_args (tree dest, tree val, tree len,
HOST_WIDE_INT expected_size = -1; HOST_WIDE_INT expected_size = -1;
unsigned int expected_align = 0; unsigned int expected_align = 0;
dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); dest_align = get_pointer_alignment (dest);
/* If DEST is not a pointer type, don't do this operation in-line. */ /* If DEST is not a pointer type, don't do this operation in-line. */
if (dest_align == 0) if (dest_align == 0)
...@@ -3657,10 +3652,8 @@ expand_builtin_memcmp (tree exp, ATTRIBUTE_UNUSED rtx target, ...@@ -3657,10 +3652,8 @@ expand_builtin_memcmp (tree exp, ATTRIBUTE_UNUSED rtx target,
tree arg2 = CALL_EXPR_ARG (exp, 1); tree arg2 = CALL_EXPR_ARG (exp, 1);
tree len = CALL_EXPR_ARG (exp, 2); tree len = CALL_EXPR_ARG (exp, 2);
unsigned int arg1_align unsigned int arg1_align = get_pointer_alignment (arg1) / BITS_PER_UNIT;
= get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; unsigned int arg2_align = get_pointer_alignment (arg2) / BITS_PER_UNIT;
unsigned int arg2_align
= get_pointer_alignment (arg2, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
enum machine_mode insn_mode; enum machine_mode insn_mode;
#ifdef HAVE_cmpmemsi #ifdef HAVE_cmpmemsi
...@@ -3759,10 +3752,8 @@ expand_builtin_strcmp (tree exp, ATTRIBUTE_UNUSED rtx target) ...@@ -3759,10 +3752,8 @@ expand_builtin_strcmp (tree exp, ATTRIBUTE_UNUSED rtx target)
tree arg1 = CALL_EXPR_ARG (exp, 0); tree arg1 = CALL_EXPR_ARG (exp, 0);
tree arg2 = CALL_EXPR_ARG (exp, 1); tree arg2 = CALL_EXPR_ARG (exp, 1);
unsigned int arg1_align unsigned int arg1_align = get_pointer_alignment (arg1) / BITS_PER_UNIT;
= get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; unsigned int arg2_align = get_pointer_alignment (arg2) / BITS_PER_UNIT;
unsigned int arg2_align
= get_pointer_alignment (arg2, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
/* If we don't have POINTER_TYPE, call the function. */ /* If we don't have POINTER_TYPE, call the function. */
if (arg1_align == 0 || arg2_align == 0) if (arg1_align == 0 || arg2_align == 0)
...@@ -3910,10 +3901,8 @@ expand_builtin_strncmp (tree exp, ATTRIBUTE_UNUSED rtx target, ...@@ -3910,10 +3901,8 @@ expand_builtin_strncmp (tree exp, ATTRIBUTE_UNUSED rtx target,
tree arg2 = CALL_EXPR_ARG (exp, 1); tree arg2 = CALL_EXPR_ARG (exp, 1);
tree arg3 = CALL_EXPR_ARG (exp, 2); tree arg3 = CALL_EXPR_ARG (exp, 2);
unsigned int arg1_align unsigned int arg1_align = get_pointer_alignment (arg1) / BITS_PER_UNIT;
= get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; unsigned int arg2_align = get_pointer_alignment (arg2) / BITS_PER_UNIT;
unsigned int arg2_align
= get_pointer_alignment (arg2, BIGGEST_ALIGNMENT) / BITS_PER_UNIT;
enum machine_mode insn_mode enum machine_mode insn_mode
= insn_data[(int) CODE_FOR_cmpstrnsi].operand[0].mode; = insn_data[(int) CODE_FOR_cmpstrnsi].operand[0].mode;
...@@ -5087,7 +5076,7 @@ get_builtin_sync_mem (tree loc, enum machine_mode mode) ...@@ -5087,7 +5076,7 @@ get_builtin_sync_mem (tree loc, enum machine_mode mode)
/* The alignment needs to be at least according to that of the mode. */ /* The alignment needs to be at least according to that of the mode. */
set_mem_align (mem, MAX (GET_MODE_ALIGNMENT (mode), set_mem_align (mem, MAX (GET_MODE_ALIGNMENT (mode),
get_pointer_alignment (loc, BIGGEST_ALIGNMENT))); get_pointer_alignment (loc)));
set_mem_alias_set (mem, ALIAS_SET_MEMORY_BARRIER); set_mem_alias_set (mem, ALIAS_SET_MEMORY_BARRIER);
MEM_VOLATILE_P (mem) = 1; MEM_VOLATILE_P (mem) = 1;
...@@ -7891,8 +7880,7 @@ fold_builtin_memset (location_t loc, tree dest, tree c, tree len, ...@@ -7891,8 +7880,7 @@ fold_builtin_memset (location_t loc, tree dest, tree c, tree len,
length = tree_low_cst (len, 1); length = tree_low_cst (len, 1);
if (GET_MODE_SIZE (TYPE_MODE (etype)) != length if (GET_MODE_SIZE (TYPE_MODE (etype)) != length
|| get_pointer_alignment (dest, BIGGEST_ALIGNMENT) / BITS_PER_UNIT || get_pointer_alignment (dest) / BITS_PER_UNIT < length)
< length)
return NULL_TREE; return NULL_TREE;
if (length > HOST_BITS_PER_WIDE_INT / BITS_PER_UNIT) if (length > HOST_BITS_PER_WIDE_INT / BITS_PER_UNIT)
...@@ -7982,8 +7970,8 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src, ...@@ -7982,8 +7970,8 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
if (endp == 3) if (endp == 3)
{ {
src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT); src_align = get_pointer_alignment (src);
dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); dest_align = get_pointer_alignment (dest);
/* Both DEST and SRC must be pointer types. /* Both DEST and SRC must be pointer types.
??? This is what old code did. Is the testing for pointer types ??? This is what old code did. Is the testing for pointer types
...@@ -8131,8 +8119,8 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src, ...@@ -8131,8 +8119,8 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
|| TREE_ADDRESSABLE (desttype)) || TREE_ADDRESSABLE (desttype))
return NULL_TREE; return NULL_TREE;
src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT); src_align = get_pointer_alignment (src);
dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); dest_align = get_pointer_alignment (dest);
if (dest_align < TYPE_ALIGN (desttype) if (dest_align < TYPE_ALIGN (desttype)
|| src_align < TYPE_ALIGN (srctype)) || src_align < TYPE_ALIGN (srctype))
return NULL_TREE; return NULL_TREE;
...@@ -11696,8 +11684,7 @@ expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode, ...@@ -11696,8 +11684,7 @@ expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode,
return NULL_RTX; return NULL_RTX;
else else
{ {
unsigned int dest_align unsigned int dest_align = get_pointer_alignment (dest);
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
/* If DEST is not a pointer type, call the normal function. */ /* If DEST is not a pointer type, call the normal function. */
if (dest_align == 0) if (dest_align == 0)
...@@ -11722,8 +11709,7 @@ expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode, ...@@ -11722,8 +11709,7 @@ expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode,
/* __memmove_chk special case. */ /* __memmove_chk special case. */
if (fcode == BUILT_IN_MEMMOVE_CHK) if (fcode == BUILT_IN_MEMMOVE_CHK)
{ {
unsigned int src_align unsigned int src_align = get_pointer_alignment (src);
= get_pointer_alignment (src, BIGGEST_ALIGNMENT);
if (src_align == 0) if (src_align == 0)
return NULL_RTX; return NULL_RTX;
......
...@@ -1466,7 +1466,7 @@ get_mem_align_offset (rtx mem, unsigned int align) ...@@ -1466,7 +1466,7 @@ get_mem_align_offset (rtx mem, unsigned int align)
/* This function can't use /* This function can't use
if (!MEM_EXPR (mem) || !MEM_OFFSET_KNOWN_P (mem) if (!MEM_EXPR (mem) || !MEM_OFFSET_KNOWN_P (mem)
|| (MAX (MEM_ALIGN (mem), || (MAX (MEM_ALIGN (mem),
get_object_alignment (MEM_EXPR (mem), align)) MAX (align, get_object_alignment (MEM_EXPR (mem))))
< align)) < align))
return -1; return -1;
else else
...@@ -1826,9 +1826,9 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, ...@@ -1826,9 +1826,9 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
apply_bitpos = bitpos; apply_bitpos = bitpos;
} }
if (!align_computed && !INDIRECT_REF_P (t)) if (!align_computed)
{ {
unsigned int obj_align = get_object_alignment (t, BIGGEST_ALIGNMENT); unsigned int obj_align = get_object_alignment (t);
attrs.align = MAX (attrs.align, obj_align); attrs.align = MAX (attrs.align, obj_align);
} }
} }
......
...@@ -4440,8 +4440,7 @@ expand_assignment (tree to, tree from, bool nontemporal) ...@@ -4440,8 +4440,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
if ((TREE_CODE (to) == MEM_REF if ((TREE_CODE (to) == MEM_REF
|| TREE_CODE (to) == TARGET_MEM_REF) || TREE_CODE (to) == TARGET_MEM_REF)
&& mode != BLKmode && mode != BLKmode
&& ((align = MAX (TYPE_ALIGN (TREE_TYPE (to)), && ((align = MAX (TYPE_ALIGN (TREE_TYPE (to)), get_object_alignment (to)))
get_object_alignment (to, BIGGEST_ALIGNMENT)))
< (signed) GET_MODE_ALIGNMENT (mode)) < (signed) GET_MODE_ALIGNMENT (mode))
&& ((icode = optab_handler (movmisalign_optab, mode)) && ((icode = optab_handler (movmisalign_optab, mode))
!= CODE_FOR_nothing)) != CODE_FOR_nothing))
...@@ -9046,8 +9045,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9046,8 +9045,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
temp = gen_rtx_MEM (mode, op0); temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, exp, 0); set_mem_attributes (temp, exp, 0);
set_mem_addr_space (temp, as); set_mem_addr_space (temp, as);
align = MAX (TYPE_ALIGN (TREE_TYPE (exp)), align = MAX (TYPE_ALIGN (TREE_TYPE (exp)), get_object_alignment (exp));
get_object_alignment (exp, BIGGEST_ALIGNMENT));
if (mode != BLKmode if (mode != BLKmode
&& (unsigned) align < GET_MODE_ALIGNMENT (mode) && (unsigned) align < GET_MODE_ALIGNMENT (mode)
/* If the target does not have special handling for unaligned /* If the target does not have special handling for unaligned
...@@ -9127,8 +9125,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9127,8 +9125,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
gimple_assign_rhs1 (def_stmt), mask); gimple_assign_rhs1 (def_stmt), mask);
TREE_OPERAND (exp, 0) = base; TREE_OPERAND (exp, 0) = base;
} }
align = MAX (TYPE_ALIGN (TREE_TYPE (exp)), align = MAX (TYPE_ALIGN (TREE_TYPE (exp)), get_object_alignment (exp));
get_object_alignment (exp, BIGGEST_ALIGNMENT));
op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_SUM); op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_SUM);
op0 = memory_address_addr_space (address_mode, op0, as); op0 = memory_address_addr_space (address_mode, op0, as);
if (!integer_zerop (TREE_OPERAND (exp, 1))) if (!integer_zerop (TREE_OPERAND (exp, 1)))
......
...@@ -1085,7 +1085,7 @@ tree_non_mode_aligned_mem_p (tree exp) ...@@ -1085,7 +1085,7 @@ tree_non_mode_aligned_mem_p (tree exp)
|| !STRICT_ALIGNMENT) || !STRICT_ALIGNMENT)
return false; return false;
align = get_object_alignment (exp, BIGGEST_ALIGNMENT); align = get_object_alignment (exp);
if (GET_MODE_ALIGNMENT (mode) > align) if (GET_MODE_ALIGNMENT (mode) > align)
return true; return true;
......
...@@ -1509,7 +1509,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2) ...@@ -1509,7 +1509,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
|| use_stmt != stmt2)) || use_stmt != stmt2))
break; break;
ptr1_align = get_pointer_alignment (ptr1, BIGGEST_ALIGNMENT); ptr1_align = get_pointer_alignment (ptr1);
/* Construct the new source string literal. */ /* Construct the new source string literal. */
src_buf = XALLOCAVEC (char, src_len + 1); src_buf = XALLOCAVEC (char, src_len + 1);
if (callee1) if (callee1)
......
...@@ -1635,7 +1635,7 @@ may_be_unaligned_p (tree ref, tree step) ...@@ -1635,7 +1635,7 @@ may_be_unaligned_p (tree ref, tree step)
base = get_inner_reference (ref, &bitsize, &bitpos, &toffset, &mode, base = get_inner_reference (ref, &bitsize, &bitpos, &toffset, &mode,
&unsignedp, &volatilep, true); &unsignedp, &volatilep, true);
base_type = TREE_TYPE (base); base_type = TREE_TYPE (base);
base_align = get_object_alignment (base, BIGGEST_ALIGNMENT); base_align = get_object_alignment (base);
base_align = MAX (base_align, TYPE_ALIGN (base_type)); base_align = MAX (base_align, TYPE_ALIGN (base_type));
if (mode != BLKmode) if (mode != BLKmode)
......
...@@ -860,8 +860,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr) ...@@ -860,8 +860,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
&& tree_int_cst_compare (ssize_int (TYPE_ALIGN_UNIT (TREE_TYPE ( && tree_int_cst_compare (ssize_int (TYPE_ALIGN_UNIT (TREE_TYPE (
TREE_TYPE (base_addr)))), TREE_TYPE (base_addr)))),
alignment) >= 0) alignment) >= 0)
|| (get_pointer_alignment (base_addr, TYPE_ALIGN (vectype)) || (get_pointer_alignment (base_addr) >= TYPE_ALIGN (vectype)))
>= TYPE_ALIGN (vectype)))
base_aligned = true; base_aligned = true;
else else
base_aligned = false; base_aligned = false;
......
...@@ -5359,11 +5359,11 @@ extern tree build_string_literal (int, const char *); ...@@ -5359,11 +5359,11 @@ extern tree build_string_literal (int, const char *);
extern bool validate_arglist (const_tree, ...); extern bool validate_arglist (const_tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode); extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
extern bool can_trust_pointer_alignment (void); extern bool can_trust_pointer_alignment (void);
extern unsigned int get_pointer_alignment (tree, unsigned int);
extern bool is_builtin_name (const char *); extern bool is_builtin_name (const char *);
extern bool is_builtin_fn (tree); extern bool is_builtin_fn (tree);
extern unsigned int get_object_alignment_1 (tree, unsigned HOST_WIDE_INT *); extern unsigned int get_object_alignment_1 (tree, unsigned HOST_WIDE_INT *);
extern unsigned int get_object_alignment (tree, unsigned int); extern unsigned int get_object_alignment (tree);
extern unsigned int get_pointer_alignment (tree);
extern tree fold_call_stmt (gimple, bool); extern tree fold_call_stmt (gimple, bool);
extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function); extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
extern tree make_range (tree, int *, tree *, tree *, bool *); extern tree make_range (tree, int *, tree *, tree *, bool *);
......
...@@ -1528,13 +1528,13 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi) ...@@ -1528,13 +1528,13 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi)
else else
prob = 0; prob = 0;
dest = gimple_call_arg (stmt, 0); dest = gimple_call_arg (stmt, 0);
dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); dest_align = get_pointer_alignment (dest);
switch (fcode) switch (fcode)
{ {
case BUILT_IN_MEMCPY: case BUILT_IN_MEMCPY:
case BUILT_IN_MEMPCPY: case BUILT_IN_MEMPCPY:
src = gimple_call_arg (stmt, 1); src = gimple_call_arg (stmt, 1);
src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT); src_align = get_pointer_alignment (src);
if (!can_move_by_pieces (val, MIN (dest_align, src_align))) if (!can_move_by_pieces (val, MIN (dest_align, src_align)))
return false; return false;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment