This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Fix pointer arithmetic handling in tree-ssa-structalias.c
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Grigory Zagorodnev" <grigory_zagorodnev at linux dot intel dot com>
- Cc: "Daniel Berlin" <dberlin at dberlin dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, "H. J. Lu" <hjl at lucon dot org>
- Date: Wed, 13 Dec 2006 16:43:27 +0100
- Subject: Re: [PATCH]: Fix pointer arithmetic handling in tree-ssa-structalias.c
- References: <4aca3dc20612111938w37d90a3id0a10670e302c36a@mail.gmail.com> <45801E6E.7000103@linux.intel.com>
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.