From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 539 invoked by alias); 7 Jun 2017 20:12:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 499 invoked by uid 89); 7 Jun 2017 20:12:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt0-f195.google.com Received: from mail-qt0-f195.google.com (HELO mail-qt0-f195.google.com) (209.85.216.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Jun 2017 20:12:51 +0000 Received: by mail-qt0-f195.google.com with SMTP id x58so3617097qtc.2 for ; Wed, 07 Jun 2017 13:12:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=/tldTem0jdqHppJRCpJmh95OzROsdsiouFS0iReRCcc=; b=uDnl9vQYLuEDdJVyza8K3piKgtcKJdqnwqpMecCvmOOnFzPW6yQbAGLYaHLIRoiWdq RUHZV/PxK5AvnzWzZiRc8LpmAKfqdWcaMZNQuHIR6ORQeSh893O1ekNad05W8Oltai0+ 9TiAeuENXzH58pcvaIA/ovXI892TrCB+dR78OabSrzlWj/QLaZ+EDYGFuT8Mw8W6YWA/ OWkiG/OFUbw5LdzXd014VYAxzjBusCqWL9SxnxVFn07Pr1ENbVi4yAP/Dy4y7nqANSV+ 0GAQ02FXwy7KoIDnyPIrfZd/Fu+PxEgPNDAAQOY4ApikrA8Cy8QFz7nJwfWe5jWN254S hASA== X-Gm-Message-State: AODbwcANdP398xeh1jyipwQlY0XIj1d+v1qRANiByiHtBgNszVPyEJJh j2mzMUNiWtmnVg== X-Received: by 10.200.51.112 with SMTP id u45mr28458550qta.12.1496866373999; Wed, 07 Jun 2017 13:12:53 -0700 (PDT) Received: from localhost.localdomain (71-218-22-76.hlrn.qwest.net. [71.218.22.76]) by smtp.gmail.com with ESMTPSA id m47sm1712240qtc.36.2017.06.07.13.12.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2017 13:12:53 -0700 (PDT) Subject: Re: [PATCH] handle bzero/bcopy in DSE and aliasing (PR 80933, 80934) To: gcc-patches@gcc.gnu.org, Bernhard Reutner-Fischer References: <96b534c4-988f-e958-f341-9674a60aeb1e@gmail.com> <656E3329-B549-490D-A87F-7421D424E781@gmail.com> Cc: Richard Biener From: Martin Sebor Message-ID: <87936043-98aa-52e5-155b-38ecafca562c@gmail.com> Date: Wed, 07 Jun 2017 20:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00463.txt.bz2 On 06/07/2017 02:01 PM, Marc Glisse wrote: > On Wed, 7 Jun 2017, Bernhard Reutner-Fischer wrote: > >> On 7 June 2017 16:46:53 CEST, Martin Sebor wrote: >>> On 06/07/2017 02:23 AM, Richard Biener wrote: >>>> On Wed, Jun 7, 2017 at 5:26 AM, Martin Sebor >>> wrote: >>>>>> Note I'd be _much_ more sympathetic to simply canonicalizing all of >>>>>> bzero and bcopy >>>>>> to memset / memmove and be done with all the above complexity. >>>>> >>>>> >>>>> Attached is an updated patch along these lines. Please let me >>>>> know if it matches your expectations. >>>> >>>> I think you attached the wrong patch. >>> >>> Yes I did, sorry. The correct one is attached. >> >> Under POSIX.1-2008 "optimizing" bzero or bcmp is IMO plain wrong. >> >> It's like optimizing foo() to a random built-in but maybe that's just >> me. If your libc provides a define to a standard function for these >> under a compat knob then fine but otherwise you should fix that. >> *shrug*. Joseph? > > The patch optimizes __builtin_bzero, which should be ok. The question > (independent from this patch) is then under what conditions bzero should > be detected as a builtin. Yes. The problem is that unlike for C and C++, GCC doesn't have a mechanism to select the target version of POSIX. I think it should. But there is a subtle problem with the patch that needs fixing. Bcopy should not be transformed to memcpy but rather memmove. I'll fix that before committing. Martin