Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/pr68619-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -w" } */
3 typedef unsigned int hashval_t;
4 enum ETYPE
5 {
6 ETYPE_ARRAY, ETYPE_STRUCT, ETYPE_UNION,
7 };
8 struct entry
9 {
10 enum ETYPE etype:8;
11 unsigned short len;
12 const char *attrib;
13 };
14 hashval_t iterative_hash (const struct entry *, __SIZE_TYPE__, hashval_t);
15 hashval_t
16 e_hash (const void *a)
17 {
18 const struct entry *e = a;
19 hashval_t ret = 0;
20 int i;
21 if (e[0].etype != ETYPE_STRUCT && e[0].etype != ETYPE_UNION)
22 __builtin_abort ();
23 for (i = 0; i <= e[0].len; ++i)
24 {
25 ret = iterative_hash (&e[i], __builtin_offsetof (struct entry, attrib), ret);
26 }
27 return ret;
28 }