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

[Bug middle-end/26001] [4.1/4.2 Regression] expand uses the wrong part of the string for array accesses



------- Comment #14 from tobi at gcc dot gnu dot org  2006-01-30 19:37 -------
(In reply to comment #13)
> (In reply to comment #12)
> > > this (t02.original) looks like a possible off-by-one error.
> > 
> > [1] here is correct, the arrary bounds is 1:1 and not the C array bounds
> > starting at 0.
> 
> I should mention the off by the one error is in expand, where it forgets to
> take into account the lower bound of the array.

(In reply to comment #13)
> (In reply to comment #12)
> > > this (t02.original) looks like a possible off-by-one error.
> > 
> > [1] here is correct, the arrary bounds is 1:1 and not the C array bounds
> > starting at 0.
> 
> I should mention the off by the one error is in expand, where it forgets to
> take into account the lower bound of the array.

Sounds like the tree-optimizers should have replaced "0"[1] with '0'.  This
also sounds like it was pure chance that the bug didn't trigger at -O0.

> I will be fixing this after my current bootstrap/test finishes for a different
> expand bug.

Thanks.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26001


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