[Bug c/44848] Bogus "array subscript is below array bounds" with loops

2010-07-07 Thread eli dot friedman at gmail dot com


--- Comment #2 from eli dot friedman at gmail dot com  2010-07-08 03:08 
---
I'm afraid I mis-reduced the issue; try the following (which reproduces on both
trunk r161941 and 4.5.0):

typedef struct LLSModel{
double variance[32];
int indep_count;
}LLSModel;

void av_solve_lls(LLSModel *m, double (*factor)[33], int count, int min_order){
int i,j,k;

for(i=0; i=0; k--)
sum -= factor[i][k];

factor[j][i] = sum;
}
}
for(j=count-1; j>=min_order; j--){
for(i=j; i>=0; i--)
factor[j][i]= 1 / factor[i][i];

m->variance[j]= factor[0][0];
for(i=0; i<=j; i++)
m->variance[j] += factor[j][i];
}
}


-- 

eli dot friedman at gmail dot com changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|DUPLICATE   |


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



[Bug c/44848] Bogus "array subscript is below array bounds" with loops

2010-07-07 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2010-07-07 10:08 ---
This is the same as PR43270 (and the fix for it cures it).

*** This bug has been marked as a duplicate of 43270 ***


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


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