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 optimization/13876] loop not fully optimized


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-28 22:03 -------
This is a problem with jump threading as if you change the fcuntion t to be:
void t(int l, int *y)
{
  int i;
  int NotFound;
  o();
  for(i = 0, NotFound = 1;i<l;i++)
  {
    if (y[i])  
    {
      NotFound = 0;
      g();
    }
    if (!NotFound)
      break;
  }
  h(NotFound);
}

It works correctly but changing it to:
void t(int l, int *y)
{
  int i;
  int NotFound;
  o();
  for(i = 0, NotFound = 1;i<l;i++)
  {
    if (!NotFound)
      break;
    if (y[i])  
    {
      NotFound = 0;
      g();
    }
  }
  h(NotFound);
}
It does not.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-28 22:03:27
               date|                            |


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


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