1 /* { dg-do compile } */
2 /* { dg-options "-O2 -msse2 -ftree-vectorize -march=nocona" } */
4 typedef __SIZE_TYPE__
size_t;
5 extern void *malloc (size_t);
6 extern void free (void *);
8 typedef struct _Resource
10 struct _Resource
*next
;
12 } ResourceRec
, *ResourcePtr
;
14 typedef struct _ClientResource
16 ResourcePtr
*resources
;
22 static ClientResourceRec clientTable
[256];
23 int Hash (int, unsigned int);
26 RebuildTable (int client
)
29 ResourcePtr res
, next
;
30 ResourcePtr
**tails
, *resources
;
31 ResourcePtr
**tptr
, *rptr
;
33 j
= 2 * clientTable
[client
].buckets
;
36 (ResourcePtr
**) malloc ((unsigned long) (j
* sizeof (ResourcePtr
*)));
38 (ResourcePtr
*) malloc ((unsigned long) (j
* sizeof (ResourcePtr
)));
40 for (rptr
= resources
, tptr
= tails
; --j
>= 0; rptr
++, tptr
++)
42 *rptr
= ((ResourcePtr
) ((void *) 0));
46 clientTable
[client
].hashsize
++;
47 for (j
= clientTable
[client
].buckets
,
48 rptr
= clientTable
[client
].resources
; --j
>= 0; rptr
++)
50 for (res
= *rptr
; res
; res
= next
)
53 res
->next
= ((ResourcePtr
) ((void *) 0));
54 tptr
= &tails
[Hash (client
, res
->id
)];
59 free ((void *) tails
);
60 clientTable
[client
].buckets
*= 2;
61 free ((void *) clientTable
[client
].resources
);
62 clientTable
[client
].resources
= resources
;
65 /* { dg-final { scan-assembler-not "movlps" } } */