m68k-rtems-binutils-2.11-3.i386.rpm

John S. Gwynne jsg at jsgpc.mrcday.com
Sat Jun 2 04:32:07 UTC 2001


A few days ago I posted of a possible optimization bug for the m68332
target in m68k-rtems-gcc-gcc2.95.2newlib1.9.0-2.i386.rpm. After further
testing, it now appears the problem resides in binutils-2.11-3. 

binutils-2.11-3 is erroneously compiling m68k code, and the problem
seems to be aggravated by compiling without optimization. A sample code 
segment is included below.

Using binutils-2.10-2 with gcc-gcc2.95.2newlib1.9.0-2 seems to be a
stable configuration. 2.11-3 wo/optimization failed 14 programs from
the tests directory while 2.10-2 passed all. Similarly, with '-O4'
optimization, 2.10-2 passed all the test without any of the problems
encountered with 2.11-3.

john gwynne


/
/ sample assembly code
/
        clr.l -32(%a6)
        move.l -32(%a6),%d0
        moveq.l #-1,%d1
        cmp.l %d0,%d1
        jbeq .L137                                <<== note
        move.l -36(%a6),%d1
        move.l -32(%a6),%d0
        cmp.l %d1,%d0
        jbeq .L137                                <<== note
        move.l -32(%a6),-(%sp)
        move.l -36(%a6),-(%sp)
        pea .LC0
        jsr printf
        move.l _impure_ptr,%a0
        move.l 8(%a0),-(%sp)
        jsr fflush
        pea 1.w
        jsr exit
.LBE11:
.L137:


/
/ compiled code... note error
/
 278:   42ae ffe0       clrl %fp@(-32)
 27c:   202e ffe0       movel %fp@(-32),%d0
 280:   72ff            moveq #-1,%d1
 282:   b280            cmpl %d0,%d1
 284:   6700 222e       beqw 24b4 <Screen4+0x24b4>  <<== error
 288:   ffdc            0177734                     <<== error
 28a:   202e ffe0       movel %fp@(-32),%d0
 28e:   b081            cmpl %d1,%d0
 290:   672e            beqs 2c0 <Screen4+0x2c0>    <<== correct
 292:   2f2e ffe0       movel %fp@(-32),%sp at -
 296:   2f2e ffdc       movel %fp@(-36),%sp at -
 29a:   4879 0000 0000  pea 0 <Screen4>
 2a0:   4eb9 0000 0000  jsr 0 <Screen4>
 2a6:   2079 0000 0000  moveal 0 <Screen4>,%a0
 2ac:   2f28 0008       movel %a0@(8),%sp at -
 2b0:   4eb9 0000 0000  jsr 0 <Screen4>
 2b6:   4878 0001       pea 1 <Screen4+0x1>
 2ba:   4eb9 0000 0000  jsr 0 <Screen4>
 2c0:   7004            moveq #4,%d0


---------------------------------------------------------
                                John S Gwynne, PhD.
Mission Research Corporation    Email: jgwynne at mrcday.com
3975 Research Blvd              Tel: (937) 429-9261 x166
Dayton Ohio 45430-2625          Fax: (937) 320-2562
---------------------------------------------------------



More information about the users mailing list