Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Mar 2020 12:55:33 -0500
From:      "Brandon Bergren" <bdragon@imap.cc>
To:        "Brandon Bergren" <bdragon@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r358902 - head/lib/libc/powerpc64/string
Message-ID:  <ef2853a2-5a63-430f-81c8-17a01c21774f@www.fastmail.com>
In-Reply-To: <202003112334.02BNYiZs010229@repo.freebsd.org>
References:  <202003112334.02BNYiZs010229@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@imap.cc



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ef2853a2-5a63-430f-81c8-17a01c21774f>