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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O -finline-functions -finline-small-functions -Wuninitialized" }  */
3
 
4
 
5
struct SQObjectPtr
6
{
7
  int _type;
8
  SQObjectPtr operator = (long);
9
};
10
struct SQObjectPtrVec
11
{
12
  SQObjectPtr fff (unsigned);
13
  SQObjectPtr *_vals;
14
};
15
 
16
struct SQInstruction
17
{
18
  int _arg1;
19
  unsigned op;
20
  unsigned _arg0;
21
  unsigned _arg2;
22
};
23
struct SQVM
24
{
25
  struct CallInfo
26
  {
27
    SQInstruction *_ip;
28
  };
29
    bool
30
    Execute (SQObjectPtr &, long, long, long, SQObjectPtr &, unsigned, int);
31
    bool
32
    FOREACH_OP
33
    (SQObjectPtr
34
     &, SQObjectPtr &, SQObjectPtr &, SQObjectPtr &, long, int, int &);
35
  SQObjectPtrVec _stack;
36
  CallInfo *ci;
37
  long _nnativecalls;
38
  bool ShouldSuspend ();
39
};
40
struct AutoDec
41
{
42
  AutoDec (long *);
43
   ~AutoDec ();
44
};
45
bool
46
  SQVM::FOREACH_OP
47
  (SQObjectPtr
48
   &
49
   o1,
50
   SQObjectPtr & o2, SQObjectPtr &, SQObjectPtr & o4, long, int, int &jump)
51
{
52
  long
53
    nrefidx = 0;
54
  switch (o1._type)
55
    {
56
    case 0x02000000:
57
      o4 = nrefidx;
58
      jump = 1;
59
      return true;
60
    case 0x00000080:
61
      {
62
        long
63
          idx = 10;
64
        o2 = idx;
65
        jump = 0;
66
      }
67
    }
68
}
69
 
70
bool
71
  SQVM::Execute
72
  (SQObjectPtr &, long, long, long, SQObjectPtr &, unsigned, int)
73
{
74
  AutoDec
75
  ad (&_nnativecalls);
76
  for (;;)
77
    {
78
      if (ShouldSuspend ())
79
        return true;
80
      SQInstruction
81
        _i_ = *ci->_ip;
82
      switch (_i_.op)
83
        {
84
        case 0:
85
          {
86
            int
87
              tojump;
88
 
89
            FOREACH_OP
90
              (_stack._vals
91
               [_i_._arg0],
92
               _stack._vals
93
               [_i_._arg2],
94
               _stack._vals
95
               [_i_._arg2],
96
               _stack._vals[_i_._arg2], _i_._arg2, _i_._arg1, tojump);
97
 
98
            ci += tojump;  /* { dg-warning "uninitialized" "warning" }  */
99
          }
100
        case 1:
101
          _stack.fff (_i_._arg1);
102
        }
103
    }
104
 
105
}

powered by: WebSVN 2.1.0

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