OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr34176.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
 
2
typedef __SIZE_TYPE__ size_t;
3
typedef unsigned int index_ty;
4
typedef index_ty *index_list_ty;
5
 
6
struct mult_index
7
{
8
  index_ty index;
9
  unsigned int count;
10
};
11
 
12
struct mult_index_list
13
{
14
  struct mult_index *item;
15
  size_t nitems;
16
  size_t nitems_max;
17
 
18
  struct mult_index *item2;
19
  size_t nitems2_max;
20
};
21
 
22
int __attribute__((noinline))
23
hash_find_entry (size_t *result)
24
{
25
    *result = 2;
26
    return 0;
27
}
28
 
29
extern void abort (void);
30
struct mult_index * __attribute__((noinline))
31
foo (size_t n)
32
{
33
  static count = 0;
34
  if (count++ > 0)
35
    abort ();
36
  return 0;
37
}
38
 
39
int
40
main (void)
41
{
42
    size_t nitems = 0;
43
 
44
    for (;;)
45
    {
46
        size_t list;
47
 
48
        hash_find_entry (&list);
49
        {
50
            size_t len2 = list;
51
            struct mult_index *destptr;
52
            struct mult_index *dest;
53
            size_t new_max  = nitems + len2;
54
 
55
            if (new_max != len2)
56
                break;
57
            dest = foo (new_max);
58
 
59
            destptr = dest;
60
            while (len2--)
61
                destptr++;
62
 
63
            nitems = destptr - dest;
64
        }
65
    }
66
 
67
    return 0;
68
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.