[lkml]   [2014]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/2] perf tools: Fix strict alias issue for find_first_bit
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 <>

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

> >

> > 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 <>
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:


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 <>
Cc: Mike Galbraith <>
Cc: Paul Mackerras <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Frederic Weisbecker <>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <>

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

- Arnaldo

 \ /
  Last update: 2014-03-06 22:41    [W:0.052 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site