From: Ian Campbell Subject: Re: [PATCH ARM v7 13/13] mini-os: fixed compiling with debug=n Date: Mon, 8 Sep 2014 12:08:29 +0100 Message-ID: <1410174509.10156.174.camel@kazak.uk.xensource.com> References: <1407512862-9373-1-git-send-email-talex5@gmail.com> <1407512862-9373-14-git-send-email-talex5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XQwoG-0007gA-2N for xen-devel@lists.xenproject.org; Mon, 08 Sep 2014 11:08:36 +0000 In-Reply-To: <1407512862-9373-14-git-send-email-talex5@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Thomas Leonard Cc: xen-devel@lists.xenproject.org, stefano.stabellini@eu.citrix.com, Dave.Scott@eu.citrix.com, samuel.thibault@ens-lyon.org, anil@recoil.org List-Id: xen-devel@lists.xenproject.org On Fri, 2014-08-08 at 16:47 +0100, Thomas Leonard wrote: > Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our > "memset" is doing a memset operation and tries to make it call the > standard "memset", creating a loop. As in __builtin_memset or some such? Isn't there are -nostdthings we could/should use? -fno-tree-loop... seems a bit abstracted from the affect and it's not impossible that different gcc would still do this same thing in the future under some other optimisation. > The change to fdt_ro.c is to avoid a compiler warning. Ah, here it is for real ;-) > > Signed-off-by: Thomas Leonard > --- > extras/mini-os/minios.mk | 2 +- > xen/common/libfdt/fdt_ro.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/extras/mini-os/minios.mk b/extras/mini-os/minios.mk > index 20ba64b..3e881e4 100644 > --- a/extras/mini-os/minios.mk > +++ b/extras/mini-os/minios.mk > @@ -23,7 +23,7 @@ DEF_CFLAGS += -g > #DEF_CFLAGS += -DGNT_DEBUG > #DEF_CFLAGS += -DGNTMAP_DEBUG > else > -DEF_CFLAGS += -O3 > +DEF_CFLAGS += -O3 -fno-tree-loop-distribute-patterns > endif > > # Make the headers define our internal stuff > diff --git a/xen/common/libfdt/fdt_ro.c b/xen/common/libfdt/fdt_ro.c > index 02b6d68..a34c6d6 100644 > --- a/xen/common/libfdt/fdt_ro.c > +++ b/xen/common/libfdt/fdt_ro.c > @@ -444,7 +444,7 @@ int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset, > > int fdt_node_depth(const void *fdt, int nodeoffset) > { > - int nodedepth; > + int nodedepth = -1; > int err; > > err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);