| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O -fdump-tree-ifcombine-details" } */ |
| 3 |
|
| 4 |
/* Check that the third compare won't be combined with the first one. */ |
| 5 |
|
| 6 |
struct s { |
| 7 |
char a, b; |
| 8 |
int p; |
| 9 |
}; |
| 10 |
|
| 11 |
struct s a = { 0, 0, 0 }; |
| 12 |
struct s b = { 0, 0, 0 }; |
| 13 |
|
| 14 |
int f () { |
| 15 |
return (a.a != b.a || (a.p != b.p && a.b != b.b)); |
| 16 |
} |
| 17 |
|
| 18 |
int g () { |
| 19 |
return (a.a == b.a && (a.p == b.p || a.b == b.b)); |
| 20 |
} |
| 21 |
|
| 22 |
/* { dg-final { scan-tree-dump-not "optimizing" "ifcombine" } } */ |
| 23 |
/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "ifcombine" } } */ |