On Tue, Oct 9, 2018 at 1:53 PM Joseph Myers <jos...@codesourcery.com> wrote: > > 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.
Heh! That's non-conforming! But yes, looks like it won't fly after all. Richard. > -- > Joseph S. Myers > jos...@codesourcery.com