TR : Possible GCC bug on m68k

Etienne Fortin etienne.fortin at sensio.tv
Tue Nov 2 22:03:46 UTC 2004


Yes, it seems to match what I'm getting.


-----Message d'origine-----
De : Joel Sherrill <joel at OARcorp.com> [mailto:joel.sherrill at OARcorp.com]

Envoyé : 2 novembre, 2004 17:01
À : Etienne Fortin
Cc : rtems-users at rtems.com
Objet : Re: RE : RE : 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




More information about the users mailing list