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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr37716.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR tree-optimization/37716
2
// { dg-do compile }
3
 
4
struct A
5
{
6
  struct B
7
  {
8
    int a, b, c, d;
9
    void *e[1];
10
  };
11
  B *d;
12
  inline void **f1 (int i) const
13
  {
14
    return d->e + d->c + i;
15
  }
16
};
17
 
18
template 
19
struct C
20
{
21
  struct D
22
  {
23
    void *v;
24
    inline T & f3 ()
25
    {
26
      return *reinterpret_cast  (this);
27
    }
28
  };
29
  union
30
  {
31
    A p;
32
    A::B *d;
33
  };
34
  T & operator[](int i)
35
  {
36
    if (d->a != 1)
37
      f2 ();
38
    return reinterpret_cast  (p.f1 (i))->f3 ();
39
  }
40
  void f2 ();
41
  void f3 (int i, const T & t);
42
};
43
 
44
class E
45
{
46
  int e, f;
47
};
48
 
49
C  c;
50
 
51
void
52
foo (int x)
53
{
54
  E e = c[x];
55
  c.f3 (x, e);
56
}

powered by: WebSVN 2.1.0

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