| 1 |
/* PR rtl-optimization/89965 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O -mtune=nano-x2 -fcaller-saves -fexpensive-optimizations -fno-tree-dce -fno-tree-ter" } */ |
| 4 |
/* { dg-additional-options "-march=i386" { target ia32 } } */ |
| 5 |
|
| 6 |
int a; |
| 7 |
|
| 8 |
__attribute__ ((noipa)) unsigned long long |
| 9 |
foo (unsigned char c, unsigned d, unsigned e, unsigned long long f, |
| 10 |
unsigned char g, unsigned h, unsigned long long i) |
| 11 |
{ |
| 12 |
(void) d; |
| 13 |
unsigned short j = __builtin_mul_overflow_p (~0, h, c); |
| 14 |
e <<= e; |
| 15 |
i >>= 7; |
| 16 |
c *= i; |
| 17 |
i /= 12; |
| 18 |
a = __builtin_popcount (c); |
| 19 |
__builtin_add_overflow (e, a, &f); |
| 20 |
return c + f + g + j + h; |
| 21 |
} |
| 22 |
|
| 23 |
__attribute__ ((noipa)) void |
| 24 |
bar (void) |
| 25 |
{ |
| 26 |
char buf[64]; |
| 27 |
__builtin_memset (buf, 0x55, sizeof buf); |
| 28 |
asm volatile ("" : : "r" (&buf[0]) : "memory"); |
| 29 |
} |
| 30 |
|
| 31 |
int |
| 32 |
main (void) |
| 33 |
{ |
| 34 |
bar (); |
| 35 |
unsigned long long x = foo (2, 0, 0, 0, 0, 0, 0); |
| 36 |
if (x != 0) |
| 37 |
__builtin_abort (); |
| 38 |
return 0; |
| 39 |
} |