On Wed, Sep 28, 2011 at 09:56:27PM +0200, Richard Guenther wrote: > There is nothing like "very likely aligned" ;) Note that what is new is
On non-strict aligned targets there is no reason not to have something like "very likely aligned". You would expand stores/loads as if it was aligned in that case, and if it isn't, all you'd need to ensure from that is that you don't derive properties about the pointer value from the "likely aligned" info, only from alignment. "Very likely aligned" is interesting to the vectorizer too, if it is very likely something is sufficiently aligned, the vectorizer could decide to assume the alignment in the vectorized loop and add the check for the alignment to the loop guards. In the likely case the vectorized loop would be used (if other guards were true too), in the unlikely case it is unaligned it would just use a slower loop. > that we now no longer assume alignment by default (we did in the past) > and that we derive properties about the pointer _value_ from alignment. > > I think we can derive pointer values when we see dereferences, the > code wouldn't be portable to strict-alignment targets otherwise. We But any references? If you have int foo (int *p) { memcpy (p, "a", 1); return ((uintptr_t) p & 3) == 0; } then even if p isn't aligned, this could work even on strict aligned targets. Anyway, the arbitrary value in a pointer thing is much more important then the rest, so having the dominating dereference test is very important. Jakub