Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / pr37101.c
blob8fd3bfc5f85e682498a1ef1e2f2a0e3caf02e5ec
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;
11 unsigned int id;
12 } ResourceRec, *ResourcePtr;
14 typedef struct _ClientResource
16 ResourcePtr *resources;
17 int elements;
18 int buckets;
19 int hashsize;
20 } ClientResourceRec;
22 static ClientResourceRec clientTable[256];
24 void
25 RebuildTable (int client)
27 int j;
28 ResourcePtr res, next;
29 ResourcePtr **tails, *resources;
30 ResourcePtr **tptr, *rptr;
32 j = 2 * clientTable[client].buckets;
34 tails =
35 (ResourcePtr **) malloc ((unsigned long) (j * sizeof (ResourcePtr *)));
36 resources =
37 (ResourcePtr *) malloc ((unsigned long) (j * sizeof (ResourcePtr)));
39 for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++)
41 *rptr = ((ResourcePtr) ((void *) 0));
42 *tptr = rptr;
45 clientTable[client].hashsize++;
46 for (j = clientTable[client].buckets,
47 rptr = clientTable[client].resources; --j >= 0; rptr++)
49 for (res = *rptr; res; res = next)
51 next = res->next;
52 res->next = ((ResourcePtr) ((void *) 0));
53 tptr = &tails[Hash (client, res->id)];
54 **tptr = res;
55 *tptr = &res->next;
58 free ((void *) tails);
59 clientTable[client].buckets *= 2;
60 free ((void *) clientTable[client].resources);
61 clientTable[client].resources = resources;
64 /* { dg-final { scan-assembler-not "movlps" } } */