From: Richard Biener Date: Fri, 27 Feb 2015 08:37:51 +0000 (+0000) Subject: re PR testsuite/63175 (FAIL: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c scan... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ceae7e9576c605219f2da69e2450476330548a7;p=gcc.git 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 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e4346a0ae93..7763c88f14f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-02-27 Richard Biener + + 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 Martin Liska diff --git a/gcc/builtins.c b/gcc/builtins.c index 8f3c0bc22b3..fb871e696a0 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -359,13 +359,15 @@ get_object_alignment_2 (tree exp, unsigned int *alignp, tree addr = TREE_OPERAND (exp, 0); unsigned ptr_align; 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 && TREE_CODE (TREE_OPERAND (addr, 1)) == INTEGER_CST) { - align = (TREE_INT_CST_LOW (TREE_OPERAND (addr, 1)) - & -TREE_INT_CST_LOW (TREE_OPERAND (addr, 1))); - align *= BITS_PER_UNIT; + ptr_bitmask = TREE_INT_CST_LOW (TREE_OPERAND (addr, 1)); + ptr_bitmask *= BITS_PER_UNIT; + align = ptr_bitmask & -ptr_bitmask; addr = TREE_OPERAND (addr, 0); } @@ -373,6 +375,9 @@ get_object_alignment_2 (tree exp, unsigned int *alignp, = get_pointer_alignment_1 (addr, &ptr_align, &ptr_bitpos); 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 has to take the variable offset parts into account. */ if (TREE_CODE (exp) == TARGET_MEM_REF)