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: 7220321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7F7779F380 for ; Fri, 18 Sep 2015 19:21:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B19F820925 for ; Fri, 18 Sep 2015 19:21:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E118420921 for ; Fri, 18 Sep 2015 19:21:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zd1CE-000062-IY; Fri, 18 Sep 2015 19:19:46 +0000 Received: from mail.linuxfoundation.org ([140.211.169.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zd1C8-0008T9-SG for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2015 19:19:41 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150918_121940_956971_59373E8F X-CRM114-Status: UNSURE ( 8.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.2 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mips@linux-mips.org, Paul Walmsley , Hauke Mehrtens , linux-arm-msm@vger.kernel.org, =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Stephen Boyd , linux-kernel@vger.kernel.org, Bjorn Andersson , Andy Gross , linux-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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