RS/6000 Optimizer breaks code -- suggestions?
Wailin' Through The Nets
banshee at ucscb.ucsc.edu
Sat Aug 18 15:41:50 AEST 1990
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 at esegue.segue.boston.ma.us
{ima | spdcc | world}!esegue. Meta-mail to compilers-request at esegue.
More information about the Comp.unix.aix
mailing list