banshee@ucscb.ucsc.edu (Wailin' Through The Nets) (08/18/90)
This fragment of code breaks when the following function is inlined and the code is compiled with -O on a RS/6000. Question, why? Note that without -O everything works fine, even with the function inlined. But -O kills it. tradd(b) union g {long xx; struct half yy;} *b; { b->yy.high &= 077777; /* WHY CAN'T I INLINE THIS? */ } m_mult(a,b,c) struct mint *a,*b,*c; { long x; union {long xx; struct half yy;} sum; int carry; int i,j; c->val=xalloc(a->len+b->len,"m_mult"); sum.xx=0; for(i=0;i<b->len;i++) { carry=0; for(j=0;j<i+1;j++) { sum.xx += (a->val[j])*(b->val[i-j]); if (sum.yy.high & 0100000) { tradd(&sum); /* sum.yy.high &= 077777; */ carry += 1; } c->val[i]=sum.yy.low & 077777; sum.xx=sum.xx >> 15; sum.yy.high=carry; etc etc etc [Sounds to me like an optimizer bug. Have you reported it to IBM? -John] -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.