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]

[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 <dberlin@dberlin.org>

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

--Dan
--- 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
 +138bc75d-0d04-0410-961f-82ee72b054a4:/trunk:119760
 +23c3ee16-a423-49b3-8738-b114dc1aabb6:/local/gcc-pta-dev:259
 +23c3ee16-a423-49b3-8738-b114dc1aabb6:/local/gcc-trunk:531
 +7dca8dba-45c1-47dc-8958-1a7301c5ed47:/local-gcc/md-constraint:113709
 +f367781f-d768-471e-ba66-e306e17dff77:/local/gen-rework-20060122:110130


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