This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/26001] [4.1/4.2 Regression] expand uses the wrong part of the string for array accesses
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jan 2006 19:37:43 -0000
- Subject: [Bug middle-end/26001] [4.1/4.2 Regression] expand uses the wrong part of the string for array accesses
- References: <bug-26001-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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