Re: [PATCH] tools include: Fix strict-aliasing rules breakage "tools/include/linux/compiler.h:66: error: dereferencing pointer ‘res.41’ does break strict-aliasing rules"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Tue, Oct 13, 2015 at 10:52:14AM +0200, Jiri Olsa escreveu:
> On Mon, Oct 12, 2015 at 05:48:17PM -0700, Vinson Lee wrote:
> 
> SNIP
> 
> > >                 __builtin_memcpy((void *)res, (const void *)p, size);
> > > @@ -59,11 +64,14 @@ static __always_inline void __read_once_size(const volatile void *p, void *res,
> > >
> > >  static __always_inline void __write_once_size(volatile void *p, void *res, int size)
> > >  {
> > > +       u64_alias_t *u64_p = (u64_alias_t*) p;
> > > +       u64_alias_t *u64_res = (u64_alias_t*) res;
> > > +
> > >         switch (size) {
> > >         case 1: *(volatile __u8 *)p = *(__u8 *)res; break;
> > >         case 2: *(volatile __u16 *)p = *(__u16 *)res; break;
> > >         case 4: *(volatile __u32 *)p = *(__u32 *)res; break;
> > > -       case 8: *(volatile __u64 *)p = *(__u64 *)res; break;
> > > +       case 8: *u64_p = *u64_res; break;
> > >         default:
> > >                 barrier();
> > >                 __builtin_memcpy((void *)p, (const void *)res, size);
> > 
> > 
> > This patch fixes my perf build error with GCC 4.4.
> > 
> > Vinson
> 
> posting complete patch

Applied, with a tested-by Vinson,

thanks,

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux