This is the mail archive of the gcc@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: Testcase for loop in try_move_mult_to_index?


Hello,

> I cannot see how fold-const.c:try_move_mult_to_index ever
> successfully will do a transformation if the loop
> 
>   for (;; ref = TREE_OPERAND (ref, 0))
>     {
>       if (TREE_CODE (ref) == ARRAY_REF)
>         {
> ...
>           break;
>         }
> 
>       if (!handled_component_p (ref))
>         return NULL_TREE;
>     }
> 
> will not break in the first iteration.  What kind of complex
> trees are we trying to match here?

for example 

struct x
{
  int x;
  int y;
} a[1000];


&a[i].x + 8 * j is transformed to &a[i+j].x

Zdenek


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