public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Does GIMPLE tree comprise ARRAY_REF/ARRAY_REF_RANGE node
@ 2008-01-02 14:30 Qing Wei
  2008-01-02 15:05 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Qing Wei @ 2008-01-02 14:30 UTC (permalink / raw)
  To: gcc

Hi,
I find that in the function expand_expr_real_1(), which translates the
GIMPLE tree nodes to RTL.
There are codes to process the ARRAY_REF/ARRAY_REF_RANGE node. I wrote a
test program in C such like this,

void f(int s1[], int s2[], int s3[])
{
int j;

for (j = 0; j < 16; j++)
s3[j] = s1[j] + s2[j];
}

I set a breakpoint at the codes to process ARRAY_REF node in
expand_expr_real_1(), However I found that GCC never goes there. I do
find that the ARRAY_REF nodes denoting S1[j]/S2[j]/S3[j] exist in
GENERIC tree for the program. After the gimplify_expr() called, they are
lowered to other nodes? If so, why the expand_expr_real_1() handle such
nodes. What is wrong.

Qing

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

* Re: Does GIMPLE tree comprise ARRAY_REF/ARRAY_REF_RANGE node
  2008-01-02 14:30 Does GIMPLE tree comprise ARRAY_REF/ARRAY_REF_RANGE node Qing Wei
@ 2008-01-02 15:05 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2008-01-02 15:05 UTC (permalink / raw)
  To: Qing Wei; +Cc: gcc

On Jan 2, 2008 3:24 PM, Qing Wei <dragonylffly@gmail.com> wrote:
> Hi,
> I find that in the function expand_expr_real_1(), which translates the
> GIMPLE tree nodes to RTL.
> There are codes to process the ARRAY_REF/ARRAY_REF_RANGE node. I wrote a
> test program in C such like this,
>
> void f(int s1[], int s2[], int s3[])
> {
> int j;
>
> for (j = 0; j < 16; j++)
> s3[j] = s1[j] + s2[j];
> }
>
> I set a breakpoint at the codes to process ARRAY_REF node in
> expand_expr_real_1(), However I found that GCC never goes there. I do
> find that the ARRAY_REF nodes denoting S1[j]/S2[j]/S3[j] exist in
> GENERIC tree for the program. After the gimplify_expr() called, they are
> lowered to other nodes? If so, why the expand_expr_real_1() handle such
> nodes. What is wrong.

Nothing is wrong.  Try

int s1[10];
int s2[10];
int s3[10];
void f()
{
   int i;
   for (i=0; i<10; ++i)
     s1[i] = s2[i] + s3[i];
}

Richard.

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

end of thread, other threads:[~2008-01-02 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-02 14:30 Does GIMPLE tree comprise ARRAY_REF/ARRAY_REF_RANGE node Qing Wei
2008-01-02 15:05 ` Richard Guenther

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).