http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50482
--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2011-09-22 16:27:01 UTC --- Shorter testcase: void test (int code, unsigned int * image, int * colors) { int i; for (i = 0; i < code; ++i) image[i] = (colors[i] < 0 ? ~(unsigned int) 0 : colors[i]); } gcc -O3 -msse4.