Date: Mon, 13 Feb 2017 10:51:06 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-arm@FreeBSD.org Subject: [Bug 217065] Memmove / bcopy optimization bug Message-ID: <bug-217065-7@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217065 Bug ID: 217065 Summary: Memmove / bcopy optimization bug Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: alexandre.martins@stormshield.eu Hello, During the optimization phase of our project on an Armada 380, I have see t= hat an optimization on bcopy/memmove is broken. https://svnweb.freebsd.org/base/head/sys/arm/arm/support.S?view=3Dannotate#= l403 The condition on the following line are reserved: > subcc r3, r0, r1 /* if (dst > src) r3 =3D dst - src */ > subcs r3, r1, r0 /* if (src > dsr) r3 =3D src - dst */ > cmp r3, r2 /* if (r3 < len) we have an overlap */ > bcc PIC_SYM(_C_LABEL(memcpy), PLT) Should be: > subcs r3, r0, r1 /* if (dst > src) r3 =3D dst - src */ > subcc r3, r1, r0 /* if (src > dsr) r3 =3D src - dst */ > cmp r3, r2 /* if (r3 < len) we have an overlap */ > bcs PIC_SYM(_C_LABEL(memcpy), PLT) This code may produce bugs if an unlikely copy of more that 2Gb is done (I don't see how). I have already reported that on the mailling list: https://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D462567+0+archive/2017/freeb= sd-arm/20170212.freebsd-arm Best regards, Alexandre Martins --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217065-7>