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

Re: adjust generation of component addresses


    I've built a cross gnat1; hopefully I'll be able to reproduce this.

Note that the problem exists on all machines, but it's just the 32/64 where
it always causes bad code.

Suppose you have an array of integers who bounds are the highest integer 
minus five to the highest integer minus four (the Ada ACATS tests love to
make such things).  If you do the index calculation by subtracting the lower
bound from the index and then multiplying by the size, you're guaranteed not
to overflow, but if you multiply the index by the size, you will overflow.
Whether or not that overflow is harmful depends on lots of things, but I'm
dubious about allowing it.

For example, won't it fail on the PA, with its segments?


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