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

--- Comment #34 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-07 
16:36:04 UTC ---
While for 4.7 we can certainly do bigger changes, for 4.6 I think a safe fix
would be:

--- gcc/tree-vect-data-refs.c    2011-03-31 08:51:03.000000000 +0200
+++ gcc/tree-vect-data-refs.c    2011-04-07 18:32:37.379420938 +0200
@@ -1110,6 +1110,9 @@ vector_alignment_reachable_p (struct dat
       if (ba)
     is_packed = contains_packed_reference (ba);

+      if (compare_tree_int (TYPE_SIZE (type), TYPE_ALIGN (type)) > 0)
+    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))

For scalars GCC ignores packed attribute, so aligned(1) is the only way to
express unaligned accesses.

Reply via email to