This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal compiler error 980715


egcs-1.1.2 i686-pc-linux-gnu
Internal compiler error 980715
g++ -g -O4 -ffast-math -I /usr/local/include/octave-2.1.13    TestQuad3.cc   -o TestQuad3
Quad.H: In function `double Integrate<double (*)(double)>(double (*)(double), double, double)':
TestQuad3.cc:8:   instantiated from here
Quad.H:34: Internal compiler error 980715.
Quad.H:34: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.

---------------- Quad.H
#ifndef Quad_H
#define Quad_H

template<class FNC>
static int user_function (const double& x, int& ierr, double* result) {
  *result = FNC (x);
}

template<class FNC>
double Integrate (FNC F, double lower_limit, double upper_limit) {
  const int npts = 2;
  double* points = 0;
  double result = 0.0;

  const int leniw = 183 * npts - 122;
  int piwork [leniw];

  const int lenw = 2 * leniw - npts;
  double pwork [lenw];

  int last;
  double abs_tol = 0;
  double rel_tol = 0.1;

  //  double lower_limit = 0;
  //  double upper_limit = 1;

  double abserr;
  int ier, neval;

  dqagp_ (user_function<F>, lower_limit, upper_limit,
		  npts, points, abs_tol, rel_tol, result,
		  abserr, neval, ier, leniw, lenw, last,
		  piwork, pwork);

  return result;
}

#endif

------------------- TestQuad3.cc
#include "Quad.H"

double f (double x) {
  return x;
}

main () {
  Integrate (f, 0, 1);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]