This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/42652] vectorizer created unaligned vector insns
- From: "irar at il dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2010 12:17:36 -0000
- Subject: [Bug tree-optimization/42652] vectorizer created unaligned vector insns
- References: <bug-42652-391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from irar at il dot ibm dot com 2010-01-18 12:17 -------
Does something like this make sense? (With this patch we will never use peeling
for function parameters, unless the builtin returns OK to peel for packed
types).
Index: tree-vect-data-refs.c
===================================================================
--- tree-vect-data-refs.c (revision 155880)
+++ tree-vect-data-refs.c (working copy)
@@ -1010,10 +1010,29 @@ vector_alignment_reachable_p (struct dat
tree type = (TREE_TYPE (DR_REF (dr)));
tree ba = DR_BASE_OBJECT (dr);
bool is_packed = false;
+ tree tmp = TREE_TYPE (DR_BASE_ADDRESS (dr));
if (ba)
is_packed = contains_packed_reference (ba);
+ is_packed = is_packed || contains_packed_reference (DR_BASE_ADDRESS
(dr));
+
+ if (!is_packed)
+ {
+ while (tmp)
+ {
+ is_packed = TYPE_PACKED (tmp);
+ if (is_packed)
+ break;
+
+ tmp = TREE_TYPE (tmp);
+ }
+ }
+
+ if (TREE_CODE (DR_BASE_ADDRESS (dr)) == SSA_NAME
+ && TREE_CODE (SSA_NAME_VAR (DR_BASE_ADDRESS (dr))) == PARM_DECL)
+ is_packed = true;
+
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "Unknown misalignment, is_packed = %d",is_packed);
if (targetm.vectorize.vector_alignment_reachable (type, is_packed))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42652