PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20041122-1.c
blob5e6828b6f4f21efaa24cdb7dbdb16894b19844eb
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fstrict-aliasing -fdump-tree-fre1" } */
4 __extension__ typedef __SIZE_TYPE__ size_t;
5 extern void *xmalloc (size_t) __attribute__ ((__malloc__));
6 struct edge_def
8 struct basic_block_def *dest;
9 int flags;
11 typedef struct edge_def *edge;
12 struct basic_block_def
14 int flags;
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)
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))
27 e->dest->flags |= 4;
28 *tos++ = e->dest;
30 return worklist;
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 "fre1" } } */
38 /* { dg-final { cleanup-tree-dump "fre1" } } */