public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xinliangli at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/35356]  New: Missing Index splitting support in  gcc
Date: Mon, 25 Feb 2008 04:55:00 -0000	[thread overview]
Message-ID: <bug-35356-9436@http.gcc.gnu.org/bugzilla/> (raw)

The following cases are not handled by gcc:

case 1:
Example 28:  search loop -- yes it is silly, but exists in real program:

  for (i = 0; i < n; i++)
  {
      if ( i == k)
          a[i] = ...
  }

Should eliminate the loop and generate:

if (k >= 0 && k < n)
    a[k] = ....


case 2:

  for (i = 0; i < n; i++)
  {
       if (i == k)
          a[i] = 1;
       else 
          a[i] = i;
  }

Should be converted into:
  for (i = 0; i < min (n, k); i++)
     a[i] = i;
  if (k >= 0 && k < n)
     a[k] = 1;
  for (i = max(k+1,0); i < n; i++)
     a[i] = i;


case 3 (similar to case 1): (from art)

int winner,numf1s,numf2s, resonant,cp,numpatterns;
double **tds;
double d, tsum;
typedef struct {
      double y;
      int   reset;
      } xyz;

xyz *Y;
int ti;

void match()
{
  int tj,tresult;
  for (tj=0;tj<numf2s;tj++)
    {
      if ((tj == winner) &&(Y[tj].y > 0))
        tsum += tds[ti][tj] * d;
    }
}


-- 
           Summary: Missing Index splitting support in  gcc
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xinliangli at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35356


             reply	other threads:[~2008-02-25  4:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25  4:55 xinliangli at gmail dot com [this message]
2008-02-25 11:53 ` [Bug tree-optimization/35356] " rguenth at gcc dot gnu dot org
2009-07-21 16:31 ` spop at gcc dot gnu dot org

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=bug-35356-9436@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).