view gcc/testsuite/g++.dg/torture/pr70499.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do compile }
// { dg-additional-options "-w -Wno-psabi" }
// { dg-additional-options "-mavx" { target x86_64-*-* i?86-*-* } }

typedef double __m256d __attribute__ ((__vector_size__ (32), __may_alias__));

struct SIMD {
  __m256d data;
  SIMD() {};
  SIMD (double val) { }
  SIMD(__m256d _data) { data = _data; }
  SIMD operator* (SIMD a) { return a; }
};

struct Foo {
  SIMD val;
  SIMD dval[2];
  __attribute__((__always_inline__)) SIMD & Value() throw() { return val; }
  __attribute__((__always_inline__)) Foo operator* ( const Foo & y) throw() 
    {
      Foo res;
      SIMD hx;
      SIMD hy;
      res.Value() = hx*hy;
      res.dval[0] = hx*hy;
      return res;
    }
};

template<typename Tx>  
__attribute__((__always_inline__)) inline void inlineFunc(Tx hx[]) {
    Tx x = hx[0], y = hx[1];
    Tx lam[1] = {(x*y)};
}

void FooBarFunc () {
  Foo adp[2];
  inlineFunc (adp);
}