Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758735AbcJQIdg (ORCPT ); Mon, 17 Oct 2016 04:33:36 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:60767 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758694AbcJQIdW (ORCPT ); Mon, 17 Oct 2016 04:33:22 -0400 Date: Mon, 17 Oct 2016 10:33:15 +0200 From: Peter Zijlstra To: Vegard Nossum Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Linus Torvalds , "Luis R . Rodriguez" , stable@vger.kernel.org, Ming Lei , Steven Rostedt Subject: Re: [PATCH 01/12] extarray: define helpers for arrays defined in linker scripts Message-ID: <20161017083315.GA29322@worktop.vlan200.pylonone.local> References: <20161016151616.31451-1-vegard.nossum@oracle.com> <20161016151616.31451-2-vegard.nossum@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161016151616.31451-2-vegard.nossum@oracle.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 686 Lines: 17 On Sun, Oct 16, 2016 at 05:16:05PM +0200, Vegard Nossum wrote: > The test in this loop: > > for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) { > > was getting completely compiled out by my gcc, 7.0.0 20160520. The result > was that the loop was going beyond the end of the builtin_fw array and > giving me a page fault when trying to dereference b_fw->name. > > This is because __start_builtin_fw and __end_builtin_fw are both declared > as (separate) arrays, and so gcc conludes that b_fw can never point to > __end_builtin_fw. > Urgh, isn't that the kind of 'optimizations' we should shoot in the head for the kernel? Just like the -fno-strict-aliassing crap?