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

             Bug #: 13145
           Summary: movem zero offset not removed on ColdFire
           Product: binutils
           Version: 2.22 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassig...@sources.redhat.com
        ReportedBy: vincent.rivi...@freesbee.fr
    Classification: Unclassified
            Target: m68k-elf


Usually, gas transparently transforms a "register indirect with offset" operand
to a simple "register indirect" when the offset is zero. But this does not
happen with movem on ColdFire.

$ cat bug.s
        move.l  (%a0),%d0
        move.l  0(%a0),%d0

        movem.l (%a0),%d0
        movem.l 0(%a0),%d0

$ as bug.s -o bug.o -m68000
$ objdump -d bug.o
...
   0:   2010            movel %a0@,%d0
   2:   2010            movel %a0@,%d0
   4:   4cd0 0001       moveml %a0@,%d0
   8:   4cd0 0001       moveml %a0@,%d0

We can see that on 68000 a zero offset is ignored, with both move and movem.
Now, to the same for ColdFire:

$ as bug.s -o bug.o -mcpu=5475
$ objdump -d bug.o
...
   0:   2010            movel %a0@,%d0
   2:   2010            movel %a0@,%d0
   4:   4cd0 0001       moveml %a0@,%d0
   8:   4ce8 0001 0000  moveml %a0@(0),%d0

We can see that on ColdFire the zero offset is ignored with move, but is kept
unoptimized on ColdFire. This behavior is inconsistent. movem should be fixed
and behave on ColdFire as it works on 68000.

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

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to