| 1 |
/* PR tree-optimization/111845 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -g -masm=att" } */ |
| 4 |
/* { dg-final { scan-assembler-times "\tadcq\t" 8 { target lp64 } } } */ |
| 5 |
/* { dg-final { scan-assembler-times "\tadcl\t" 8 { target ia32 } } } */ |
| 6 |
|
| 7 |
unsigned long l, m; |
| 8 |
|
| 9 |
__attribute__((noipa)) void |
| 10 |
foo (unsigned long x, unsigned long y, unsigned long h, unsigned long i, int a, int b) |
| 11 |
{ |
| 12 |
unsigned long c, d; |
| 13 |
unsigned long e = __builtin_add_overflow (x, y, &c); |
| 14 |
unsigned long f = __builtin_add_overflow (c, a < b, &d); |
| 15 |
m = ((h + i) + e) + f; |
| 16 |
l = d; |
| 17 |
} |
| 18 |
|
| 19 |
__attribute__((noipa)) void |
| 20 |
bar (unsigned long x, unsigned long y, unsigned long h, unsigned long i, int a, int b) |
| 21 |
{ |
| 22 |
unsigned long c, d; |
| 23 |
unsigned long e = __builtin_add_overflow (x, y, &c); |
| 24 |
unsigned long f = __builtin_add_overflow (c, a < b, &d); |
| 25 |
m = (h + (i + e)) + f; |
| 26 |
l = d; |
| 27 |
} |
| 28 |
|
| 29 |
__attribute__((noipa)) void |
| 30 |
baz (unsigned long x, unsigned long y, unsigned long h, unsigned long i, int a, int b) |
| 31 |
{ |
| 32 |
unsigned long c, d; |
| 33 |
unsigned long e = __builtin_add_overflow (x, y, &c); |
| 34 |
unsigned long f = __builtin_add_overflow (c, a < b, &d); |
| 35 |
m = h + (i + (e + f)); |
| 36 |
l = d; |
| 37 |
} |
| 38 |
|
| 39 |
__attribute__((noipa)) void |
| 40 |
qux (unsigned long x, unsigned long y, unsigned long h, unsigned long i, int a, int b) |
| 41 |
{ |
| 42 |
unsigned long c, d; |
| 43 |
unsigned long e = __builtin_add_overflow (x, y, &c); |
| 44 |
unsigned long f = __builtin_add_overflow (c, a < b, &d); |
| 45 |
m = h + ((i + e) + f); |
| 46 |
l = d; |
| 47 |
} |