lkml.org 
[lkml]   [2009]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/8] compiler-gcc.h: add more comments to RELOC_HIDE
On Sat, 10 Jan 2009, Ingo Molnar wrote:

> 2) Special structure sizes
>
> For example we want to load a value from "&var + LARGE_OFFSET" (common
> percpu construct). If 'var' is a C structure that happens to have a size
> of 255 bytes, then GCC could legitimately assume that 'LARGE_OFFSET' is
> 0..255 [inclusive], and could optimize LARGE_OFFSET to be truncated to a
> single byte.


But that is not what is occurring. We do not do &var + LARGE_OFFSET.
Instead one does

((void *)&var) + LARGE_OFFSET

or
((unsigned long)&var) + LARGE_OFFSET


The cast should cause the C compiler to drop all assumptions about size.
And the definition of RELOC_HIDE for icc and generic compilers in the tree
show that this is working.



\
 
 \ /
  Last update: 2009-01-12 18:37    [W:1.842 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site