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: [patch] for some of PR29256 problems


Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> writes:

> the change to ivopts in
> http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00198.html makes us to
> create all induction variables in integer types.  This however disabled
> the part of the ivopts that used to ensure that we do not use pointer
> variables that point to one object to address memory references in
> another object.  I.e., with the change, we could produce code like
> 
> delta = &a - &c;
> for (p = &c; ; p += 4B)
>   *p = *(p + delta);
> 
> (which is known to confuse alias analysis, as well as users :-)
> This patch makes determine_base_object work even for pointers that
> are casted to integer types, thus fixing this problem.
> 
> Another problem in this PR is that even with this change, the induction
> variable selection will choose a suboptimal induction variables.  This
> is because on powerpc, [symbol + index] addressing mode will be
> considered to be significantly more expensive than [reg + index] mode
> (since in the former case, we must load the address of the symbol to
> register first, and than use [reg + index] addressing mode, and the
> insns to load the address are considered to be quite expensive).  This
> however does not make much sense, since the addresses will have to be
> loaded to registers in any case (and they are loop invariant), so
> penalizing the symbol + index addresses so much is missleading.  This
> patch also adds the code to get_address_cost to fix up this case and to
> decrease the cost of [symbol + index] addressing mode if it is
> significantly mode expensive than [reg + index] addressing mode.

This is OK with a ChangeLog entry.

Thanks.

Ian


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