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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr37573.c] - Blame information for rev 298

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

Line No. Rev Author Line
1 297 jeremybenn
/* PR tree-optimization/37573 */
2
 
3
struct S
4
{
5
  unsigned int *a;
6
  unsigned int b;
7
  unsigned int c[624];
8
};
9
 
10
static unsigned char __attribute__((noinline))
11
foo (struct S *s)
12
{
13
  unsigned int r;
14
  if (!--s->b)
15
    {
16
      unsigned int *c = s->c;
17
      unsigned int i;
18
      s->a = c;
19
      for (i = 0; i < 227; i++)
20
        c[i] = ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1)
21
            ^ ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i + 397];
22
    }
23
  r = *(s->a++);
24
  r ^= (r >> 11);
25
  r ^= ((r & 0xff3a58ad) << 7);
26
  r ^= ((r & 0xffffdf8c) << 15);
27
  r ^= (r >> 18);
28
  return (unsigned char) (r >> 1);
29
}
30
 
31
static void __attribute__((noinline))
32
bar (unsigned char *p, unsigned int q, unsigned int r)
33
{
34
  struct S s;
35
  unsigned int i;
36
  unsigned int *c = s.c;
37
  *c = r;
38
  for (i = 1; i < 624; i++)
39
    c[i] = i + 0x6c078965 * ((c[i - 1] >> 30) ^ c[i - 1]);
40
  s.b = 1;
41
  while (q--)
42
    *p++ ^= foo (&s);
43
};
44
 
45
static unsigned char p[23] = {
46
  0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49,
47
  0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38
48
};
49
 
50
static unsigned char q[23] = {
51
  0x3e, 0x41, 0x55, 0x54, 0x4f, 0x49, 0x54, 0x20, 0x55, 0x4e, 0x49, 0x43,
52
  0x4f, 0x44, 0x45, 0x20, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x3c
53
};
54
 
55
int
56
main (void)
57
{
58
  unsigned int s;
59
  s = 23;
60
  bar (p, s, s + 0xa25e);
61
  if (__builtin_memcmp (p, q, s) != 0)
62
    __builtin_abort ();
63
  return 0;
64
}
65
 

powered by: WebSVN 2.1.0

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