This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/26939] New: PRE confuses loop number of iterations analysis


/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-sccp-details" } */

void bar(int);
void foo(int i1, int j1)
{
  int i, j;

  for (j=0; j<=j1; ++j)
    for (i=0; i<=i1; ++i)
      bar(j+1);
}

/* { dg-final { scan-tree-dump-not "set_nb_iterations_in_loop = scev_not_known"
"sccp"} } */
/* { dg-final { cleanup-tree-dump "sccp" } } */


Compare to using j-1 in the inner loop, which makes # iterations analysis
succeed.


-- 
           Summary: PRE confuses loop number of iterations analysis
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]