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]

bug in egcs-1.0.2, g++


Hi,

I am writing this to report a bug in g++ in egcs-1.0.2.  I have attached
the code which is causing the bug to this e-mail as a plain text file. 
The file is entitled CDynSystem.cpp.  I am running egcs on a Linux box
with two Pentium Pros.  The distribution is debian - I believe it is
up-to-date. Here is a transcript of the bug: 

> uname -a
Linux compton 2.0.30 #18 Tue Jun 3 12:18:43 CDT 1997 i686 unknown

> g++ -v
Reading specs from
/opt/pkgs/egcs-1.0.2/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)

> g++ -O2 -c CDynSystem.cpp 
CDynSystem.cpp: In method `void CDynSystem::rkqs()':
CDynSystem.cpp:40: Internal compiler error.
CDynSystem.cpp:40: Please submit a full bug report to `egcs-bugs@cygnus.com'.


I don't get this error if I compile with the -O option or with no
optimization options.  I also don't get the error if I compile with
egcs-1.0.3a on the same machine (even with the -O2 option).  I also
don't get the error if I compile with egcs-1.0.1 on a different, but
similarly constructed, Linux box.

The code was written as an attempt to put one of the numerical
differential equation solvers from Numerical Recipes into a C++ class.

Thanks for your help.

Jordan Koss

P.S.  Thanks for including g77 in your distributions!

--
j-koss@uchicago.edu

// CDynSystem.cpp - the member functions for the CDynSystem Class

#include <math.h>

void nrerror(char error_text[]);

inline double nrdmax(const double a, const double b) {
    return ((a > b) ? a : b);
}

class CDynSystem {
public:
    void rkqs(void);
    void rkck(void);
};

void CDynSystem::rkqs(void)
{
    double errmax = 0.0;
    double h = 1.0;
    double htemp;

    for (;;) {
        rkck();

        errmax = nrdmax(errmax,h);

        if (errmax <= 1.0) 
            break;

        htemp = pow(errmax,h);
        h = (h >= 0.0 ? 0.1*h : 0.01*h);
        
        if (htemp == h) 
            nrerror("stepsize underflow in rkqs");
    }

    if (errmax > h) 
        h = pow(errmax,h);
}

void CDynSystem::rkck(void) {}



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