Fix PR target/63209.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr63209.c
blob9bcb58745638e067cce8f3837a304a91c975f4ca
1 static int Sub(int a, int b) {
2 return b -a;
5 static unsigned Select(unsigned a, unsigned b, unsigned c) {
6 const int pa_minus_pb =
7 Sub((a >> 8) & 0xff, (b >> 8) & 0xff) +
8 Sub((a >> 0) & 0xff, (b >> 0) & 0xff);
9 return (pa_minus_pb <= 0) ? a : b;
12 __attribute__((noinline)) unsigned Predictor(unsigned left, const unsigned* const top) {
13 const unsigned pred = Select(top[1], left, top[0]);
14 return pred;
17 int main(void) {
18 const unsigned top[2] = {0xff7a7a7a, 0xff7a7a7a};
19 const unsigned left = 0xff7b7b7b;
20 const unsigned pred = Predictor(left, top /*+ 1*/);
21 if (pred == left)
22 return 0;
23 return 1;