From p.dalgaard@biostat.ku.dk  Sat Mar  6 00:43:30 1999
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 06 Mar 1999 01:43:30 +0100
Subject: Difficulties with egcs-1.0.3 on RedHat 5.2?
In-Reply-To: Peter Dalgaard BSA's message of 06 Mar 1999 01:26:58 +0100
References: <6rogm7h3xf.fsf@verdi.stat.wisc.edu> <x21zj3mpil.fsf@blueberry.kubism.ku.dk>
Message-ID: <x2zp5rla6l.fsf@blueberry.kubism.ku.dk>

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
usefulness...

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;
}

main(){qbeta(.5,.5,.5);}

[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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Difficulties with egcs-1.0.3 on RedHat 5.2?
Peter Dalgaard BSA