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

Re: Bug in Gcc 2.5.8



> > [...]  Am I hallucinating?
> 
> Perhaps comp.sys.m68k and/or gnu.gcc.bug could help in this case?

Well, in the meantime I checked, and my first results were
blatantly wrong, sorry for that. I think we have to start the
search again now.

Ole_Arndt@of2.maus.de seems to have run some more experiments,
and he obviously has both assembler outputs, so we should contact
him for details. In the meantime, lets look at his findings again:

Gcc 2.5.8 produces assembler output like this (in newproc()):

    lea     _kmalloc,a2
    jsr     a2@
    movel   d0,d2
    addql   #4,sp
    jne     L2          | <- testing zero flag set by addq
    moveql  #0,d0
    rts
L2:
 
while gcc 2.3.3 at the same place outputs:

    lea     _kmalloc,a2
    jsr     a2@
    movel   d0,a2
    addql   #4,sp
    cmpal   #0,a2
    jne     L2
    moveql  #0,d0
    rts
L2:

First, I checked that addq.l behaves the same as addq.w does
(at least on HP9000/380). Second, the code differs in that the
first version copies d0 to d2, then pops, then branches, and the second
copies d0 to a2 (an address register!), then pops, then compares
and branches. The manual says that cmpa.l sets all flags
while move.l sets only two (Z and N if I remember correctly).
Make of that what you want 8-(

Anyway, I think we're not looking at the right spot for the
problem.

--clausb@hpbeo79.bbn.hp.com-----------------------------------------------
Claus Brod, MDD, HP Boeblingen         Have you hugged your manager today?
--#include <std_disclaimer>-----------------------------------------------