Bug 5714 - [ColdFire] Invalid use of dbra
Summary: [ColdFire] Invalid use of dbra
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 2.95.3
: P2 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: wrong-code
Depends on:
Reported: 2002-02-17 09:26 UTC by carlos
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Target: m68k-elf
Known to work:
Known to fail:
Last reconfirmed:

fbcon-cfb16.i (54.71 KB, text/x-c)
2003-05-21 15:17 UTC, carlos

Note You need to log in before you can comment on or make changes to this bug.
Description carlos 2002-02-17 09:26:00 UTC
THe cross compiler generates invalid assembler code. It 
generates code for 68000 and not for coldfire on some cases.
I'm aware that probably you don't manage the coldfire port of
gcc but maybe.
This happens when you try to compile the uClinux kernel with
framebuffer support enabled. I don't know why but in these
files it generates a "dbra" instruction. which is not 
supported on ColdFire processors.


Linux SuSE 7.2, linux 2.2.20, binutils 020202, gcc-3.0.3, 
m68k-elf-gcc 2.95.3, m68k-binutils 2.10
Comment 1 carlos 2002-02-17 09:26:00 UTC
Edit the assembly code and fix it manually, 
then use as and run ld.
Comment 2 Dara Hazeghi 2003-05-25 04:03:07 UTC

gcc 2.95.3 is quite old. Would it be possible for you to check whether this problem still occurs with 
gcc 3.3? Alternatively, what are the options to create coldfire cross compiler? And what are the 
options which you pass to gcc which result in the invalid asm? Thanks,

Comment 3 Andrew Pinski 2003-06-04 19:41:12 UTC
From looking at the machine description, I see all the "dbra" are conditional under 
!TARGET_5200 (aka ColdFire) since the inital import of the description.  Did you pass the 
option -m5200 otherwise it will generate dbra?
Comment 4 Andrew Pinski 2003-07-29 19:24:51 UTC
The problem is that the sources contain the "dbra" instruction in inline asm so the code is 
invalid on ColdFire.