This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: Fix pointer arithmetic handling in tree-ssa-structalias.c


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]