public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
To: Revital Eres <ERES@il.ibm.com>
Cc: gcc@gcc.gnu.org
Subject: Re: loop unroll question
Date: Fri, 02 Apr 2004 09:06:00 -0000	[thread overview]
Message-ID: <20040402090636.GA19675@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <OF3FEBFE03.6A98C185-ONC2256E69.004E2096-C2256E69.004F31D6@il.ibm.com>

Hello,

> For mainline on power-pc 4 with the option -O3 -funroll-loops, 
> the following loop is not unrolled, but in GCC 3.4 it is. 
> Also for mainline the bct is not inserted, but again in GCC 3.4 
> it is.
> 
> void
> example_new(int a[],int b[],int c[], int j) 
> {
>     int i;
> 
>     for(i=0 ; i<=j ; i++) 
>        {
>           c[i]=a[i]+b[i];
>        }
>     return;
> }

as for inserting bct -- it was wrong to do this, since the loop could
be the infinite one (not really, since we work in a signed arithmetics
for that the overflow has an undefined behavior, but we cannot
verify this on rtl level).

As for unrolling, we are too conservative here; I will send a patch
for this soon.

Zdenek

> If the condition is changed to < (instead of <=) the unrolling is 
> done as expected and bct is inserted.
> 
> Thanks,
> Revital

       reply	other threads:[~2004-04-02  9:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OF3FEBFE03.6A98C185-ONC2256E69.004E2096-C2256E69.004F31D6@il.ibm.com>
2004-04-02  9:06 ` Zdenek Dvorak [this message]
2004-04-01 14:53 Revital Eres

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040402090636.GA19675@atrey.karlin.mff.cuni.cz \
    --to=rakdver@atrey.karlin.mff.cuni.cz \
    --cc=ERES@il.ibm.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).