From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97193 invoked by alias); 12 Sep 2017 19:45:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 96997 invoked by uid 89); 12 Sep 2017 19:45:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1211 X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 344834E028 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Subject: Re: [PATCH] powerpc: Use aligned stores in memset To: munroesj@linux.vnet.ibm.com Cc: Rajalakshmi Srinivasaraghavan , libc-alpha@sourceware.org References: <1503033107-20047-1-git-send-email-raji@linux.vnet.ibm.com> <1505223476.12360.14.camel@oc7878010663> <87wp54vwk4.fsf@mid.deneb.enyo.de> <1505225800.12360.28.camel@oc7878010663> <1505244094.12360.36.camel@oc7878010663> From: Florian Weimer Message-ID: Date: Tue, 12 Sep 2017 19:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1505244094.12360.36.camel@oc7878010663> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00523.txt.bz2 On 09/12/2017 09:21 PM, Steven Munroe wrote: > On Tue, 2017-09-12 at 19:04 +0200, Florian Weimer wrote: >> On 09/12/2017 04:16 PM, Steven Munroe wrote: >>> On Tue, 2017-09-12 at 16:08 +0200, Florian Weimer wrote: >>>> * Steven Munroe: >>>> >>>>>> This means that GCC introduced an unaligned store, no matter how memset >>>>>> was implemented. >>>>>> >>>>> C will do what ever the programmer wants. We can not stop that. >>>> >>>> That's not true. If some specification says that for POWER, mem* must >>>> behave in a certain way, and the GCC/glibc combiniation does not do >>>> that, that's a bug on POWER. >>>> >>> What is the bug that you think we are not fixing? >> >> memset, as called by the C programmer, still uses unaligned stores. Please look at my example and its disassembly. > We are not going to version every loop that might contain stores based > on speculation that someone who does not know what they are doing might > access Cache Inhibited storage. You need to remove optimizations from GCC which expand memset calls using other instructions if those expansions do not compensate for the possibility of unaligned stores. Thanks, Florian