From 8a71d2e27fd067a85059aefb93c9ce83142b03e9 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Thu, 28 Jan 2016 01:52:05 +0000 Subject: Fix MIPS64 memcpy regression. The MIPS memcpy optimizations at introduced a bug causing many string function tests to fail with segfaults for n32 and n64: FAIL: string/stratcliff FAIL: string/test-bcopy FAIL: string/test-memccpy FAIL: string/test-memcmp FAIL: string/test-memcpy FAIL: string/test-memmove FAIL: string/test-mempcpy FAIL: string/test-stpncpy FAIL: string/test-strncmp FAIL: string/test-strncpy (Some failures in other directories could also be caused by this bug.) The problem is that after the check for whether a word of input is left that can be copied as a word before moving to byte copies, a load can occur in the branch delay slot, resulting in a segfault if we are at the end of a page and the following page is unmapped. I don't see how this would have passed the tests as reported in the original patch posting (different kernel configurations affecting the code setting up unmapped pages, maybe?), since the tests in question don't appear to have changed recently. This patch moves a later instruction into the delay slot, as suggested at . Tested for n32 and n64. 2016-01-28 Steve Ellcey Joseph Myers * sysdeps/mips/memcpy.S (MEMCPY_NAME) [USE_DOUBLE]: Avoid word load in branch delay slot when less than a word of input left. --- ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index e2108a98c7..9cb8df3b88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-01-28 Steve Ellcey + Joseph Myers + + * sysdeps/mips/memcpy.S (MEMCPY_NAME) [USE_DOUBLE]: Avoid word + load in branch delay slot when less than a word of input left. + 2016-01-27 Andreas Schwab * sysdeps/ieee754/ldbl-128ibm/s_erfl.c (half): Remove. -- cgit v1.2.3