svn commit: r358902 - head/lib/libc/powerpc64/string

Brandon Bergren bdragon at imap.cc
Thu Mar 12 17:55:57 UTC 2020


To be clear here, I meant non qword-aligned, as it was the VSX implementation that was actually tripping up here. The problem manifested when the source and destination didn't match on the least significant nybble.

Apparently it's also somewhat uncommon for programs to ever do anything with the return value as well.

On Wed, Mar 11, 2020, at 6:34 PM, Brandon Bergren wrote:
> Author: bdragon
> Date: Wed Mar 11 23:34:44 2020
> New Revision: 358902
> URL: https://svnweb.freebsd.org/changeset/base/358902
> 
> Log:
>   Fix r358688 -- Remember to actually save r3 before processing.
>   
>   Crash was noticed by pkubaj building gcc9.
>   
>   Apparently non dword-aligned char pointers are somewhat rare in the wild.
>   
>   Reported by:	pkubaj
>   Sponsored by:	Tag1 Consulting, Inc.
> 
> Modified:
>   head/lib/libc/powerpc64/string/memcpy.S
> 
> Modified: head/lib/libc/powerpc64/string/memcpy.S
> ==============================================================================
> --- head/lib/libc/powerpc64/string/memcpy.S	Wed Mar 11 22:25:45 2020	(r358901)
> +++ head/lib/libc/powerpc64/string/memcpy.S	Wed Mar 11 23:34:44 2020	(r358902)
> @@ -58,8 +58,8 @@ ENTRY(FN_NAME)
>  	andi.	%r7, %r4, ALIGN_MASK
>  	cmpd	%r8, %r7
>  	mr	%r7, %r5
> -	bne	.Lcopy_remaining_fix_index_byte
>  	mr	%r8, %r3		/* save dst */
> +	bne	.Lcopy_remaining_fix_index_byte
>  
>  	/* align src */
>  .Lalignment_loop:
>

-- 
  Brandon Bergren
  bdragon at imap.cc


More information about the svn-src-head mailing list