This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: m68k-ColdFire(m5200) code gen bug
- To: "David Fiddes" <D dot J dot Fiddes at hw dot ac dot uk>
- Subject: Re: m68k-ColdFire(m5200) code gen bug
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 17 Aug 1998 00:25:38 -0600
- cc: egcs-bugs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <003901bd46b2$4fecbd80$4216c389@sandray.ma.hw.ac.uk>you write:
> Hi,
>
> I've roughly isolated the following bit of code which generates invalid
> assembler when compiled for Motorola ColdFire and any optimisation level.
>
> short int MyFunc(char index1)
> {
> unsigned char AnArray[2];
> short int param;
>
> param = (AnArray[index1] << 4) | (AnArray[index1]);
> return(param);
> }
>
> is compiled with "m68k-coff-gcc -S -m5200 -O2 test.c" to:
>
> MyFunc:
> link.w %a6,#-4
> move.b 11(%a6),%d0
> extb.l %d0
> move.b -2(%a6,%d0.l),%d0
> and.w #0xFF,%d0 <--- invalid on ColdFire architecture
> move.l %d0,%d1
> lsl.l #4,%d1
> or.l %d1,%d0
> and.l #4095,%d0
> unlk %a6
> rts
>
> This was build using --target=m68k-coff compiler built from the EGCS source
> obtained via CVS on Monday morning(2/3/98) running under cygwin32 beta 19.
This has been fixed for the upcoming egcs-1.1 release.
jeff