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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the details are hidden in

template <int dim>
QGauss5<dim>::QGauss5 ()
                :
                Quadrature<dim> (QGauss5<dim-1>(), QGauss5<1>())
{}

with the following inlined

template <>
QGauss5<1>::QGauss5 ()
                :
                Quadrature<1> (5)
{
...
  for (unsigned int i=0; i<this->size(); ++i)
    {
      this->quadrature_points[i] = Point<1>(xpts[i]);
      this->weights[i] = wts[i];
    };
}

This latter can be reduced to the following, but it produces a masked
main loop while the actual benchmark uses a AVX main loop, we somehow
lose the actual number of iterations it seems.

#include <vector>
#include <cmath>

struct X {
    X ();
    std::vector<double> quadrature_points;
    std::vector<double> weights;
};

X::X ()
     : quadrature_points (5, 0), weights (5, 0)
{
  static const double xpts_normal[]
      = { -std::sqrt(1./9.*(5.+2*std::sqrt(10./7.))),
          -std::sqrt(1./9.*(5.-2*std::sqrt(10./7.))),
          0,
          +std::sqrt(1./9.*(5.-2*std::sqrt(10./7.))),
          +std::sqrt(1./9.*(5.+2*std::sqrt(10./7.)))  };
  static const double wts_normal[]
      = { 0.3*(+0.7+5.*std::sqrt(0.7))/(+2.+5.*std::sqrt(0.7)),
          0.3*(-0.7+5.*std::sqrt(0.7))/(-2.+5.*std::sqrt(0.7)),
          128./225.,
          0.3*(-0.7+5.*std::sqrt(0.7))/(-2.+5.*std::sqrt(0.7)),
          0.3*(+0.7+5.*std::sqrt(0.7))/(+2.+5.*std::sqrt(0.7)) };
  static const double xpts[] = { (xpts_normal[0]+1)/2.,
      (xpts_normal[1]+1)/2.,
      (xpts_normal[2]+1)/2.,
      (xpts_normal[3]+1)/2.,
      (xpts_normal[4]+1)/2. };
  static const double wts[]  = { wts_normal[0]/2.,
      wts_normal[1]/2.,
      wts_normal[2]/2.,
      wts_normal[3]/2.,
      wts_normal[4]/2. };

  for (unsigned int i=0; i< this->weights.size (); ++i)
    {
      this->quadrature_points[i] = xpts[i];
      this->weights[i] = wts[i];
    };
}

Reply via email to