aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2012-10-19 10:32:29 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-10-19 10:32:29 +0000
commitdfc2e2acc9720bec4631e07278f3be7cc915a69a (patch)
tree662e3a1f66037369a977c4a97761a98e983b085c
parent57fc62cb326ab913d7eef6d0ac0cd7788edd1797 (diff)
downloadgcc-dfc2e2acc9720bec4631e07278f3be7cc915a69a.zip
gcc-dfc2e2acc9720bec4631e07278f3be7cc915a69a.tar.gz
gcc-dfc2e2acc9720bec4631e07278f3be7cc915a69a.tar.bz2
re PR tree-optimization/54976 (FAIL: gcc.dg/torture/pr47975.c (internal compiler error))
2012-10-19 Richard Biener <rguenther@suse.de> PR tree-optimization/54976 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Robustify against odd inner_mode inputs. From-SVN: r192611
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-vect-stmts.c13
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cdba336..3741614 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-10-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/54976
+ * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size):
+ Robustify against odd inner_mode inputs.
+
2012-10-19 Zhenqiang Chen <zhenqiang.chen@linaro.org>
PR target/54892
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 70bcebb..09c8596 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6082,16 +6082,21 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
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))
+ else 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);
/* We can't build a vector type of elements with alignment bigger than
their size. */
- if (nbytes < TYPE_ALIGN_UNIT (scalar_type))
+ else if (nbytes < TYPE_ALIGN_UNIT (scalar_type))
scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
+ /* If we felt back to using the mode fail if there was
+ no scalar type for it. */
+ if (scalar_type == NULL_TREE)
+ return NULL_TREE;
+
/* If no size was supplied use the mode the target prefers. Otherwise
lookup a vector mode of the specified size. */
if (size == 0)