We fail to properly lookup the last argument of a pair of vectorized args when vectorizing a packing function call.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk sofar, to eventually catch fallout. Richard. 2011-08-23 Richard Guenther <rguent...@suse.de> PR tree-optimization/50162 * tree-vect-stmts.c (vectorizable_call): Fix argument lookup. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 177983) +++ gcc/tree-vect-stmts.c (working copy) @@ -1697,7 +1697,7 @@ vectorizable_call (gimple stmt, gimple_s } else { - vec_oprnd1 = gimple_call_arg (new_stmt, 2*i); + vec_oprnd1 = gimple_call_arg (new_stmt, 2*i + 1); vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd1); vec_oprnd1