Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp112033pxa; Tue, 18 Aug 2020 17:47:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymWrLkhzbD3JGnRc1ovdB+Ll3YG9FEGtN93q7sL8glmvbxRNDidJ+l1xiC9r5YzVcBc1eN X-Received: by 2002:a05:6402:a59:: with SMTP id bt25mr22790386edb.71.1597798047395; Tue, 18 Aug 2020 17:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597798047; cv=none; d=google.com; s=arc-20160816; b=SKTt99EdIlv5acUG4pEq/ATss9GA/n28M2TIvbQYw84eXBw4pwf4NCIy6oaPkV5p3j HPumggvtD7c1RmlrKAWK7Qp5IsSUg+zpC9f0jxPjwMwXm+7fudMFSwAUNvPTdGwoEN5f CoFqZo8/t/85dOAu5hyhpbfPl3xVLUADBcg8HzwPmz4M/ecwluTaGSkJyp+RHyjDF2eh ccj5EcDY3+IAhH2iYk80AUYDm6XJUP5/BoFeNpTF5lVxIZOqBBde5NZEHf5s7CAvI0fO rINJVoyQnWOd+FaYo9eqBcZhQcDI05GtioXkYThGWgsB408552kQZ6q4OXJOOEYESFKS TCrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=z2DynlYRISsaYGNYsitlwb4+khyZlyAf5FIqSKM75Sw=; b=lMK8kt4TJtvt3b0+QpP/s+Fojtk35S8AieVvEoZ3jP45vXU0Z2lzGZs6dN4cnXObop JkFPsZRFEt50ET0AAnZgOTvEwj0IbF/oiuksYFODn8nDQygJE+YueEVh81SVj246aZGG 7DLKI/ya6mJ/2Z77mlGqXZLQoWUUgDp+gWyYtzIEJwKgPwQujl5C4/yvlw/9h0p3MkgS TlUQ+jNq5dJCzk6tanQ9gktsRGu/gly20YNrkZp0LUyumfnSS7o1VgsXVOqZyzkSUR4r KYTBHrlT4F9LmqMFgrqBXs7sukHSitQRPcKO1b+znFZBFV+a35IxBGOuliAC50yBwrUr KzAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZWjTUpPq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si13928104edy.546.2020.08.18.17.47.00; Tue, 18 Aug 2020 17:47:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZWjTUpPq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726847AbgHSAoY (ORCPT + 99 others); Tue, 18 Aug 2020 20:44:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbgHSAoY (ORCPT ); Tue, 18 Aug 2020 20:44:24 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F6A6C061389 for ; Tue, 18 Aug 2020 17:44:23 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id x24so11153047lfe.11 for ; Tue, 18 Aug 2020 17:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z2DynlYRISsaYGNYsitlwb4+khyZlyAf5FIqSKM75Sw=; b=ZWjTUpPqeNDFZ5App1PKI3BTysWeld/2SgkPFZEQq11iPN7vO/wNK5oKv6EG7MF+QJ 7xi0n1OxTlKsaQFzGElnBMPOv4og7mbxTlw5Au6CKtjV9v4dQJ1BJYjehwKKf75/ulbt DPWNZloSONUhqNB49PEiskUtNkKaIzAiBDQr4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z2DynlYRISsaYGNYsitlwb4+khyZlyAf5FIqSKM75Sw=; b=NWqKkpf+0I2WvNdvjprhos5Zu4r2gbOIahIIUKpvdZ62/Ox10XWc0iuHlJqRO74+0w fVfebyuCnHrGBoX7z9vefadrIe8k/hzAtqVu48E7OdEhRcjw65FKAlh9MW98/6Oh2NrL zZwfO5hlXMV2gI8HAI54eBjRDH2kyrbMb/jPhX+djAyCaKqhm8HR03rQuKGDuQZx2UoC vP5SrH7oFwCoyZlWAg/9JRxmNU3bxgF4t+SFORMZBPZAE5XrhnQQ9gTWEe/cVmJ8Hm7h JiXa5/CL/YiDD0m618SdWfCxdAEBQv7OMCoVRvjx6qgFHonEmz+K9E4gOHCK78fdxArK uB0g== X-Gm-Message-State: AOAM530adj3hR0c+oX4Bcu+tQua9trxFQO1bM5Kkt95jC4iKU8MMNt/A tsU+fz9MEP4jmnjAeIRT7cv8UjzwlG2tgA== X-Received: by 2002:a19:c1d7:: with SMTP id r206mr11003926lff.2.1597797861009; Tue, 18 Aug 2020 17:44:21 -0700 (PDT) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id x17sm6388105ljm.0.2020.08.18.17.44.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Aug 2020 17:44:19 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id d2so11183074lfj.1 for ; Tue, 18 Aug 2020 17:44:19 -0700 (PDT) X-Received: by 2002:ac2:46d0:: with SMTP id p16mr11162480lfo.142.1597797859441; Tue, 18 Aug 2020 17:44:19 -0700 (PDT) MIME-Version: 1.0 References: <20200818234307.3382306-1-nivedita@alum.mit.edu> In-Reply-To: <20200818234307.3382306-1-nivedita@alum.mit.edu> From: Linus Torvalds Date: Tue, 18 Aug 2020 17:44:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] lib/string.c: Disable tree-loop-distribute-patterns To: Arvind Sankar Cc: Andrew Morton , Nick Desaulniers , Linux Kernel Mailing List , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 18, 2020 at 4:43 PM Arvind Sankar wrote: > > This by itself is insufficient for gcc if the optimization was > explicitly enabled by CFLAGS, so also add a flag to explicitly disable > it. Using -fno-tree-loop-distribute-patterns seems to really be a bit too incestuous with internal compiler knowledge. That generic memcpy implementation is horrible anyway. It should never be used. So I'd rather see this either removed entirely, ot possibly rewritten to be a somewhat proper memcpy implementation, and in the process made to not be recognizable by the compiler (possibly by adding a dummy barrier() or something like that). Looking at the implementation of "strscpy()" in the same file, and then comparing that to the ludicrously simplisting "memcpy()", I really get the feeling that that memcpy() is not worth having. Linus