This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: m68k-ColdFire(m5200) code gen bug



  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


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