[Bug tree-optimization/19096] New: Wrong code with -ftree-vectorize

belyshev at lubercy dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 21 01:11:00 GMT 2004


use "-O1 -ftree-vectorize" to reproduce:
------------------------------------------------------------------------------
extern void abort (void);

static unsigned int prime_tab[] = {7, 127};

int main (void)
{
  unsigned int n, low, mid, high;

  n = 64;
  low = 0;
  high = 1;
  while (low != high)
    {
      mid = low + (high - low) / 2;
      if (n > prime_tab[mid])
	low = mid + 1;
      else
	high = mid;
    }
  
  if (n > prime_tab[low])
    abort ();
  return low;
}
------------------------------------------------------------------------------

-- 
           Summary: Wrong code with -ftree-vectorize
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: belyshev at lubercy dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i386-pc-linux-gnu


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



More information about the Gcc-bugs mailing list