1 // PR rtl-optimization/69570
3 // { dg-options "-O2" }
4 // { dg-additional-options "-fpic" { target fpic } }
5 // { dg-additional-options "-march=i686" { target ia32 } }
7 template <typename T> inline const T &
8 min (const T &a, const T &b)
15 template <typename T> inline const T &
16 max (const T &a, const T &b)
24 foo (unsigned x, unsigned y, unsigned z, double &h, double &s, double &l)
29 double m = max (r, max (g, b));
30 double n = min (r, min (g, b));
33 h = 0.0, s = 0.0, l = e / 2.0;
36 s = l > 0.5 ? d / (2.0 - e) : d / e;
38 h = (g - b) / d + (g < b ? 6.0 : 0.0);
40 h = (b - r) / d + 2.0;
42 h = (r - g) / d + 4.0;
47 __attribute__ ((noinline, noclone))
48 void bar (unsigned x[3], double y[3])
51 foo (x[0], x[1], x[2], h, s, l);
60 unsigned x[3] = { 0, 128, 0 };
64 if (__builtin_fabs (y[0] - 0.33333) > 0.001
65 || __builtin_fabs (y[1] - 1) > 0.001
66 || __builtin_fabs (y[2] - 0.25098) > 0.001)