This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: movmem pattern and missed alignment


On Tue, 9 Oct 2018, Richard Biener wrote:

> It was repeatedly suggested that we _could_ derive alignment info from
> function parameter types since we rely on precise typing there for example
> for points-to analysis (albeit only for restrict qualification processing and
> for DECL_BY_REFERENCE "pointers").  That would fix the simple testcase
> that was presented here.

Even in that case you mustn't assume alignment for pointer comparisons, 
only for dereferences.  Assuming it for comparisons breaks e.g. glibc's

# define LC_GLOBAL_LOCALE       ((locale_t) -1L)

(locale_t is a pointer-to-pointer-aligned-struct) and other similar 
constructs involving magic constants (not dereferenced) of pointer type; 
comparisons of a locale_t value against LC_GLOBAL_LOCALE need to work.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]