https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121805
--- Comment #8 from kargls at comcast dot net ---
(In reply to Mikael Morin from comment #6)
> (In reply to kargls from comment #3)
> > idx = [(i,i=1,8)]
> > e%data = idx
> > dd=>e%data
> > array_sum = sum(idx(dd))
> ...
> > D.4694 = *(integer(kind=4) *) (dd.data + (sizetype)
> > ((dd.dim[0].stride *
> > NON_LVALUE_EXPR <S.3>) * 4));
> > D.4695 = (integer(kind=8)) D.4694;
> >
> > I think the above should be D.4695 = (integer(kind=8)) D.4694 + 1.
>
> Should it?
> These variables are the values of elements of dd, which is a copy of idx.
> So the variables should have range [1:8]; why add 1?
You certainly have a better understanding of the scalarizer than I.
But, the reason I think a +1 is missing is the -1 here:
val.2 = idx[D.4695 + -1] + val.2;
Not to mention that the error message from -fcheck=all says the lower
bound is 0 when the range is (1:8).