1 /* PR rtl-optimization/55342 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4 /* { dg-final { scan-assembler-not "notb" } } */
5 
6 
convert_image(unsigned char * in,unsigned char * out,int size)7 void convert_image(unsigned char *in, unsigned char *out, int size) {
8     int i;
9     unsigned char * read = in,
10      * write = out;
11     for(i = 0; i < size; i++) {
12         unsigned char r = *read++;
13         unsigned char g = *read++;
14         unsigned char b = *read++;
15         unsigned char c, m, y, k, tmp;
16         c = 255 - r;
17         m = 255 - g;
18         y = 255 - b;
19 	if (c < m)
20 	  k = ((c) > (y)?(y):(c));
21 	else
22           k = ((m) > (y)?(y):(m));
23         *write++ = c - k;
24         *write++ = m - k;
25         *write++ = y - k;
26         *write++ = k;
27     }
28 }
29