[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
TR : Possible GCC bug on m68k
- Date: Tue, 02 Nov 2004 16:01:19 -0600
- From: joel.sherrill at OARcorp.com (Joel Sherrill <joel at OARcorp dot com>)
- Subject: TR : Possible GCC bug on m68k
Etienne Fortin wrote:
> The one that comes with RTEMS-4.6.1.
>
That would have been a gcc 3.2 series. I now have an
example which is pretty simple:
typedef struct {
unsigned char number;
} pkt;
unsigned int f( int i );
int g( pkt *packet )
{
unsigned char comp;
packet->number = (unsigned char)f(1);
comp = (unsigned char)f(2);
if (packet->number != ~comp)
return 1;
return 0;
}
/* packet->number = 0 and comp = 0xFF. */
I tried it with the latest 4.6.2 tools and my current
gcc 3.3.5 tools for 4.7 and it shows the same disassembly
at both -02 and -O4.
/opt/rtems-4.7/bin/m68k-rtems4.7-gcc -S -O4 m68k1.c
/opt/rtems-4.6/bin/m68k-rtems-gcc -S -O2 m68k1.c
Does this example match what you think is happening?
--joel