egcs-1.0.3: mc68k/mcf5200 codegen bug when optimizing
Franz Sirl
Franz.Sirl-kernel@lauterbach.com
Thu Jul 2 04:03:00 GMT 1998
At 07:45 02.07.98 , Jeffrey A Law wrote:
>
> In message <199807011408.HAA29441@cygnus.com>you write:
> > This little patch helps for the snapshots, I think it should also
apply to
> > 1.0.3. Probably some of the other lines below should be modified too.
>Yes, I believe you need to fix the other and.w 0xff references which
>follow the one you fixed in that pattern.
>
>There were some other patterns which had and.w instructions, but they
>were guarded by !TARGET_5200 or TARGET_68040.
>
>
>So I think you just need to fix all the occurences in that one pattern.
Ok, here it is. On the ColdFire "clr%.w %0;move%.b %1,%0" would be better,
but I don't know what cases reg_mentioned_p tries to cover, so I took the
safe approach (instead of !TARGET_5200 && reg_mentioned_p).
Franz.
Index: m68k.md
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/m68k/m68k.md,v
retrieving revision 1.16
diff -u -r1.16 m68k.md
--- m68k.md 1998/05/23 23:14:57 1.16
+++ m68k.md 1998/07/02 10:45:21
@@ -1584,9 +1584,10 @@
{
if (GET_CODE (operands[1]) == REG
&& REGNO (operands[0]) == REGNO (operands[1]))
- return \"and%.w %#0xFF,%0\";
+ return (!TARGET_5200 ? \"and%.w %#0xFF,%0\" : \"and%.l %#0xFF,%0\");
if (reg_mentioned_p (operands[0], operands[1]))
- return \"move%.b %1,%0\;and%.w %#0xFF,%0\";
+ return (!TARGET_5200 ? \"move%.b %1,%0\;and%.w %#0xFF,%0\"
+ : \"move%.b %1,%0\;and%.l %#0xFF,%0\");
return \"clr%.w %0\;move%.b %1,%0\";
}
else if (GET_CODE (operands[0]) == MEM
More information about the Gcc-bugs
mailing list