RS/6000 Optimizer breaks code -- suggestions?

banshee@ucscb.ucsc.edu (Wailin' Through The Nets)
Sat, 18 Aug 90 05:41:50 GMT

          From comp.compilers

Related articles
RS/6000 Optimizer breaks code -- suggestions? banshee@ucscb.ucsc.edu (1990-08-18)
RS/6000 Optimizer breaks code -- suggestions? jar@florida.eng.ileaf.com (1990-08-21)
Re: RS/6000 Optimizer breaks code -- suggestions? worley@compass.com (1990-08-24)
Re: RS/6000 Optimizer breaks code -- suggestions? daveg@near.cs.caltech.edu (1990-08-25)
Re: RS/6000 Optimizer breaks code -- suggestions? johnv@metaware.uucp (1990-08-27)
Re: RS/6000 Optimizer breaks code -- suggestions? johnv@metaware.com (1990-08-27)
Re: RS/6000 Optimizer breaks code -- suggestions? worley@compass.com (1990-08-29)
| List of all articles for this month |

Newsgroups: comp.compilers,comp.unix.aix
From: banshee@ucscb.ucsc.edu (Wailin' Through The Nets)
Followup-To: comp.unix.aix
Keywords: C, RS6000
Organization: University of California, Santa Cruz; Open Access Computing
Distribution: usa
Date: Sat, 18 Aug 90 05:41:50 GMT

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]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.