| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O1 -fstrict-aliasing -fdump-tree-cddce1" } */ |
| 3 |
|
| 4 |
__extension__ typedef __SIZE_TYPE__ size_t; |
| 5 |
extern void *xmalloc (size_t) __attribute__ ((__malloc__)); |
| 6 |
struct edge_def |
| 7 |
{ |
| 8 |
struct basic_block_def *dest; |
| 9 |
int flags; |
| 10 |
}; |
| 11 |
typedef struct edge_def *edge; |
| 12 |
struct basic_block_def |
| 13 |
{ |
| 14 |
int flags; |
| 15 |
}; |
| 16 |
typedef struct basic_block_def *basic_block; |
| 17 |
extern int n_basic_blocks; |
| 18 |
extern edge frob (); |
| 19 |
basic_block * |
| 20 |
find_unreachable_blocks (void) |
| 21 |
{ |
| 22 |
basic_block *tos, *worklist; |
| 23 |
tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks); |
| 24 |
edge e = frob(); |
| 25 |
if (!(e->dest->flags & 4)) |
| 26 |
{ |
| 27 |
e->dest->flags |= 4; |
| 28 |
*tos++ = e->dest; |
| 29 |
} |
| 30 |
return worklist; |
| 31 |
} |
| 32 |
|
| 33 |
/* If the aliasing code does its job properly, then we should be |
| 34 |
able to determine that modifying e->dest->flags does not |
| 35 |
modify e or e->dest if we can assert strict-aliasing rules. |
| 36 |
The net result is that we only need one load of e->dest. */ |
| 37 |
/* { dg-final { scan-tree-dump-times "->dest" 1 "cddce1" } } */ |