This is the mail archive of the 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]

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

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.

This fixes SPEC2006 (and vect-101 on osx darwin).

Bootstrapped and regtested on i686-darwin

Committed to mainline.

2006-12-11 Daniel Berlin <>

       * tree-ssa-structalias.c (handle_ptr_arith): Return false when we
       can't handle the pointer arithmetic.

--- gcc/tree-ssa-structalias.c	(/mirror/gcc-trunk)	(revision 665)
+++ gcc/tree-ssa-structalias.c	(/local/gcc-clean)	(revision 665)
@@ -2871,6 +2871,8 @@ handle_ptr_arith (VEC (ce_s, heap) *lhsc
       rhsoffset = TREE_INT_CST_LOW (op1) * BITS_PER_UNIT;
+  else
+    return false;
   for (i = 0; VEC_iterate (ce_s, lhsc, i, c); i++)

Property changes on: 
Name: svk:merge

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