diff options
author | Richard Guenther <rguenther@suse.de> | 2011-06-27 10:31:30 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-06-27 10:31:30 +0000 |
commit | ccbf5bb4ae76e65ed466384fe0f087b262b8f809 (patch) | |
tree | b93a2eed6afa1461ac1645c9ecaa89fa8d56a13d | |
parent | fe4cd14b452e58fbde4525557649f769e1b4427c (diff) | |
download | gcc-ccbf5bb4ae76e65ed466384fe0f087b262b8f809.zip gcc-ccbf5bb4ae76e65ed466384fe0f087b262b8f809.tar.gz gcc-ccbf5bb4ae76e65ed466384fe0f087b262b8f809.tar.bz2 |
re PR middle-end/49536 (latent bug with creation of vector of arrays)
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.
From-SVN: r175475
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a8cf00..b6e12f1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 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. + +2011-06-27 Richard Guenther <rguenther@suse.de> + PR tree-optimization/49365 * params.def (min-insn-to-prefetch-ratio): Reduce from 10 to 9. diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index f9b9639..8ac2125 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -5350,6 +5350,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) |