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 via email to