This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

code generation bug in gcc-2.8.1 for m68k-coff/coldfire


Hello,

recently I came across a bug in gcc-2.8.1 for m68k-coff
The machine description has the problem of generating 
an AND.W #imm,%Dn for coldfire, which is not supported by Coldfire.
The fix should be to replace the AND.W with an AND.L, but I do
not have the experience to fully understand the syntax of the
machine description (pointers to documentation will be 
appreciated).

how to generate the bug:
1. cd /tmp
2. tar -xzf error.tar.gz
3. do something in the way of:
rfie@pontifex:/home/rfie > m68k-coff-gcc -m5200 -c -O3 -Wall -I. flash.c
-o gcc-bug.o
flash.c: In function `Flasherase':
flash.c:126: warning: implicit declaration of function `di'
flash.c:146: warning: implicit declaration of function `eni'
/tmp/cca22577.s: Assembler messages:
/tmp/cca22577.s:94: Error: invalid instruction for this architecture;
needs 68000 or higher -- statement `and.w #0xFF,%d1' ignored
rfie@pontifex:/home/rfie > m68k-coff-gcc --version
2.8.1
rfie@pontifex:/home/rfie > m68k-coff-as --version
GNU assembler 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `m68k-coff'.
4. help me

I did show the version of the assembler above, but I am quite certain that 
the assembler is behaving properly - 2.8.1 shows the same behaviour and
more importantly the Motorola Spec says no arith./log. word operations
on Coldfires.

BTW: there is an easy fix in the C source to make the bug disapear,
     simply change the type of the variable mandev to unsigned long
     and the appropriate AND.L is generated

I am not sure whether this mailing list is the proper place to
mail this bug-report to, but I am sure people here will know where 
it needs to be sent - I did not crosspost anywhere else.
I think Cygnus does some development for Coldfire...

kind regards,
rolf

+-----------------+-----------------------------------------+
|    _____        |  Rolf Fiedler                           |
|   / ___/        |  Electronic Design Engineer             |
|  / _/           |  Ferrari electronic GmbH                |
| /_/e/r/r/a/r/i/ |  phone: +49 3328 4559 0                 |
|   electronic    |  E-Mail: Rolf.Fiedler@Ferrari.DE        |
|                 |  fax  : +49 3328 4559 60                |
+-----------------+-----------------------------------------+
           "Where do you want to go tomorrow?"

error.tar.gz