This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: adjust generation of component addresses
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Feb 02 07:13:49 EST
- Subject: 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?