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/52324] New: [4.7 Regression] Store motion no longer performed


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

             Bug #: 52324
           Summary: [4.7 Regression] Store motion no longer performed
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


The following fails on trunk but works in 4.5 and 4.6.

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

int *l, *r;
int test_func(void)
{
  int i;
  int direction;
  static int pos;

  pos = 0;
  direction = 1;

  for ( i = 0; i <= 400; i++ )
    {
      if ( direction == 0 )
        pos = l[pos];
      else
        pos = r[pos];

      if ( pos == -1 )
        {
          pos = 0;
          direction = !direction;
        }
    }
  return i;
}

/* { dg-final { scan-tree-dump "Executing store motion of pos" "lim1" } } */
/* { dg-final { cleanup-tree-dump "lim1" } } */


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