From patchwork Fri Sep 18 19:19:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 7220301 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 355A0BEEC1 for ; Fri, 18 Sep 2015 19:19:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 781E420926 for ; Fri, 18 Sep 2015 19:19:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 702E720921 for ; Fri, 18 Sep 2015 19:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752655AbbIRTTV (ORCPT ); Fri, 18 Sep 2015 15:19:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43135 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbbIRTTU (ORCPT ); Fri, 18 Sep 2015 15:19:20 -0400 Received: from akpm3.mtv.corp.google.com (unknown [216.239.45.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EB3ACBD7; Fri, 18 Sep 2015 19:19:19 +0000 (UTC) Date: Fri, 18 Sep 2015 12:19:19 -0700 From: Andrew Morton To: Andi Kleen Cc: Stephen Boyd , Andy Gross , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-soc@vger.kernel.org, linux-mips@linux-mips.org, Hauke Mehrtens , Paul Walmsley , =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Bjorn Andersson Subject: Re: [PATCH 0/3] Add __ioread32_copy() and use it Message-Id: <20150918121919.fa20552946703ae772d636e9@linux-foundation.org> In-Reply-To: <20150916025546.GE1747@two.firstfloor.org> References: <1442346089-32077-1-git-send-email-sboyd@codeaurora.org> <20150915155815.5a41a8dc537610ab44d8d3dc@linux-foundation.org> <20150916023219.GD1747@two.firstfloor.org> <20150915195031.0a1756a2.akpm@linux-foundation.org> <20150916025546.GE1747@two.firstfloor.org> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 16 Sep 2015 04:55:46 +0200 Andi Kleen wrote: > > Under what circumstances will the compiler (or linker?) do this? > > Compiler. > > > LTO enabled? > > Yes it's for LTO. The optimization allows the compiler to drop unused > functions, which is very popular with users (a lot use it to get smaller > kernel images) > Does this look truthful and complete? --- a/include/linux/compiler-gcc.h~a +++ a/include/linux/compiler-gcc.h @@ -205,7 +205,10 @@ #if GCC_VERSION >= 40600 /* - * Tell the optimizer that something else uses this function or variable. + * When used with Link Time Optimization, gcc can optimize away C functions or + * variables which are referenced only from assembly code. __visible tells the + * optimizer that something else uses this function or variable, thus preventing + * this. */ #define __visible __attribute__((externally_visible)) #endif