diff options
author | Richard Biener <rguenth@gcc.gnu.org> | 2011-12-09 11:22:59 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-12-09 11:22:59 +0000 |
commit | 48f2e3734233184ff3b7e6f6bc0c27c474a76d29 (patch) | |
tree | 3fd14b2819d5df4d70c0d977b8b8eb86af85045f /gcc/tree-vect-stmts.c | |
parent | 7a71052e76f0de7f5342cff98ef4ad87b3e4dfdf (diff) | |
download | gcc-48f2e3734233184ff3b7e6f6bc0c27c474a76d29.zip gcc-48f2e3734233184ff3b7e6f6bc0c27c474a76d29.tar.gz gcc-48f2e3734233184ff3b7e6f6bc0c27c474a76d29.tar.bz2 |
re PR tree-optimization/51482 (ice: invalid types in conversion to floating point)
2011-12-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/51482
* tree-vect-stmts.c (get_vectype_for_scalar_type_and_size):
Make sure to only create REAL_TYPE and INTEGER_TYPE component
vectors.
* g++.dg/torture/pr51482.C: New testcase.
From-SVN: r182156
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 8589a85..046a76f 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -5705,6 +5705,10 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size) if (nbytes == 0) return NULL_TREE; + if (GET_MODE_CLASS (inner_mode) != MODE_INT + && GET_MODE_CLASS (inner_mode) != MODE_FLOAT) + return NULL_TREE; + /* We can't build a vector type of elements with alignment bigger than their size. */ if (nbytes < TYPE_ALIGN_UNIT (scalar_type)) @@ -5713,16 +5717,15 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size) /* For vector types of elements whose mode precision doesn't match their types precision we use a element type of mode precision. The vectorization routines will have to make sure - they support the proper result truncation/extension. */ + they support the proper result truncation/extension. + We also make sure to build vector types with INTEGER_TYPE + component type only. */ if (INTEGRAL_TYPE_P (scalar_type) - && GET_MODE_BITSIZE (inner_mode) != TYPE_PRECISION (scalar_type)) + && (GET_MODE_BITSIZE (inner_mode) != TYPE_PRECISION (scalar_type) + || TREE_CODE (scalar_type) != INTEGER_TYPE)) scalar_type = build_nonstandard_integer_type (GET_MODE_BITSIZE (inner_mode), TYPE_UNSIGNED (scalar_type)); - if (GET_MODE_CLASS (inner_mode) != MODE_INT - && 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 |