linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 2/2] perf tools: Fix strict alias issue for find_first_bit
Date: Thu, 6 Mar 2014 17:46:53 -0300	[thread overview]
Message-ID: <20140306204653.GA2361@infradead.org> (raw)
In-Reply-To: <20140228212923.GI14089@laptop.programming.kicks-ass.net>

Em Fri, Feb 28, 2014 at 10:29:23PM +0100, Peter Zijlstra escreveu:
> On Fri, Feb 28, 2014 at 06:25:51PM -0300, Arnaldo Carvalho de Melo wrote:
> > From: Jiri Olsa <jolsa@redhat.com>

> > The gcc documentation offers workaround for valid aliasing by using
> > __may_alias__ attribute:

> >   http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Type-Attributes.html

> > Using this workaround for the find_first_bit function.

> Hurm; didn't I suggest using -fno-strict-aliasing just like the kernel
> does? Because the C aliasing rules are bonghits heavy?

Either way would solve the problem at hand, I just used the smaller
hammer offered.

I thought that Ingo had something against this, but only reference I
could find now about it was this:

--------------------------------------------

commit 65014ab36196f6d86edc9ee23759d6930b9d89a8
Author: Ingo Molnar <mingo@elte.hu>
Date:   Wed Sep 2 14:55:55 2009 +0200

    perf tools: Work around strict aliasing related warnings
    
    Older versions of GCC are rather stupid about strict aliasing:

<SNIP>

    Make it clear to GCC that we intend with those pointers, by passing
    them through via an explicit (void *) cast.
    
    We might want to add -fno-strict-aliasing as well, like the kernel
    itself does.
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
--------------------------------------------

Jiri's bandaid is for _newer_ compilers, so...

- Arnaldo

  parent reply	other threads:[~2014-03-06 20:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 21:25 [GIT PULL 0/2] perf/urgent fixes Arnaldo Carvalho de Melo
2014-02-28 21:25 ` [PATCH 1/2] perf tools: fix BFD detection on opensuse Arnaldo Carvalho de Melo
2014-02-28 21:25 ` [PATCH 2/2] perf tools: Fix strict alias issue for find_first_bit Arnaldo Carvalho de Melo
2014-02-28 21:29   ` Peter Zijlstra
2014-03-01  0:03     ` David Ahern
2014-03-01  9:12       ` Ingo Molnar
2014-03-06 20:46     ` Arnaldo Carvalho de Melo [this message]
2014-03-01  9:14 ` [GIT PULL 0/2] perf/urgent fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140306204653.GA2361@infradead.org \
    --to=acme@ghostprotocols.net \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).