Commit 4ceae7e9 by Richard Biener Committed by Richard Biener

re PR testsuite/63175 (FAIL: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c…

re PR testsuite/63175 (FAIL: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c scan-tree-dump-times slp2" basic block vectorized using SLP" 1)

2015-02-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/63175
	* builtins.c (get_object_alignment_2): Make sure to re-apply
	the ANDed mask after recursing to its operand gets us a new
	misalignment bit position.

From-SVN: r221043
parent d083ae5f
2015-02-27 Richard Biener <rguenther@suse.de>
PR middle-end/63175
* builtins.c (get_object_alignment_2): Make sure to re-apply
the ANDed mask after recursing to its operand gets us a new
misalignment bit position.
2015-02-26 Jan Hubicka <hubicka@ucw.cz> 2015-02-26 Jan Hubicka <hubicka@ucw.cz>
Martin Liska <mliska@suse.cz> Martin Liska <mliska@suse.cz>
......
...@@ -359,13 +359,15 @@ get_object_alignment_2 (tree exp, unsigned int *alignp, ...@@ -359,13 +359,15 @@ get_object_alignment_2 (tree exp, unsigned int *alignp,
tree addr = TREE_OPERAND (exp, 0); tree addr = TREE_OPERAND (exp, 0);
unsigned ptr_align; unsigned ptr_align;
unsigned HOST_WIDE_INT ptr_bitpos; unsigned HOST_WIDE_INT ptr_bitpos;
unsigned HOST_WIDE_INT ptr_bitmask = ~0;
/* If the address is explicitely aligned, handle that. */
if (TREE_CODE (addr) == BIT_AND_EXPR if (TREE_CODE (addr) == BIT_AND_EXPR
&& TREE_CODE (TREE_OPERAND (addr, 1)) == INTEGER_CST) && TREE_CODE (TREE_OPERAND (addr, 1)) == INTEGER_CST)
{ {
align = (TREE_INT_CST_LOW (TREE_OPERAND (addr, 1)) ptr_bitmask = TREE_INT_CST_LOW (TREE_OPERAND (addr, 1));
& -TREE_INT_CST_LOW (TREE_OPERAND (addr, 1))); ptr_bitmask *= BITS_PER_UNIT;
align *= BITS_PER_UNIT; align = ptr_bitmask & -ptr_bitmask;
addr = TREE_OPERAND (addr, 0); addr = TREE_OPERAND (addr, 0);
} }
...@@ -373,6 +375,9 @@ get_object_alignment_2 (tree exp, unsigned int *alignp, ...@@ -373,6 +375,9 @@ get_object_alignment_2 (tree exp, unsigned int *alignp,
= get_pointer_alignment_1 (addr, &ptr_align, &ptr_bitpos); = get_pointer_alignment_1 (addr, &ptr_align, &ptr_bitpos);
align = MAX (ptr_align, align); align = MAX (ptr_align, align);
/* Re-apply explicit alignment to the bitpos. */
ptr_bitpos &= ptr_bitmask;
/* The alignment of the pointer operand in a TARGET_MEM_REF /* The alignment of the pointer operand in a TARGET_MEM_REF
has to take the variable offset parts into account. */ has to take the variable offset parts into account. */
if (TREE_CODE (exp) == TARGET_MEM_REF) if (TREE_CODE (exp) == TARGET_MEM_REF)
......
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