bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/14193] New: mov3q.l followed by movem.l generates illegal instr


From: timo.nawratil at web dot de
Subject: [Bug gas/14193] New: mov3q.l followed by movem.l generates illegal instruction on Coldfire 5480 (or -march=cfv4e)
Date: Fri, 01 Jun 2012 16:29:09 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14193

             Bug #: 14193
           Summary: mov3q.l followed by movem.l generates illegal
                    instruction on Coldfire 5480 (or -march=cfv4e)
           Product: binutils
           Version: 2.22
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


Known to work: binutils-2.21.1
Known to fail: binutils-2.22
Unknown for  : HEAD

An illegal instruction is generated for movem.l if there is a mov3q.l
instruction preceding it. This even happens if there are other instructions
between the mov3q.l and the movem.l.

I had this happen to me for assembly code generated by gcc-4.6.3 and managed to
reduce the problem to this:

$ cat myprg_02.asm

#NO_APP
        .file   "myPrg_02.c"
        .text
        .align  2
        .globl  myprg_02__impl__
        .type   myprg_02__impl__, @function
myprg_02__impl__:

        mov3q.l #2,-(%sp)
        movem.l -16(%fp),#60

        .size   myprg_02__impl__, .-myprg_02__impl__
        .ident  "GCC: (GNU) 4.6.3"

Using binutils-2.22, an illegal instruction code is generated for the movem.l:

$ m68k-elf-as -mcpu=5480 --verbose -o myprg_02.o myprg_02.asm
GNU assembler version 2.22 (m68k-elf) using BFD version (GNU Binutils) 2.22
$ m68k-elf-objdump -d myprg_02.o

myprg_02.o:     file format elf32-m68k


Disassembly of section .text:

00000000 <myprg_02__impl__>:
   0:   a567            mov3ql #2,address@hidden
   2:   4cfe            .short 0x4cfe
   4:   003c            .short 0x003c
   6:   fff0            .short 0xfff0

According to the "Coldfire Family Programmer's Reference Manual", 
the sequence 4cfe is not a valid Coldfire instruction (and as far as I can
tell, it is not a valid instruction on a "classic" 68000 either).

Using binutils-2.21.1, I can see that correct code is generated, with a valid
Mode/Register  pair that matches the original assembly code:

$ m68k-elf-as -mcpu=5480 --verbose -o myprg_02.o myprg_02.asm
GNU assembler version 2.21.1 (m68k-elf) using BFD version (GNU Binutils) 2.21.1
$ m68k-elf-objdump -d myprg_02.o

myprg_02.o:     file format elf32-m68k


Disassembly of section .text:

00000000 <myprg_02__impl__>:
   0:   a567            mov3ql #2,address@hidden
   2:   4cee 003c fff0  moveml %fp@(-16),%d2-%d5

This output is correct. 

Note that correct code is generated if the mov3q.l is removed from the .asm
file, so it seems to be tied to the combination of instructions. 

Also, the same result occurs if I use -march=cfv4e instead of -mcpu=5480, so
this bug will not only affect the CF5480, but all cfv4e CPUs.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]