Bug 5714

Summary: [ColdFire] Invalid use of dbra
Product: gcc Reporter: carlos
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: critical CC: gcc-bugs
Priority: P2 Keywords: wrong-code
Version: 2.95.3   
Target Milestone: ---   
Host: Target: m68k-elf
Build: Known to work:
Known to fail: Last reconfirmed:
Attachments: fbcon-cfb16.i

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.

Release:
2.95.3

Environment:
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
Fix:
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
Hello,

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,

Dara
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.