[Bug tree-optimization/42652] vectorizer created unaligned vector insns
law at redhat dot com
gcc-bugzilla@gcc.gnu.org
Mon Jan 11 17:14:00 GMT 2010
------- Comment #6 from law at redhat dot com 2010-01-11 17:14 -------
Subject: Re: vectorizer created unaligned vector
insns
On 01/10/10 01:22, irar at il dot ibm dot com wrote:
> ------- Comment #5 from irar at il dot ibm dot com 2010-01-10 08:22 -------
> In vector_alignment_reachable_p() we check if an access is packed using
> contains_packed_reference(). For packed accesses we return false, meaning
> alignment is unreachable and peeling cannot be used.
>
> In the attached testcase contains_packed_reference() returns false for
> palette_5.
>
Right. If you look more closely at the way the code works, there's no
way contains_packed_reference is ever going to return true. It simply
isn't passed the right information. It'd need to be looking at the base
address's type (not the base object). Furthermore,
contains_packed_reference simply isn't designed to dive into types. It
primarily works on exprs and only references the underlying type when it
encounters a COMPONENT_REF.
As Richard apparently pointed out in the past, this code is not
conservatively correct -- if it can't prove the item is properly
aligned, then a runtime check is required.
So while I think we might be able to fix this specific instance by
improving the code around the call to contains_packed_reference, I think
we have a bigger problem as it's fairly trivial to change the test so
that the addresses of interest are parameters and alignment info is
effectively unknown.
Jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42652
More information about the Gcc-bugs
mailing list