It's back, the negative dimension problem - explanation, of sorts
Toon Moene
toon@moene.indiv.nluug.nl
Mon Jun 8 14:45:00 GMT 1998
[ egcs-1.0.3a rejects DIMENSION AAP(-1:*) ]
> Yes, it has been solved (again) in the most recent
> snapshot.There is no negative dim problem in ...531.
I think what basically happened was this:
1. Originally, egcs before the 1.0 release (and any combination
of g77 + gcc) had terrible code generation for loops over
arrays on Alpha's.
2. Richard Henderson repaired this by "promoting" index variables
in the Fortran Frontend to the same size as pointers.
3. After the first release it turned out that this mistreated
arrays with negative bounds. This was repaired, both in the
main development trunk of CVS as well as the release branch.
4. In the mean time, in the main trunk (not the 1.0.x release
branch) a problem with undefined upper bounds was repaired.
5. Subsequently, the final (hah ;-) problem with negative array
bounds and index expressions was resolved by doing all
arithmetic in a signed "type" the same size as the (unsigned)
pointers.
6. This solution (5.) was backstitched into the release branch
but nobody detected in time that that solution didn't play
nice with the way undefined array bounds were handled
previous of (4.).
HTH (Richard will correct me if this is too revisionist).
Toon.
More information about the Gcc-bugs
mailing list