This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FW: Bug in the vxWorks cross compiler


On Fri, 2004-11-26 at 12:33, Lennert Buytenhek wrote:
> On Wed, Nov 17, 2004 at 03:03:14PM -0500, Thompson, David H. wrote:
> 
> > In the compiler shipped with the vxWorks 5.5.1 we have found a bug when
> > -O2 is used.  The compiler version is 2.9.6+, the error happens on both
> > the Solaris host and on a Linux host.  The target is PPC.  Has anyone
> > seen this in other versions of the compiler or know what the fix is?
> > 
> > #include <stdio.h>
> > 
> > 
> > int test(int argc,char * argv[])
> > {
> > 
> >     double stack[]={0.0,1.0};
> >     double * pStack=&stack[0];
> >     double response;
> > 
> >     response=(*pStack==*(pStack+1));
> >     printf("Response=%f\n",response);
> >     return 0;
> > }
> > 
> > Response gets set to 1 instead of the expected 0.
> 
> Just a data point, works fine here on gcc 3.4.2.

It also works for me with the Tornado 2.2.1 ppc compiler (Solaris):

-> ld<test.o
value = 268413440 = 0xfffaa00 = test + 0x530
-> test
Response=0.000000
value = 0 = 0x0

I tried it on both a ppc603 and ppc604 system. The compile flags were:
	ccppc -O2 -c -mcpu=ppc604 -mlongcall -fno-builtin -fno-for-scope
-fstrength-reduce -D_GNU_TOOL -DCPU=PPC604 test.c
and
	ccppc -O2 -c -mcpu=ppc603 -mno-sdata -fno-builtin -fno-for-scope
-fstrength-reduce -D_GNU_TOOL -DCPU=PPC603 test.c

The compiler version is:

% ccppc -v
Reading specs from
/usr/Tornado2.2/host/sun4-solaris2/bin/../lib/gcc-lib/powerpc-wrs-vxworks/gcc-2.96/specs
gcc version gcc-2.96 (2.96+) 19990621 AltiVec VxWorks 5.5
65115 79101 83322 83686 84218 85823 85973 86999 87279 87638 88306 88708
88966 90104 90120 90296 90648 90662

	-Bill


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]