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

            Bug ID: 65240
           Summary: [5 Regression] ICE (insn does not satisfy its
                    constraints) on powerpc64le-linux-gnu
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org

trunk r221042

$ g++ -c -g -O3 -ffast-math modules_mod.ii 
modules_mod.ii: In member function 'uint32_t D::m_fn3()':
modules_mod.ii:69:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 279 463 432 2 (set (reg:DF 98 21 [360])
        (mem/u/c:DF (lo_sum:DI (reg:DI 10 10)
                (unspec:DI [
                        (symbol_ref/u:DI ("*.LC7") [flags 0x82])
                        (reg:DI 2 2)
                    ] UNSPEC_TOCREL)) [1  S8 A64])) modules_mod.ii:64 499
{*movdf_hardfloat64}
     (expr_list:REG_EQUIV (const_double:DF -5.0e-1 [-0x0.8p+0])
        (nil)))
modules_mod.ii:69:1: internal compiler error: in extract_constrain_insn, at
recog.c:2246
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.

$ cat modules_mod.ii
typedef int uint32_t;
extern "C" double atan(double);
template <typename T, typename U> T lerp(T p1, T p2, U p3) {
  return p1 + (p2 - p1) * p3;
}

template <class> class audio_module {
public:
  float *ins[];
};

struct A {
  double w1;
  double w2;
  double process___trans_tmp_7;
  double process___trans_tmp_6;
  void m_fn1(double p1) {
    double &a = w1;
    if (process___trans_tmp_6 < process___trans_tmp_7)
      a = 0.0;
    double b = p1 - w1 - w2;
    w1 = b;
  }
};
class B {
public:
  float &operator[](int) {}
};
struct C {
  B data;
  int get_interp_1616_ppos;
  int get_interp_1616_pppos;
  float m_fn2(int p1) {
    float c(p1);
    return lerp(data[get_interp_1616_ppos], data[get_interp_1616_pppos], c);
  }
};
struct rotary_speaker_metadata;
class D : audio_module<rotary_speaker_metadata> {
  uint32_t phase_l, phase_h, dphase_h;
  C delay;
  A crossover1r, crossover2l, damper1l, damper1r;
  uint32_t m_fn3();
};
double d, e, f, g, h;
int j;
float k;
uint32_t D::m_fn3() {
  int l;
  for (int i;; i++) {
    double m = atan(ins[1][i]);
    int n = phase_l, o(phase_h), p = l;
    double v = n / 32768.0;
    j = 8 + phase_l / 32768.0;
    l = 8 + 8 * v - 0.3849;
    float q = delay.m_fn2(o) - g * k * delay.m_fn2(o),
          r = g * delay.m_fn2(o) + k * delay.m_fn2(p);
    damper1l.m_fn1(q);
    f = lerp(0.5, phase_h / 65536.0, h);
    float s = f;
    damper1r.m_fn1(r);
    e = lerp(0.5, j / 65536.0, h);
    d = m * e;
    float t = d;
    crossover2l.m_fn1(s);
    crossover1r.m_fn1(t);
    phase_l = phase_h = dphase_h;
  }
}

Reply via email to