This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19096] New: Wrong code with -ftree-vectorize
- From: "belyshev at lubercy dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2004 01:11:49 -0000
- Subject: [Bug tree-optimization/19096] New: Wrong code with -ftree-vectorize
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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