]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport the fix for PR tree-optimization/49536 from mainline.
authorJack Howarth <howarth@bromo.med.uc.edu>
Fri, 10 Feb 2012 12:34:17 +0000 (12:34 +0000)
committerDuncan Sands <baldrick@gcc.gnu.org>
Fri, 10 Feb 2012 12:34:17 +0000 (12:34 +0000)
Patch by Jack Howarth, approved by Richard Guenther.

From-SVN: r184090

gcc/ChangeLog
gcc/tree-vect-stmts.c

index 6540af709841985a7f00ac126d6f546fef5594cf..36afb4283b4bc4557bf1bb0beb7e03e0e135bd34 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-09  Jack Howarth  <howarth@bromo.med.uc.edu>
+
+       Backported from mainline
+       2011-06-27  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/49536
+       * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size):
+       For non-scalar inner types use a scalar type according to
+       the scalar inner mode.
+
 2012-02-09  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index ee3492945627df378e6c54ed388b775d7e800a3a..b5ecd3f24eee25f11f236c4090a800df17bdb2a9 100644 (file)
@@ -5117,6 +5117,15 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
       && GET_MODE_CLASS (inner_mode) != MODE_FLOAT)
     return NULL_TREE;
 
+  /* We shouldn't end up building VECTOR_TYPEs of non-scalar components.
+     When the component mode passes the above test simply use a type
+     corresponding to that mode.  The theory is that any use that
+     would cause problems with this will disable vectorization anyway.  */
+  if (!SCALAR_FLOAT_TYPE_P (scalar_type)
+      && !INTEGRAL_TYPE_P (scalar_type)
+      && !POINTER_TYPE_P (scalar_type))
+    scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
+
   /* If no size was supplied use the mode the target prefers.   Otherwise
      lookup a vector mode of the specified size.  */
   if (size == 0)