public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Testcase for loop in try_move_mult_to_index?
@ 2005-04-29 10:17 Richard Guenther
  2005-04-29 10:48 ` Zdenek Dvorak
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Guenther @ 2005-04-29 10:17 UTC (permalink / raw)
  To: gcc; +Cc: Zdenek Dvorak

Hi!

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?  Zdenek, do you have a
testcase that triggeres this?

Thanks,
Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Testcase for loop in try_move_mult_to_index?
  2005-04-29 10:17 Testcase for loop in try_move_mult_to_index? Richard Guenther
@ 2005-04-29 10:48 ` Zdenek Dvorak
  0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Dvorak @ 2005-04-29 10:48 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-29 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-29 10:17 Testcase for loop in try_move_mult_to_index? Richard Guenther
2005-04-29 10:48 ` Zdenek Dvorak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).