Commit 6f1be8e1 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/26587 (strict aliasing incorrectly pre-loads an array element with loops)

2006-03-07  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/26587
	* tree-ssa-structalias.c (handle_ptr_arith): Handle MINUS_EXPR.

	* gcc.dg/torture/pr26587.c: New testcase.

From-SVN: r111808
parent 6410fb81
2006-03-07 Richard Guenther <rguenther@suse.de>
PR tree-optimization/26587
* tree-ssa-structalias.c (handle_ptr_arith): Handle MINUS_EXPR.
2006-03-07 Richard Sandiford <richard@codesourcery.com>
* varasm.c (assemble_variable): Fix setting of DECL_IN_TEXT_SECTION.
......
2006-03-07 Richard Guenther <rguenther@suse.de>
PR tree-optimization/26587
* gcc.dg/torture/pr26587.c: New testcase.
2006-03-06 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <eedelman@gcc.gnu.org>
/* { dg-do run } */
extern void abort(void);
typedef unsigned int BF_word;
typedef BF_word BF_key[16 + 2];
static struct {
BF_key P;
} BF_current;
int main(void)
{
BF_word L;
BF_word tmp4, *ptr;
BF_word i;
for (i = 0; i < 16 + 2; i++)
BF_current.P[i] = i * 0x98765432;
L = 0;
ptr = BF_current.P;
do {
ptr += 2;
L ^= BF_current.P[0];
tmp4 = L >> 24;
L = tmp4 ^ BF_current.P[16 + 1];
*(ptr - 2) = L;
} while (ptr < &BF_current.P[16 + 2]);
if (L != 0x1fdb9752)
abort();
return 0;
}
......@@ -3182,7 +3182,8 @@ handle_ptr_arith (VEC (ce_s, heap) *lhsc, tree expr)
VEC (ce_s, heap) *temp = NULL;
unsigned int rhsoffset = 0;
if (TREE_CODE (expr) != PLUS_EXPR)
if (TREE_CODE (expr) != PLUS_EXPR
&& TREE_CODE (expr) != MINUS_EXPR)
return false;
op0 = TREE_OPERAND (expr, 0);
......@@ -3190,7 +3191,8 @@ handle_ptr_arith (VEC (ce_s, heap) *lhsc, tree expr)
get_constraint_for (op0, &temp);
if (POINTER_TYPE_P (TREE_TYPE (op0))
&& TREE_CODE (op1) == INTEGER_CST)
&& TREE_CODE (op1) == INTEGER_CST
&& TREE_CODE (expr) == PLUS_EXPR)
{
rhsoffset = TREE_INT_CST_LOW (op1) * BITS_PER_UNIT;
}
......
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