OSDN Git Service

2009-08-14 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / alias-10.c
1 /* For PR tree-optimization/14784  */
2
3 /* { dg-do compile } */
4 /* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */
5
6 typedef struct bitmap_element_def
7 {
8   unsigned int indx;
9 } bitmap_element;
10
11 typedef struct bitmap_head_def {
12     bitmap_element *first;
13     int using_obstack;
14 } bitmap_head;
15 typedef struct bitmap_head_def *bitmap;
16
17 bitmap_element *bitmap_free;
18
19 void foo (bitmap head, bitmap_element *elt)
20 {
21   while (1)
22     {
23       /* Alias analysis problems used to prevent us from recognizing
24          that this condition is invariant.  */
25       if (head->using_obstack)
26         bitmap_free = elt;
27     }
28 }
29
30
31 /* { dg-final { scan-tree-dump-times "Unswitching" 1 "unswitch"} } */
32 /* { dg-final { cleanup-tree-dump "unswitch" } } */