2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / ext-elim-1.c
blob5e899a235f65fc2df0bc28249bd122dd8c77ba14
1 /* PR rtl-optimization/51924 */
2 /* Testcase by Zdenek Sojka <zsojka@seznam.cz> */
4 /* { dg-do run } */
5 /* { dg-options "-O -free -fno-rename-registers -ftree-vectorize -funroll-loops" } */
7 typedef __UINT64_TYPE__ uint64_t;
9 uint64_t __attribute__ ((noinline, noclone))
10 bn_sub_words (uint64_t * r, const uint64_t * a, const uint64_t * b, int n)
12 uint64_t t1, t2;
13 unsigned c = 0;
15 while (n)
17 t1 = a[0];
18 t2 = b[0];
19 r[0] = (t1 - t2 - c);
20 if (t1 != t2)
21 c = (t1 < t2);
22 a++;
23 b++;
24 r++;
25 n--;
27 return (c);
30 int
31 main (void)
33 uint64_t r[2];
34 uint64_t a[2] = { -1, -1 };
35 uint64_t b[2] = { 0, 0 };
36 if (bn_sub_words (r, a, b, 2) != 0)
37 __builtin_abort ();
38 return 0;