Xref: utzoo comp.compilers:1150 comp.unix.aix:1636 Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!rpi!zaphod.mps.ohio-state.edu!ncar!ico!haddock!ima!esegue!compilers-sender From: banshee@ucscb.ucsc.edu (Wailin' Through The Nets) Newsgroups: comp.compilers,comp.unix.aix Subject: RS/6000 Optimizer breaks code -- suggestions? Keywords: C, RS6000 Message-ID: <6131@darkstar.ucsc.edu> Date: 18 Aug 90 05:41:50 GMT Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: banshee@ucscb.ucsc.edu (Wailin' Through The Nets) Followup-To: comp.unix.aix Distribution: usa Organization: University of California, Santa Cruz; Open Access Computing Lines: 38 Approved: compilers@esegue.segue.boston.ma.us 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;ilen;i++) { carry=0; for(j=0;jval[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.