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] |
On Tue, May 11, 2010 at 2:52 PM, Toon Moene<toon@moene.org> wrote:
Does this also take care of induction variables of the form of:
inv * iv + inv + const
?
This was one we had to "deal with" in the second half of the '90s, as a result of Fortran arrays being (by default) 1-based instead of 0-based.
The answer depends:
For this linear address expression: inv1*iv + inv2 + const
if inv1 is not compile time constant (or too big one), the cost of expressing it using this iv is 'infinite' in the current implementation, which means this expression will either be strength reduced (to its own iv candidate) or expressed using another iv with stride == inv1. If inv1 is a constant but not one of the multiplier allowed in the target address, the cost of expressing is also high, but the final expression may end up in this form depending on other cost.
And yes if the final expression is in this form, the reassociation will make the memory op into MEM_REF (inv2 + const, iv, inv1).
-- Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/ Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html#Fortran
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |