https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103007

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Reduced C++ code seems to be:

template <int D> class MushMeshVector {
public:
  MushMeshVector(float, float, float, float);
  float Z() {
    float __trans_tmp_3;
    int inIndex = 2;
    __trans_tmp_3 = m_value[inIndex];
    return __trans_tmp_3;
  }
  float W() {
    float __trans_tmp_4;
    int inIndex = 3;
    __trans_tmp_4 = m_value[inIndex];
    return __trans_tmp_4;
  }
  void ZSet(float inValue) {
    int inIndex = 2;
    m_value[inIndex] = inValue;
  }
  void WSet(float inValue) {
    int inIndex = 3;
    m_value[inIndex] = inValue;
  }
  float m_value[D];
};
template <class> class MushMeshQuaternion : MushMeshVector<4> {
public:
  void PreMultiplyVector(MushMeshVector &) const;
  void PostMultiplyVector(MushMeshVector &) const;
};
template <class T>
void MushMeshQuaternion<T>::PreMultiplyVector(MushMeshVector &ioVec) const {
  ioVec.ZSet(2 - m_value[1] + m_value[3] * 0);
  ioVec.WSet(m_value[3] + m_value[1] - m_value[2] * 0);
}
template <class T>
void MushMeshQuaternion<T>::PostMultiplyVector(MushMeshVector &ioVec) const {
  T c = ioVec.Z(), d = ioVec.W();
  ioVec.ZSet(0 - d * m_value[1]);
  ioVec.WSet(2 - c * m_value[1]);
}
template <class> class MushMeshQuaternionPair {
public:
  void VectorRotate(MushMeshVector<4> &) const;
  MushMeshQuaternion<float> m_first;
  MushMeshQuaternion<float> m_second;
};
template <class T>
void MushMeshQuaternionPair<T>::VectorRotate(MushMeshVector<4> &ioVec) const {
  m_first.PreMultiplyVector(ioVec);
  m_second.PostMultiplyVector(ioVec);
}
class MushMeshPosticity {
public:
  MushMeshQuaternionPair<float> AngPos();
};
class MushGamePiece {
public:
  MushMeshPosticity Post();
  void PostWRef();
};
class AdanaxisPieceProjectile : MushGamePiece {
  void Move();
  float m_acceleration;
};
void AdanaxisPieceProjectile::Move() {
  MushMeshVector<4> accVec(0, 0, 0, m_acceleration);
  Post().AngPos().VectorRotate(accVec);
  PostWRef();
}

Reply via email to