diff options
author | Michael Meissner <meissner@linux.vnet.ibm.com> | 2009-05-08 22:38:49 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2009-05-08 22:38:49 +0000 |
commit | ad6c0864efa692fd8123a9d680e5c405a8a5dbb2 (patch) | |
tree | 0af10d3c32a433a02b46a4025e3c6673a396c80e /gcc/tree-vect-stmts.c | |
parent | c94f9067af215b26b634b6c9678297aa92d74fc7 (diff) | |
download | gcc-ad6c0864efa692fd8123a9d680e5c405a8a5dbb2.zip gcc-ad6c0864efa692fd8123a9d680e5c405a8a5dbb2.tar.gz gcc-ad6c0864efa692fd8123a9d680e5c405a8a5dbb2.tar.bz2 |
Fix PR 40049
From-SVN: r147298
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 0ab9883..06d51e2 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1974,11 +1974,20 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi, else { optab = optab_for_tree_code (code, vectype, optab_vector); - if (vect_print_dump_info (REPORT_DETAILS) - && optab + if (optab && (optab_handler (optab, TYPE_MODE (vectype))->insn_code != CODE_FOR_nothing)) - fprintf (vect_dump, "vector/vector shift/rotate found."); + { + if (vect_print_dump_info (REPORT_DETAILS)) + fprintf (vect_dump, "vector/vector shift/rotate found."); + + /* Unlike the other binary operators, shifts/rotates have + the rhs being int, instead of the same type as the lhs, + so make sure the scalar is the right type if we are + dealing with vectors of short/char. */ + if (dt[1] == vect_constant_def) + op1 = fold_convert (TREE_TYPE (vectype), op1); + } } } |