From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23554 invoked by alias); 11 Jan 2010 17:14:54 -0000 Received: (qmail 23476 invoked by alias); 11 Jan 2010 17:14:41 -0000 Date: Mon, 11 Jan 2010 17:14:00 -0000 Message-ID: <20100111171441.23475.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/42652] vectorizer created unaligned vector insns In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "law at redhat dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg01244.txt.bz2 ------- 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