Xtonlsab bug

Joakim Tjernlund joakim.tjernlund at transmode.se
Fri Apr 30 15:48:42 CEST 2010




Martin Mares <mj at ucw.cz> wrote on 2010/04/30 15:25:20:

> From: Martin Mares <mj at ucw.cz>
> To: Joakim Tjernlund <joakim.tjernlund at transmode.se>
> Cc: bird-users at trubka.network.cz, Ondrej Zajicek <santiago at crfreenet.org>
> Date: 2010/04/30 15:25
> Subject: Re: Xtonlsab bug
>
> Hello!
>
> > hmm, why bomb out when not needed?
>
> It does not matter. It must not occur in production versions either,
> it should exist only as a warning for developers during testing.

FYI:

struct my_struct {
	long a100[100];
};

static inline
func(struct my_struct *h1, struct my_struct *h2)
{
	*h1 = *h2;
}

mytest(struct my_struct *my_h1)
{
	func(my_h1, my_h1);
}

uses memcpy on ppc:
mytest:
	mflr 0
	stwu 1,-16(1)
	mr 4,3
	li 5,400
	stw 0,20(1)
	bl memcpy
	lwz 0,20(1)
	addi 1,1,16
	mtlr 0
	blr

Pehaps this it is always safe to use memcpy in this case, but the man
page doesn't. It is also a waste of cycles as the whole op is a NOP.

     Jocke




More information about the Bird-users mailing list