Difficulties with egcs-1.0.3 on RedHat 5.2?

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
06 Mar 1999 01:43:30 +0100

Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes

> If you *really* want me to, I can dig up the
> reference...

Aw, what the heck...

To: r-devel@stat.math.ethz.ch
Subject: EGCS optimizer bug?
From: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
Date: 25 Oct 1998 23:21:26 +0100
Message-ID: <x2r9vwl1uh.fsf@blueberry.kubism.ku.dk>
X-Mailer: Gnus v5.5/Emacs 20.2
Lines: 47
Xref: blueberry.kubism.ku.dk misc-mail:2857
X-Gnus-Article-Number: 2857   Sun Oct 25 23:21:34 1998

The current development version dies in qbeta() when compiled with
egcs -O, egcs 1.0.2 and glibc 2.0.7 (RedHat versions). Since this also
kill the F and t distributions, it doesn't exactly do wonders for R's

Anyone else seeing this or has my setup just gone out of whack? It
does look pretty much like a clear compiler bug when inlining math
functions (storing temporaries offset from %ebx, but no setting of
%ebx register to anything useful...)

The following paraphrase on R's qbeta.c appears to be a close to
minimal example of the problem (no, it doesn't do anything useful, and
there are several obvious things wrong with it, but it displays the
%ebx problem, if you look at the generated code):

#include <math.h>

double lbeta(){}

double qbeta(double alpha, double p, double q)
        double t,r, logbeta;
        volatile double xinbta;

        logbeta = lbeta(p, q);

        if (p<1) 
                t = r * pow(t, 3.);
        return xinbta;


[pd@butterfly sandbox]$ egcs -O qbeta.c -lm
[pd@butterfly sandbox]$ ./a.out
Segmentation fault (core dumped)
[pd@butterfly sandbox]$ egcs qbeta.c -lm
[pd@butterfly sandbox]$ ./a.out

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch