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; } ------------------------------------------------------------------------------
This works for me on ppc-darwin. In .vect, I get "number of iterations cannot be computed".
This works for me, too, with a snapshot from 2004-12-14, or at least it doesn't abort and returns a return code of 1. What do you see, and what flags exactly do you use? I tried with -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse -O1 -ftree-vectorize x.c W.
My bad, I used wrong tree... The problem is in these patches: http://gcc.gnu.org/ml/gcc-patches/2004-12/msg01381.html and not in mainline.
Which one of them? And what is the problem?
The problem is with this patch * tree-optimize.c (init_tree_optimization_passes): Add dominator and dce pass after pre. and it is fixed by http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00514.html , so this is a dup of bug 19067 *** This bug has been marked as a duplicate of 19067 ***