http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48377

--- Comment #15 from Ira Rosen <irar at il dot ibm.com> 2011-04-07 09:00:43 UTC 
---
(In reply to comment #14)
> Sure, but for types with user alignment smaller than their size, loop peeling
> may often never be able to align it.
> 
> This regressed with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161797

This patch only allowed peeling for loads. So the problem existed for stores
before this revision.

> 
> What I mean is that for say unsigned int type with 32-bit alignment loop
> peeling for valid code should always end up with correct alignment, but for
> unsigned int with 8-bit alignment it can't.  And e.g. i?86 long long is of the
> same category, it has 64-bit size, but 32-bit alignment, so if you have a
> pointer
> to long long array, the whole array might be just 32-bit aligned, but not
> 64-bit,
> then any kind of peeling will still result in misalignment.

The vectorizer calls builtin_vector_alignment_reachable in case of unknown
alignment to verify that the access is naturally aligned. (i?86 doesn't
implement this builtin and uses the default implementation). 
There is PR 42652 for a similar problem.

Thanks,
Ira

Reply via email to