[PATCH]: Fix pointer arithmetic handling in tree-ssa-structalias.c
Richard Guenther
richard.guenther@gmail.com
Wed Dec 13 15:43:00 GMT 2006
On 12/13/06, Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com> wrote:
> Daniel,
> Your patch caused cpu2006/gcc to fail (results miscompare) at -O2
> optimization level with 'test' dataset on ia32.
>
> - Grigory
>
> Daniel Berlin wrote:
> > Without this patch, we are currently considering *(p + x) and *(p + y)
> > to point to the same thing, even when x and y are not equal.
> >
> > This is due to a missing else clause.
> >
> > Fixed thusly.
I wonder what we do for MINUS_EXPR there...
if (TREE_CODE (expr) != PLUS_EXPR
&& TREE_CODE (expr) != MINUS_EXPR)
return false;
op0 = TREE_OPERAND (expr, 0);
op1 = TREE_OPERAND (expr, 1);
get_constraint_for (op0, &temp);
if (POINTER_TYPE_P (TREE_TYPE (op0))
&& TREE_CODE (op1) == INTEGER_CST
&& TREE_CODE (expr) == PLUS_EXPR)
{
rhsoffset = TREE_INT_CST_LOW (op1) * BITS_PER_UNIT;
}
else
return false;
but all the stuff looks "interesting" anyway ;) (See PR29716)
Richard.
More information about the Gcc-patches
mailing list